feat(nimble): Added changes in examples to have code under flags

This commit is contained in:
Rahul Tank
2026-03-11 19:12:26 +05:30
parent 506dbc2985
commit 9036880677
20 changed files with 97 additions and 9 deletions
@@ -221,9 +221,15 @@ gatt_svr_init(void)
{
int rc;
#if CONFIG_BT_NIMBLE_GAP_SERVICE
ble_svc_gap_init();
#endif /* CONFIG_BT_NIMBLE_GAP_SERVICE */
#if MYNEWT_VAL(BLE_GATTS)
ble_svc_gatt_init();
#endif
#if CONFIG_BT_NIMBLE_ANS_SERVICE
ble_svc_ans_init();
#endif
rc = ble_gatts_count_cfg(gatt_svr_svcs);
if (rc != 0) {
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@@ -220,7 +220,12 @@ ble_transport_to_ll_cmd_impl(void *buf)
data[0] = HCI_H4_CMD;
memcpy(data + 1, buf, len - 1);
hci_uart_send(data, len);
#if MYNEWT_VAL(MP_RUNTIME_ALLOC)
ble_transport_free(BLE_HCI_CMD, buf);
#else
ble_transport_free(buf);
#endif
return 0;
}