Added method to enable/disable privacy in GAP Pal with Cordio impl

pull/6932/head
Donatien Garnier 2018-05-13 19:15:20 +01:00
parent 4c5e2a8094
commit 1a623e6670
2 changed files with 23 additions and 0 deletions

View File

@ -649,6 +649,18 @@ struct Gap {
disconnection_reason_t disconnection_reason disconnection_reason_t disconnection_reason
) = 0; ) = 0;
/** Enable or disable privacy feature
* @param enable whether to enable privacy feature
*
* @return BLE_ERROR_NONE if the request has been successfully sent or the
* appropriate error otherwise.
*
* @note: See Bluetooth 5 Vol 3 Part C: 10.7 Privacy feature.
*/
virtual ble_error_t set_privacy(
bool enable
) = 0;
/** Enable or disable private addresses resolution /** Enable or disable private addresses resolution
* *
* @param enable whether to enable private addresses resolution * @param enable whether to enable private addresses resolution

View File

@ -308,6 +308,17 @@ public:
return BLE_ERROR_NONE; return BLE_ERROR_NONE;
} }
virtual ble_error_t set_privacy(
bool enable
) {
if(enable) {
DmDevPrivStart(15 * 60); // Use 15 minutes renewal timer as mandated by the BLE Spec
} else {
DmDevPrivStop();
}
return BLE_ERROR_NONE;
}
virtual ble_error_t set_address_resolution( virtual ble_error_t set_address_resolution(
bool enable bool enable
) { ) {