Bluetooth: controller: Refactor BT_CTLR_ADV_INDICATION feature
Refactor BT_CTLR_ADV_INDICATION feature by moving the implementation closer to the implementation that is closing the advertisement event so that in the future new members can be added as necessary (example, advertised channels). Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
baf05409f8
commit
57e49b1f03
1 changed files with 17 additions and 18 deletions
|
@ -3908,6 +3908,23 @@ static inline u32_t isr_close_adv(void)
|
|||
(_radio.ticker_id_stop ==
|
||||
RADIO_TICKER_ID_ADV));
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_ADV_INDICATION)
|
||||
if (1) {
|
||||
struct radio_pdu_node_rx *node_rx;
|
||||
|
||||
node_rx = packet_rx_reserve_get(3);
|
||||
if (node_rx) {
|
||||
node_rx->hdr.type = NODE_RX_TYPE_ADV_INDICATION;
|
||||
node_rx->hdr.handle = 0xFFFF;
|
||||
/* TODO: add other info by defining a payload
|
||||
* structure.
|
||||
*/
|
||||
|
||||
packet_rx_enqueue();
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_BT_CTLR_ADV_INDICATION */
|
||||
}
|
||||
|
||||
return dont_close;
|
||||
|
@ -4262,24 +4279,6 @@ static inline void isr_radio_state_close(void)
|
|||
switch (_radio.role) {
|
||||
case ROLE_ADV:
|
||||
dont_close = isr_close_adv();
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_ADV_INDICATION)
|
||||
if (!dont_close) {
|
||||
struct radio_pdu_node_rx *node_rx;
|
||||
|
||||
node_rx = packet_rx_reserve_get(3);
|
||||
if (node_rx) {
|
||||
node_rx->hdr.type = NODE_RX_TYPE_ADV_INDICATION;
|
||||
node_rx->hdr.handle = 0xFFFF;
|
||||
/* TODO: add other info by defining a payload
|
||||
* structure.
|
||||
*/
|
||||
|
||||
packet_rx_enqueue();
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_BT_CTLR_ADV_INDICATION */
|
||||
|
||||
break;
|
||||
|
||||
case ROLE_SCAN:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue