mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-19 03:27:56 +00:00
BLE Host - add reason for adv / disc complete.
X-Original-Commit: 437f8b0a7f030059c5522c79f4f2787ce02cab4a
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user