Skip to content

Commit 94e406b

Browse files
jhirsijukkar
authored andcommitted
samples: dect_phy: dect_shell: rach_tx: fix: always get fresh nbr info
Periodic rach_tx started failing after ~5h because we did not fresh neigbor timing info from the nbr scan list which is updated when associated by the background scan for the associated beacon. Signed-off-by: Jani Hirsimäki <[email protected]>
1 parent 1a90dcf commit 94e406b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

samples/dect/dect_phy/dect_shell/src/dect/mac/dect_phy_mac_client.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,17 @@ static void dect_phy_mac_client_rach_tx_worker(struct k_work *work_item)
294294
strncpy(cmd_params.tx_data_str, tmp_str, DECT_DATA_MAX_LEN - 1);
295295
}
296296

297+
/* Get fresh nbr info */
298+
struct dect_phy_mac_nbr_info_list_item *scan_info =
299+
dect_phy_mac_nbr_info_get_by_long_rd_id(cmd_params.target_long_rd_id);
300+
301+
if (!scan_info) {
302+
desh_warn("(%s): Beacon with long RD ID %u has not been seen in scan results",
303+
(__func__), cmd_params.target_long_rd_id);
304+
return;
305+
}
306+
307+
data->target_nbr = *scan_info;
297308
err = dect_phy_mac_client_rach_tx(&data->target_nbr, &cmd_params);
298309
if (err) {
299310
desh_error("(%s): client_rach_tx failed: %d", (__func__), err);

0 commit comments

Comments
 (0)