nimble/host: Enable auth payload tmo event only for >=4.1
LE Ping was added in Core 4.1 thus Authenticated Payload Timeout Event
shall be only enabled for controller supporting >=4.1.
Note it would be also good to check for controller features to confirm,
but we do not have this implemented yet.
@@ -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,6 +301,7 @@ ble_hs_startup_set_evmask_tx(void)
return rc;
}
+ if (version >= BLE_HCI_VER_BCS_4_1) {
/**
* Enable the following events:
* 0x0000000000800000 Authenticated Payload Timeout Event
@@ -309,6 +313,7 @@ ble_hs_startup_set_evmask_tx(void)
if (rc != 0) {
return rc;
}
+ }
return 0;
}
