fix(nimble): Corrected link_estab event handling parameters

This commit is contained in:
Rahul Tank
2024-12-18 17:41:56 +05:30
parent 2c31596a3b
commit 30f7fa5e0e
28 changed files with 161 additions and 161 deletions
@@ -243,16 +243,16 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
case BLE_GAP_EVENT_LINK_ESTAB:
/* A new connection was established or a connection attempt failed. */
MODLOG_DFLT(INFO, "connection %s; status=%d ",
event->connect.status == 0 ? "established" : "failed",
event->connect.status);
if (event->connect.status == 0) {
rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
event->link_estab.status == 0 ? "established" : "failed",
event->link_estab.status);
if (event->link_estab.status == 0) {
rc = ble_gap_conn_find(event->link_estab.conn_handle, &desc);
assert(rc == 0);
bleprph_print_conn_desc(&desc);
}
MODLOG_DFLT(INFO, "\n");
if (event->connect.status != 0) {
if (event->link_estab.status != 0) {
/* Connection failed; resume advertising. */
#if CONFIG_EXAMPLE_EXTENDED_ADV
ext_bleprph_advertise();
@@ -262,7 +262,7 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
}
#if MYNEWT_VAL(BLE_POWER_CONTROL)
bleprph_power_control(event->connect.conn_handle);
bleprph_power_control(event->link_estab.conn_handle);
#endif
return 0;