Skip to content

Commit cbb69d8

Browse files
Mirlenkocarlescufi
authored andcommitted
samples: bluetooth: Use unified mode in CS config logging
The separate main_mode_type and sub_mode_type fields in the CS configuration have been replaced by a single mode field. Updates the logging in the config_create_cb callback to reflect this change. This aligns the sample with the updated API. Signed-off-by: Aleksandr Mirlenko <[email protected]>
1 parent 492e8ac commit cbb69d8

File tree

2 files changed

+6
-14
lines changed
  • samples/bluetooth
    • channel_sounding_ras_initiator/src
    • channel_sounding_ras_reflector/src

2 files changed

+6
-14
lines changed

samples/bluetooth/channel_sounding_ras_initiator/src/main.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,7 @@ static void config_create_cb(struct bt_conn *conn, uint8_t status,
415415
const char *chsel_type_str[3] = {"Algorithm #3b", "Algorithm #3c", "Invalid"};
416416
const char *ch3c_shape_str[3] = {"Hat shape", "X shape", "Invalid"};
417417

418-
uint8_t main_mode_idx = config->main_mode_type > 0 && config->main_mode_type < 4
419-
? config->main_mode_type
420-
: 4;
421-
uint8_t sub_mode_idx = config->sub_mode_type < 4 ? config->sub_mode_type : 0;
418+
uint8_t mode_idx = config->mode > 0 && config->mode < 4 ? config->mode : 4;
422419
uint8_t role_idx = MIN(config->role, 2);
423420
uint8_t rtt_type_idx = MIN(config->rtt_type, 7);
424421
uint8_t phy_idx = config->cs_sync_phy > 0 && config->cs_sync_phy < 4
@@ -429,8 +426,7 @@ static void config_create_cb(struct bt_conn *conn, uint8_t status,
429426

430427
LOG_INF("CS config creation complete.\n"
431428
" - id: %u\n"
432-
" - main_mode_type: %s\n"
433-
" - sub_mode_type: %s\n"
429+
" - mode: %s\n"
434430
" - min_main_mode_steps: %u\n"
435431
" - max_main_mode_steps: %u\n"
436432
" - main_mode_repetition: %u\n"
@@ -447,7 +443,7 @@ static void config_create_cb(struct bt_conn *conn, uint8_t status,
447443
" - t_fcs_time_us: %u\n"
448444
" - t_pm_time_us: %u\n"
449445
" - channel_map: 0x%08X%08X%04X\n",
450-
config->id, mode_str[main_mode_idx], mode_str[sub_mode_idx],
446+
config->id, mode_str[mode_idx],
451447
config->min_main_mode_steps, config->max_main_mode_steps,
452448
config->main_mode_repetition, config->mode_0_steps, role_str[role_idx],
453449
rtt_type_str[rtt_type_idx], phy_str[phy_idx],

samples/bluetooth/channel_sounding_ras_reflector/src/main.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,7 @@ static void config_create_cb(struct bt_conn *conn, uint8_t status,
9797
const char *chsel_type_str[3] = {"Algorithm #3b", "Algorithm #3c", "Invalid"};
9898
const char *ch3c_shape_str[3] = {"Hat shape", "X shape", "Invalid"};
9999

100-
uint8_t main_mode_idx = config->main_mode_type > 0 && config->main_mode_type < 4
101-
? config->main_mode_type
102-
: 4;
103-
uint8_t sub_mode_idx = config->sub_mode_type < 4 ? config->sub_mode_type : 0;
100+
uint8_t mode_idx = config->mode > 0 && config->mode < 4 ? config->mode : 4;
104101
uint8_t role_idx = MIN(config->role, 2);
105102
uint8_t rtt_type_idx = MIN(config->rtt_type, 7);
106103
uint8_t phy_idx = config->cs_sync_phy > 0 && config->cs_sync_phy < 4
@@ -111,8 +108,7 @@ static void config_create_cb(struct bt_conn *conn, uint8_t status,
111108

112109
LOG_INF("CS config creation complete.\n"
113110
" - id: %u\n"
114-
" - main_mode_type: %s\n"
115-
" - sub_mode_type: %s\n"
111+
" - mode: %s\n"
116112
" - min_main_mode_steps: %u\n"
117113
" - max_main_mode_steps: %u\n"
118114
" - main_mode_repetition: %u\n"
@@ -129,7 +125,7 @@ static void config_create_cb(struct bt_conn *conn, uint8_t status,
129125
" - t_fcs_time_us: %u\n"
130126
" - t_pm_time_us: %u\n"
131127
" - channel_map: 0x%08X%08X%04X\n",
132-
config->id, mode_str[main_mode_idx], mode_str[sub_mode_idx],
128+
config->id, mode_str[mode_idx],
133129
config->min_main_mode_steps, config->max_main_mode_steps,
134130
config->main_mode_repetition, config->mode_0_steps, role_str[role_idx],
135131
rtt_type_str[rtt_type_idx], phy_str[phy_idx],

0 commit comments

Comments
 (0)