Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Host: More bsim refactoring #85319

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HaavardRei
Copy link
Contributor

Commit does the following changes:

  • Use functionality from the babbelkit library for common functions related to flags, test progression (failing, passing etc.) and synchronization between two devices. Locally defined equivalents are removed.
  • Removes the files containing only functionality that is provided by the babblekit library.
  • Remove the test_pre_init_f and test_tick_f functions (commonly implemented as test_init and test_tick) from the modified tests. These functions are not needed as they were only used to fail the test if a device didn't complete the test within a certain time frame. This is already handled by the sim_length argument used in the test scripts.

Commit does the following changes:
* Use functionality from the `babbelkit` library for common functions
  related to flags, test progression (failing, passing etc.) and
  synchronization between two devices. Locally defined equivalents are
  removed.
* Removes the files containing only functionality that is provided
  by the `babblekit` library.
* Remove the `test_pre_init_f` and `test_tick_f` functions (commonly
  implemented as `test_init` and `test_tick`) from the modified tests.
  These functions are not needed as they were only used to fail the test
  if a device didn't complete the test within a certain time frame. This
  is already handled by the `sim_length` argument used in the test
  scripts.

Signed-off-by: Håvard Reierstad <[email protected]>
@Thalley
Copy link
Collaborator

Thalley commented Feb 6, 2025

image
Love to see PRs like that :D Less code, less maintenance (but will take a while to review)

Copy link
Member

@aescolar aescolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly a +1 from me after a very fast review.


#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(bt_bsim_mtu_update, LOG_LEVEL_DBG);

#define PERIPHERAL_NOTIFY_TIME 10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion

Suggested change
#define PERIPHERAL_NOTIFY_TIME 10
#define PERIPHERAL_NOTIFY_TIME 10 /* seconds */

@@ -22,6 +31,14 @@ struct adv_set_data_t {
static uint8_t adv_index;
static struct adv_set_data_t adv_set_data[CONFIG_BT_EXT_ADV_MAX_ADV_SET];

static void print_address(bt_addr_le_t *addr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems a bit silly to copy this around.. don't you want to add it to the babblekit library?
(or leave it in that bs_bt_utils.c as a more evident thing somebody will be inclined to clean later :) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants