Merge pull request #93 from andrzej-kaczmarek/fix-auth-pyld-tmo-evt

nimble/host: Enable auth payload tmo event only for >=4.1
This commit is contained in:
Andrzej Kaczmarek
2018-05-15 09:11:06 +02:00
committed by GitHub
+15 -10
View File
@@ -279,8 +279,11 @@ static int
ble_hs_startup_set_evmask_tx(void)
{
uint8_t buf[BLE_HCI_SET_EVENT_MASK_LEN];
uint8_t version;
int rc;
version = ble_hs_hci_get_hci_version();
/**
* Enable the following events:
* 0x0000000000000010 Disconnection Complete Event
@@ -298,16 +301,18 @@ ble_hs_startup_set_evmask_tx(void)
return rc;
}
/**
* Enable the following events:
* 0x0000000000800000 Authenticated Payload Timeout Event
*/
ble_hs_hci_cmd_build_set_event_mask2(0x0000000000800000, buf, sizeof buf);
rc = ble_hs_hci_cmd_tx_empty_ack(BLE_HCI_OP(BLE_HCI_OGF_CTLR_BASEBAND,
BLE_HCI_OCF_CB_SET_EVENT_MASK2),
buf, sizeof(buf));
if (rc != 0) {
return rc;
if (version >= BLE_HCI_VER_BCS_4_1) {
/**
* Enable the following events:
* 0x0000000000800000 Authenticated Payload Timeout Event
*/
ble_hs_hci_cmd_build_set_event_mask2(0x0000000000800000, buf, sizeof buf);
rc = ble_hs_hci_cmd_tx_empty_ack(BLE_HCI_OP(BLE_HCI_OGF_CTLR_BASEBAND,
BLE_HCI_OCF_CB_SET_EVENT_MASK2),
buf, sizeof(buf));
if (rc != 0) {
return rc;
}
}
return 0;