@@ -1126,7 +1126,6 @@ static int
11261126ble_ll_adv_tx_start_cb (struct ble_ll_sched_item * sch )
11271127{
11281128 int rc ;
1129- uint8_t end_trans ;
11301129 uint32_t txstart ;
11311130 struct ble_ll_adv_sm * advsm ;
11321131#if MYNEWT_VAL (BLE_LL_PHY ) && MYNEWT_VAL (BLE_LL_CFG_FEAT_LL_EXT_ADV )
@@ -1196,18 +1195,18 @@ ble_ll_adv_tx_start_cb(struct ble_ll_sched_item *sch)
11961195 if ((advsm -> props & BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY ) &&
11971196 ((advsm -> props & BLE_HCI_LE_SET_EXT_ADV_PROP_CONNECTABLE ) ||
11981197 (advsm -> props & BLE_HCI_LE_SET_EXT_ADV_PROP_SCANNABLE ))) {
1199- end_trans = BLE_PHY_TRANSITION_TX_RX ;
1198+ ble_phy_transition_set ( BLE_PHY_TRANSITION_TO_RX , BLE_LL_IFS ) ;
12001199 ble_phy_set_txend_cb (NULL , NULL );
12011200 } else {
1202- end_trans = BLE_PHY_TRANSITION_NONE ;
1201+ ble_phy_transition_set ( BLE_PHY_TRANSITION_NONE , 0 ) ;
12031202 ble_phy_set_txend_cb (ble_ll_adv_tx_done , advsm );
12041203 }
12051204
12061205 /* Transmit advertisement */
12071206#if MYNEWT_VAL (BLE_LL_CFG_FEAT_LL_EXT_ADV )
1208- rc = ble_phy_tx (ble_ll_adv_pdu_make , advsm , end_trans );
1207+ rc = ble_phy_tx (ble_ll_adv_pdu_make , advsm );
12091208#else
1210- rc = ble_phy_tx (ble_ll_adv_legacy_pdu_make , advsm , end_trans );
1209+ rc = ble_phy_tx (ble_ll_adv_legacy_pdu_make , advsm );
12111210#endif
12121211 if (rc ) {
12131212 goto adv_tx_done ;
@@ -1281,7 +1280,6 @@ static int
12811280ble_ll_adv_secondary_tx_start_cb (struct ble_ll_sched_item * sch )
12821281{
12831282 int rc ;
1284- uint8_t end_trans ;
12851283 uint32_t txstart ;
12861284 struct ble_ll_adv_sm * advsm ;
12871285 ble_phy_tx_pducb_t pducb ;
@@ -1340,22 +1338,22 @@ ble_ll_adv_secondary_tx_start_cb(struct ble_ll_sched_item *sch)
13401338
13411339 /* Set phy mode based on type of advertisement */
13421340 if (advsm -> props & BLE_HCI_LE_SET_EXT_ADV_PROP_CONNECTABLE ) {
1343- end_trans = BLE_PHY_TRANSITION_TX_RX ;
1341+ ble_phy_transition_set ( BLE_PHY_TRANSITION_TO_RX , BLE_LL_IFS ) ;
13441342 ble_phy_set_txend_cb (NULL , NULL );
13451343 pducb = ble_ll_adv_aux_pdu_make ;
13461344 } else if ((advsm -> props & BLE_HCI_LE_SET_EXT_ADV_PROP_SCANNABLE ) &&
13471345 advsm -> aux_first_pdu ) {
1348- end_trans = BLE_PHY_TRANSITION_TX_RX ;
1346+ ble_phy_transition_set ( BLE_PHY_TRANSITION_TO_RX , BLE_LL_IFS ) ;
13491347 ble_phy_set_txend_cb (NULL , NULL );
13501348 pducb = ble_ll_adv_aux_scannable_pdu_make ;
13511349 } else {
1352- end_trans = BLE_PHY_TRANSITION_NONE ;
1350+ ble_phy_transition_set ( BLE_PHY_TRANSITION_NONE , 0 ) ;
13531351 ble_phy_set_txend_cb (ble_ll_adv_tx_done , advsm );
13541352 pducb = ble_ll_adv_aux_pdu_make ;
13551353 }
13561354
13571355 /* Transmit advertisement */
1358- rc = ble_phy_tx (pducb , advsm , end_trans );
1356+ rc = ble_phy_tx (pducb , advsm );
13591357 if (rc ) {
13601358 goto adv_aux_dropped ;
13611359 }
@@ -2343,8 +2341,9 @@ ble_ll_adv_sync_tx_start_cb(struct ble_ll_sched_item *sch)
23432341#endif
23442342
23452343 /* Transmit advertisement */
2344+ ble_phy_transition_set (BLE_PHY_TRANSITION_NONE , 0 );
23462345 ble_phy_set_txend_cb (ble_ll_adv_sync_tx_end , advsm );
2347- rc = ble_phy_tx (ble_ll_adv_sync_pdu_make , advsm , BLE_PHY_TRANSITION_NONE );
2346+ rc = ble_phy_tx (ble_ll_adv_sync_pdu_make , advsm );
23482347 if (rc ) {
23492348 goto adv_tx_done ;
23502349 }
@@ -4568,6 +4567,8 @@ ble_ll_adv_rx_req(uint8_t pdu_type, struct os_mbuf *rxpdu)
45684567 */
45694568 ble_phy_set_txend_cb (ble_ll_adv_tx_done , advsm );
45704569
4570+ ble_phy_transition_set (BLE_PHY_TRANSITION_NONE , 0 );
4571+
45714572#if MYNEWT_VAL (BLE_LL_CFG_FEAT_LL_EXT_ADV )
45724573 if (advsm -> flags & BLE_LL_ADV_SM_FLAG_SCAN_REQ_NOTIF ) {
45734574 ble_ll_hci_ev_send_scan_req_recv (advsm -> adv_instance , peer ,
@@ -4581,12 +4582,10 @@ ble_ll_adv_rx_req(uint8_t pdu_type, struct os_mbuf *rxpdu)
45814582 */
45824583
45834584 advsm -> rx_ble_hdr = ble_hdr ;
4584- rc = ble_phy_tx (ble_ll_adv_scan_rsp_pdu_make , advsm ,
4585- BLE_PHY_TRANSITION_NONE );
4585+ rc = ble_phy_tx (ble_ll_adv_scan_rsp_pdu_make , advsm );
45864586 advsm -> rx_ble_hdr = NULL ;
45874587#else
4588- rc = ble_phy_tx (ble_ll_adv_scan_rsp_legacy_pdu_make , advsm ,
4589- BLE_PHY_TRANSITION_NONE );
4588+ rc = ble_phy_tx (ble_ll_adv_scan_rsp_legacy_pdu_make , advsm );
45904589#endif
45914590
45924591 if (!rc ) {
@@ -4620,9 +4619,9 @@ ble_ll_adv_rx_req(uint8_t pdu_type, struct os_mbuf *rxpdu)
46204619 rsp_data .peer = rxbuf + BLE_LL_PDU_HDR_LEN ;
46214620 rsp_data .rxadd = rxbuf [0 ] & BLE_ADV_PDU_HDR_TXADD_MASK ;
46224621
4622+ ble_phy_transition_set (BLE_PHY_TRANSITION_NONE , 0 );
46234623 ble_phy_set_txend_cb (ble_ll_adv_tx_done , advsm );
4624- rc = ble_phy_tx (ble_ll_adv_aux_conn_rsp_pdu_make , & rsp_data ,
4625- BLE_PHY_TRANSITION_NONE );
4624+ rc = ble_phy_tx (ble_ll_adv_aux_conn_rsp_pdu_make , & rsp_data );
46264625 if (!rc ) {
46274626 ble_ll_adv_flags_set (advsm , BLE_LL_ADV_SM_FLAG_CONN_RSP_TXD );
46284627 STATS_INC (ble_ll_stats , aux_conn_rsp_tx );
@@ -4913,6 +4912,8 @@ ble_ll_adv_rx_isr_start(uint8_t pdu_type)
49134912 */
49144913 if (rc < 0 ) {
49154914 ble_ll_adv_tx_done (advsm );
4915+ } else if (rc > 0 ){
4916+ ble_phy_transition_set (BLE_PHY_TRANSITION_TO_TX , BLE_LL_IFS );
49164917 }
49174918
49184919 return rc ;
0 commit comments