/* Preempts the GAP if it is not already preempted. 
On preemption, all aborted GAP procedures are reported with a status or reason code of BLE_HS_EPREEMPTED. An attempt to initiate a new GAP procedure during preemption fails with a return code of BLE_HS_EPREEMPTED.  */
void ble_gap_preempt(void)
/* Preempts the GAP if it is not already preempted. 
On preemption, all aborted GAP procedures are reported with a status or reason code of BLE_HS_EPREEMPTED. An attempt to initiate a new GAP procedure during preemption fails with a return code of BLE_HS_EPREEMPTED.  */
void ble_gap_preempt(void)
{
    ble_hs_lock();
    if (!ble_gap_is_preempted()) {
        ble_gap_preempt_no_lock();
    }
    ble_hs_unlock();
}