@@ -1121,7 +1121,6 @@ static int
11211121ble_ll_adv_tx_start_cb (struct ble_ll_sched_item * sch )
11221122{
11231123 int rc ;
1124- uint8_t end_trans ;
11251124 uint32_t txstart ;
11261125 struct ble_ll_adv_sm * advsm ;
11271126
@@ -1183,18 +1182,18 @@ ble_ll_adv_tx_start_cb(struct ble_ll_sched_item *sch)
11831182 if ((advsm -> props & BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY ) &&
11841183 ((advsm -> props & BLE_HCI_LE_SET_EXT_ADV_PROP_CONNECTABLE ) ||
11851184 (advsm -> props & BLE_HCI_LE_SET_EXT_ADV_PROP_SCANNABLE ))) {
1186- end_trans = BLE_PHY_TRANSITION_TX_RX ;
1185+ ble_phy_transition_set ( BLE_PHY_TRANSITION_TO_RX , BLE_LL_IFS ) ;
11871186 ble_phy_set_txend_cb (NULL , NULL );
11881187 } else {
1189- end_trans = BLE_PHY_TRANSITION_NONE ;
1188+ ble_phy_transition_set ( BLE_PHY_TRANSITION_NONE , 0 ) ;
11901189 ble_phy_set_txend_cb (ble_ll_adv_tx_done , advsm );
11911190 }
11921191
11931192 /* Transmit advertisement */
11941193#if MYNEWT_VAL (BLE_LL_CFG_FEAT_LL_EXT_ADV )
1195- rc = ble_phy_tx (ble_ll_adv_pdu_make , advsm , end_trans );
1194+ rc = ble_phy_tx (ble_ll_adv_pdu_make , advsm );
11961195#else
1197- rc = ble_phy_tx (ble_ll_adv_legacy_pdu_make , advsm , end_trans );
1196+ rc = ble_phy_tx (ble_ll_adv_legacy_pdu_make , advsm );
11981197#endif
11991198 if (rc ) {
12001199 goto adv_tx_done ;
@@ -1268,7 +1267,6 @@ static int
12681267ble_ll_adv_secondary_tx_start_cb (struct ble_ll_sched_item * sch )
12691268{
12701269 int rc ;
1271- uint8_t end_trans ;
12721270 uint32_t txstart ;
12731271 struct ble_ll_adv_sm * advsm ;
12741272 ble_phy_tx_pducb_t pducb ;
@@ -1319,22 +1317,22 @@ ble_ll_adv_secondary_tx_start_cb(struct ble_ll_sched_item *sch)
13191317
13201318 /* Set phy mode based on type of advertisement */
13211319 if (advsm -> props & BLE_HCI_LE_SET_EXT_ADV_PROP_CONNECTABLE ) {
1322- end_trans = BLE_PHY_TRANSITION_TX_RX ;
1320+ ble_phy_transition_set ( BLE_PHY_TRANSITION_TO_RX , BLE_LL_IFS ) ;
13231321 ble_phy_set_txend_cb (NULL , NULL );
13241322 pducb = ble_ll_adv_aux_pdu_make ;
13251323 } else if ((advsm -> props & BLE_HCI_LE_SET_EXT_ADV_PROP_SCANNABLE ) &&
13261324 advsm -> aux_first_pdu ) {
1327- end_trans = BLE_PHY_TRANSITION_TX_RX ;
1325+ ble_phy_transition_set ( BLE_PHY_TRANSITION_TO_RX , BLE_LL_IFS ) ;
13281326 ble_phy_set_txend_cb (NULL , NULL );
13291327 pducb = ble_ll_adv_aux_scannable_pdu_make ;
13301328 } else {
1331- end_trans = BLE_PHY_TRANSITION_NONE ;
1329+ ble_phy_transition_set ( BLE_PHY_TRANSITION_NONE , 0 ) ;
13321330 ble_phy_set_txend_cb (ble_ll_adv_tx_done , advsm );
13331331 pducb = ble_ll_adv_aux_pdu_make ;
13341332 }
13351333
13361334 /* Transmit advertisement */
1337- rc = ble_phy_tx (pducb , advsm , end_trans );
1335+ rc = ble_phy_tx (pducb , advsm );
13381336 if (rc ) {
13391337 goto adv_aux_dropped ;
13401338 }
@@ -2322,8 +2320,9 @@ ble_ll_adv_sync_tx_start_cb(struct ble_ll_sched_item *sch)
23222320#endif
23232321
23242322 /* Transmit advertisement */
2323+ ble_phy_transition_set (BLE_PHY_TRANSITION_NONE , 0 );
23252324 ble_phy_set_txend_cb (ble_ll_adv_sync_tx_end , advsm );
2326- rc = ble_phy_tx (ble_ll_adv_sync_pdu_make , advsm , BLE_PHY_TRANSITION_NONE );
2325+ rc = ble_phy_tx (ble_ll_adv_sync_pdu_make , advsm );
23272326 if (rc ) {
23282327 goto adv_tx_done ;
23292328 }
@@ -4547,6 +4546,8 @@ ble_ll_adv_rx_req(uint8_t pdu_type, struct os_mbuf *rxpdu)
45474546 */
45484547 ble_phy_set_txend_cb (ble_ll_adv_tx_done , advsm );
45494548
4549+ ble_phy_transition_set (BLE_PHY_TRANSITION_NONE , 0 );
4550+
45504551#if MYNEWT_VAL (BLE_LL_CFG_FEAT_LL_EXT_ADV )
45514552 if (advsm -> flags & BLE_LL_ADV_SM_FLAG_SCAN_REQ_NOTIF ) {
45524553 ble_ll_hci_ev_send_scan_req_recv (advsm -> adv_instance , peer ,
@@ -4560,12 +4561,10 @@ ble_ll_adv_rx_req(uint8_t pdu_type, struct os_mbuf *rxpdu)
45604561 */
45614562
45624563 advsm -> rx_ble_hdr = ble_hdr ;
4563- rc = ble_phy_tx (ble_ll_adv_scan_rsp_pdu_make , advsm ,
4564- BLE_PHY_TRANSITION_NONE );
4564+ rc = ble_phy_tx (ble_ll_adv_scan_rsp_pdu_make , advsm );
45654565 advsm -> rx_ble_hdr = NULL ;
45664566#else
4567- rc = ble_phy_tx (ble_ll_adv_scan_rsp_legacy_pdu_make , advsm ,
4568- BLE_PHY_TRANSITION_NONE );
4567+ rc = ble_phy_tx (ble_ll_adv_scan_rsp_legacy_pdu_make , advsm );
45694568#endif
45704569
45714570 if (!rc ) {
@@ -4599,9 +4598,9 @@ ble_ll_adv_rx_req(uint8_t pdu_type, struct os_mbuf *rxpdu)
45994598 rsp_data .peer = rxbuf + BLE_LL_PDU_HDR_LEN ;
46004599 rsp_data .rxadd = rxbuf [0 ] & BLE_ADV_PDU_HDR_TXADD_MASK ;
46014600
4601+ ble_phy_transition_set (BLE_PHY_TRANSITION_NONE , 0 );
46024602 ble_phy_set_txend_cb (ble_ll_adv_tx_done , advsm );
4603- rc = ble_phy_tx (ble_ll_adv_aux_conn_rsp_pdu_make , & rsp_data ,
4604- BLE_PHY_TRANSITION_NONE );
4603+ rc = ble_phy_tx (ble_ll_adv_aux_conn_rsp_pdu_make , & rsp_data );
46054604 if (!rc ) {
46064605 ble_ll_adv_flags_set (advsm , BLE_LL_ADV_SM_FLAG_CONN_RSP_TXD );
46074606 STATS_INC (ble_ll_stats , aux_conn_rsp_tx );
@@ -4892,6 +4891,8 @@ ble_ll_adv_rx_isr_start(uint8_t pdu_type)
48924891 */
48934892 if (rc < 0 ) {
48944893 ble_ll_adv_tx_done (advsm );
4894+ } else if (rc > 0 ){
4895+ ble_phy_transition_set (BLE_PHY_TRANSITION_TO_TX , BLE_LL_IFS );
48954896 }
48964897
48974898 return rc ;
0 commit comments