@@ -8142,7 +8142,7 @@ u32_t radio_adv_enable(u16_t interval, u8_t chl_map, u8_t filter_policy)
8142
8142
u32_t ret ;
8143
8143
8144
8144
if (_radio .advertiser .is_enabled ) {
8145
- return 1 ;
8145
+ return BT_HCI_ERR_CMD_DISALLOWED ;
8146
8146
}
8147
8147
8148
8148
pdu_adv = (struct pdu_adv * )
@@ -8153,19 +8153,19 @@ u32_t radio_adv_enable(u16_t interval, u8_t chl_map, u8_t filter_policy)
8153
8153
void * link ;
8154
8154
8155
8155
if (_radio .advertiser .conn ) {
8156
- return 1 ;
8156
+ return BT_HCI_ERR_CMD_DISALLOWED ;
8157
8157
}
8158
8158
8159
8159
link = mem_acquire (& _radio .link_rx_free );
8160
8160
if (!link ) {
8161
- return 1 ;
8161
+ return BT_HCI_ERR_MEM_CAPACITY_EXCEEDED ;
8162
8162
}
8163
8163
8164
8164
conn = mem_acquire (& _radio .conn_free );
8165
8165
if (!conn ) {
8166
8166
mem_release (link , & _radio .link_rx_free );
8167
8167
8168
- return 1 ;
8168
+ return BT_HCI_ERR_MEM_CAPACITY_EXCEEDED ;
8169
8169
}
8170
8170
8171
8171
conn -> handle = 0xFFFF ;
@@ -8347,7 +8347,7 @@ u32_t radio_adv_enable(u16_t interval, u8_t chl_map, u8_t filter_policy)
8347
8347
mem_release (conn , & _radio .conn_free );
8348
8348
}
8349
8349
8350
- return 1 ;
8350
+ return BT_HCI_ERR_CMD_DISALLOWED ;
8351
8351
}
8352
8352
8353
8353
u32_t radio_adv_disable (void )
@@ -8375,7 +8375,7 @@ u32_t radio_adv_disable(void)
8375
8375
}
8376
8376
}
8377
8377
8378
- return status ;
8378
+ return status ? BT_HCI_ERR_CMD_DISALLOWED : 0 ;
8379
8379
}
8380
8380
8381
8381
u32_t radio_adv_is_enabled (void )
@@ -8408,7 +8408,7 @@ u32_t radio_scan_enable(u8_t type, u8_t init_addr_type, u8_t *init_addr,
8408
8408
u32_t ret ;
8409
8409
8410
8410
if (_radio .scanner .is_enabled ) {
8411
- return 1 ;
8411
+ return BT_HCI_ERR_CMD_DISALLOWED ;
8412
8412
}
8413
8413
8414
8414
_radio .scanner .type = type ;
@@ -8479,7 +8479,7 @@ u32_t radio_scan_enable(u8_t type, u8_t init_addr_type, u8_t *init_addr,
8479
8479
}
8480
8480
8481
8481
if (ret_cb != TICKER_STATUS_SUCCESS ) {
8482
- return 1 ;
8482
+ return BT_HCI_ERR_CMD_DISALLOWED ;
8483
8483
}
8484
8484
8485
8485
_radio .scanner .is_enabled = 1 ;
@@ -8517,7 +8517,7 @@ u32_t radio_scan_disable(void)
8517
8517
}
8518
8518
}
8519
8519
8520
- return status ;
8520
+ return status ? BT_HCI_ERR_CMD_DISALLOWED : 0 ;
8521
8521
}
8522
8522
8523
8523
u32_t radio_scan_is_enabled (void )
@@ -8548,23 +8548,20 @@ u32_t radio_connect_enable(u8_t adv_addr_type, u8_t *adv_addr, u16_t interval,
8548
8548
void * link ;
8549
8549
8550
8550
if (_radio .scanner .conn ) {
8551
- return 1 ;
8551
+ return BT_HCI_ERR_CMD_DISALLOWED ;
8552
8552
}
8553
8553
8554
8554
link = mem_acquire (& _radio .link_rx_free );
8555
8555
if (!link ) {
8556
- return 1 ;
8556
+ return BT_HCI_ERR_MEM_CAPACITY_EXCEEDED ;
8557
8557
}
8558
8558
8559
8559
conn = mem_acquire (& _radio .conn_free );
8560
8560
if (!conn ) {
8561
8561
mem_release (link , & _radio .link_rx_free );
8562
-
8563
- return 1 ;
8562
+ return BT_HCI_ERR_MEM_CAPACITY_EXCEEDED ;
8564
8563
}
8565
8564
8566
- radio_scan_disable ();
8567
-
8568
8565
_radio .scanner .adv_addr_type = adv_addr_type ;
8569
8566
memcpy (& _radio .scanner .adv_addr [0 ], adv_addr , BDADDR_SIZE );
8570
8567
_radio .scanner .conn_interval = interval ;
@@ -8684,7 +8681,7 @@ u32_t ll_connect_disable(void)
8684
8681
u32_t status ;
8685
8682
8686
8683
if (_radio .scanner .conn == 0 ) {
8687
- return 1 ;
8684
+ return BT_HCI_ERR_CMD_DISALLOWED ;
8688
8685
}
8689
8686
8690
8687
status = radio_scan_disable ();
0 commit comments