fix(nimble): Address compilation issues in nimble examples

This commit is contained in:
Rahul Tank
2025-10-30 11:36:11 +05:30
parent 2919462028
commit 40a5e18e15
34 changed files with 173 additions and 32 deletions
@@ -44,6 +44,7 @@ void printtime(struct ble_svc_cts_curr_time ctime) {
ESP_LOGI(tag, "fractions : %d\n", ctime.et_256.fractions_256);
}
#if MYNEWT_VAL(BLE_GATTC)
/**
* Application callback. Called when the read of the cts current time
* characteristic has completed.
@@ -137,6 +138,7 @@ ble_cts_cent_on_disc_complete(const struct peer *peer, int status, void *arg)
*/
ble_cts_cent_read_time(peer);
}
#endif
/**
* Initiates the GAP general discovery procedure.
@@ -434,6 +436,7 @@ ble_cts_cent_gap_event(struct ble_gap_event *event, void *arg)
return 0;
}
#else
#if MYNEWT_VAL(BLE_GATTC)
/* Perform service discovery */
rc = peer_disc_all(event->connect.conn_handle,
ble_cts_cent_on_disc_complete, NULL);
@@ -441,6 +444,7 @@ ble_cts_cent_gap_event(struct ble_gap_event *event, void *arg)
MODLOG_DFLT(ERROR, "Failed to discover services; rc=%d\n", rc);
return 0;
}
#endif
#endif // BLE_GATT_CACHING_ASSOC_ENABLE
#endif
} else {
@@ -485,6 +489,7 @@ ble_cts_cent_gap_event(struct ble_gap_event *event, void *arg)
return 0;
}
#else
#if MYNEWT_VAL(BLE_GATTC)
/*** Go for service discovery after encryption has been successfully enabled ***/
rc = peer_disc_all(event->connect.conn_handle,
ble_cts_cent_on_disc_complete, NULL);
@@ -492,6 +497,7 @@ ble_cts_cent_gap_event(struct ble_gap_event *event, void *arg)
MODLOG_DFLT(ERROR, "Failed to discover services; rc=%d\n", rc);
return 0;
}
#endif
#endif // BLE_GATT_CACHING_ASSOC_ENABLE
#endif
return 0;