Skip to content

Commit

Permalink
Bluetooth: controller: Add function to calculate channel identifier
Browse files Browse the repository at this point in the history
Added function to calculate channel identifier value
required for Channel Selection Algorithm #2.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
  • Loading branch information
cvinayak authored and carlescufi committed Mar 18, 2021
1 parent b813616 commit c5e7550
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions subsys/bluetooth/controller/ll_sw/lll_chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ uint8_t lll_chan_sel_1(uint8_t *chan_use, uint8_t hop, uint16_t latency, uint8_t
#endif /* CONFIG_BT_CONN */

#if defined(CONFIG_BT_CTLR_CHAN_SEL_2)
uint16_t lll_chan_id(uint8_t *access_addr)
{
uint16_t aa_ls = ((uint16_t)access_addr[1] << 8) | access_addr[0];
uint16_t aa_ms = ((uint16_t)access_addr[3] << 8) | access_addr[2];

return aa_ms ^ aa_ls;
}

uint8_t lll_chan_sel_2(uint16_t counter, uint16_t chan_id, uint8_t *chan_map,
uint8_t chan_count)
{
Expand Down
1 change: 1 addition & 0 deletions subsys/bluetooth/controller/ll_sw/lll_chan.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@

uint8_t lll_chan_sel_1(uint8_t *chan_use, uint8_t hop, uint16_t latency, uint8_t *chan_map,
uint8_t chan_count);
uint16_t lll_chan_id(uint8_t *access_addr);
uint8_t lll_chan_sel_2(uint16_t counter, uint16_t chan_id, uint8_t *chan_map,
uint8_t chan_count);

0 comments on commit c5e7550

Please sign in to comment.