Skip to content

Commit

Permalink
samples: dect_phy: dect_shell: rach_tx: fix: always get fresh nbr info
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jhirsi authored and jukkar committed Dec 19, 2024
1 parent 1a90dcf commit 94e406b
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,17 @@ static void dect_phy_mac_client_rach_tx_worker(struct k_work *work_item)
strncpy(cmd_params.tx_data_str, tmp_str, DECT_DATA_MAX_LEN - 1);
}

/* Get fresh nbr info */
struct dect_phy_mac_nbr_info_list_item *scan_info =
dect_phy_mac_nbr_info_get_by_long_rd_id(cmd_params.target_long_rd_id);

if (!scan_info) {
desh_warn("(%s): Beacon with long RD ID %u has not been seen in scan results",
(__func__), cmd_params.target_long_rd_id);
return;
}

data->target_nbr = *scan_info;
err = dect_phy_mac_client_rach_tx(&data->target_nbr, &cmd_params);
if (err) {
desh_error("(%s): client_rach_tx failed: %d", (__func__), err);
Expand Down

0 comments on commit 94e406b

Please sign in to comment.