BLE Host - add reason for adv / disc complete.

X-Original-Commit: 437f8b0a7f030059c5522c79f4f2787ce02cab4a
This commit is contained in:
Christopher Collins
2017-10-17 13:03:28 -07:00
parent 952b682900
commit 787edbc6d7
2 changed files with 35 additions and 1 deletions
+33
View File
@@ -346,6 +346,39 @@ struct ble_gap_event {
*/
struct ble_gap_ext_disc_desc ext_disc;
#endif
/**
* Represents a completed discovery procedure. Valid for the following
* event types:
* o BLE_GAP_EVENT_DISC_COMPLETE
*/
struct {
/**
* The reason the discovery procedure stopped. Typical reason
* codes are:
* o 0: Duration expired.
* o BLE_HS_EPREEMPTED: Host aborted procedure to configure a
* peer's identity.
*/
int reason;
} disc_complete;
/**
* Represents a completed advertise procedure. Valid for the following
* event types:
* o BLE_GAP_EVENT_ADV_COMPLETE
*/
struct {
/**
* The reason the advertise procedure stopped. Typical reason
* codes are:
* o 0: Duration expired.
* o BLE_HS_EPREEMPTED: Host aborted procedure to configure a
* peer's identity.
*/
int reason;
} adv_complete;
/**
* Represents an attempt to update a connection's parameters. If the
* attempt was successful, the connection's descriptor reflects the
+2 -1
View File
@@ -666,7 +666,7 @@ ble_gap_adv_finished(void)
if (cb != NULL) {
memset(&event, 0, sizeof event);
event.type = BLE_GAP_EVENT_ADV_COMPLETE;
event.adv_complete.reason = 0;
cb(&event, cb_arg);
}
}
@@ -764,6 +764,7 @@ ble_gap_disc_complete(void)
memset(&event, 0, sizeof event);
event.type = BLE_GAP_EVENT_DISC_COMPLETE;
event.disc_complete.reason = 0;
ble_gap_master_extract_state(&state, 1);
if (ble_gap_has_client(&state)) {