fix(nimble): Fix various documentation/ assignment / fixes

This commit is contained in:
Rahul Tank
2026-01-14 13:30:36 +05:30
parent 420a6e672e
commit 0fb1f1ef11
10 changed files with 29 additions and 20 deletions
+1 -1
View File
@@ -360,7 +360,7 @@ void ble_gap_end_test_evt(const void *buf, uint8_t len);
* * If resolved with local IRK -> set to all zeros
* * If not resolved -> unchanged
*
* Returns: ESP_OK if resolve, ESP_FAIL otherwise.
* Returns: true if resolve, false otherwise.
*/
bool ble_gap_rpa_resolve(uint8_t *rpa, uint8_t *ida, uint8_t *addr_type);
+5 -5
View File
@@ -1993,7 +1993,7 @@ struct ble_gap_event {
#endif /* MYNEWT_VAL(BLE_ISO) */
/**
* Represents a read all remote features complet event
* Represents a read all remote features complete event
* Valid for the following event types:
* o BLE_GAP_EVENT_RD_ALL_REM_FEAT
*/
@@ -2022,7 +2022,7 @@ struct ble_gap_event {
#if MYNEWT_VAL(BLE_MONITOR_ADV)
/**
* Represents a read all remote features complet event
* Represents a monitor advertising report event
* Valid for the following event types:
* o BLE_GAP_EVENT_MONITOR_ADV_REPORT
*/
@@ -2031,9 +2031,9 @@ struct ble_gap_event {
uint8_t addr_type;
/** Device Address */
uint16_t address[6];
uint8_t address[6];
/** Represents weather RSSI threshold condition is met */
/** Represents whether RSSI threshold condition is met */
uint8_t condition;
} monitor_adv_report;
@@ -4168,7 +4168,7 @@ int ble_gap_read_local_irk(uint8_t * out_irk);
*
* @param bit_num Bit position in the FeatureSet
*
* @param The Host feature is disabled or enabled (0 & 1)
* @param bit_val The Host feature is disabled or enabled (0 & 1)
*
* return 0 on success; nonzero on failure
*/
+1 -1
View File
@@ -148,7 +148,7 @@ int ble_sm_get_static_passkey_config(uint32_t *passkey, bool *enabled);
#else
#define ble_sm_inject_io(conn_handle, pkey) \
((void)(conn_handle), BLE_HS_ENOTSUP)
#if !MYNEWT_VAL(STATIC_PASSKEY)
#if MYNEWT_VAL(STATIC_PASSKEY)
#define ble_sm_configure_static_passkey(passkey, enable) \
((void)(passkey), (void)(enable), BLE_HS_ENOTSUP)
#define ble_sm_get_static_passkey_config(passkey, enabled) \
+1 -1
View File
@@ -427,7 +427,7 @@ ble_svc_dis_included_init(void)
int
ble_svc_dis_init_dynamic(void)
{
ble_svc_dis_data_ptr = nimble_platform_mem_calloc(1, sizeof(ble_svc_dis_data));
ble_svc_dis_data_ptr = nimble_platform_mem_calloc(1, sizeof(*ble_svc_dis_data_ptr));
if (!ble_svc_dis_data_ptr) {
return BLE_HS_ENOMEM;
}
@@ -24,6 +24,7 @@
#include "host/ble_hs.h"
#include "services/gap/ble_svc_gap.h"
#include "os/endian.h"
#include "esp_nimble_cfg.h"
#if MYNEWT_VAL(BLE_GATTS) && CONFIG_BT_NIMBLE_GAP_SERVICE
+14 -5
View File
@@ -2379,6 +2379,7 @@ ble_gap_rx_rd_all_remote_feat(const struct ble_hci_ev_le_subev_rd_all_rem_feat *
event.type = BLE_GAP_EVENT_RD_ALL_REM_FEAT;
event.rd_all_rem_feat.status = ev->status;
event.rd_all_rem_feat.conn_handle = le16toh(ev->conn_handle);
event.rd_all_rem_feat.max_remote_page = ev->max_remote_page;
event.rd_all_rem_feat.max_valid_page = ev->max_valid_page;
memcpy(event.rd_all_rem_feat.le_features, ev->le_features, 248);
@@ -10362,6 +10363,10 @@ int ble_gap_set_scan_chan(uint8_t state, uint8_t *bitmap)
memset(vs_cmd, 0x0, sizeof(vs_cmd));
vs_cmd[0] = state;
if (bitmap == NULL) {
return BLE_HS_EINVAL;
}
memcpy(&vs_cmd[1], bitmap, 5);
return ble_hs_hci_send_vs_cmd(BLE_HCI_OCF_VS_SET_SCAN_CHAN,
@@ -10605,8 +10610,12 @@ static inline bool is_rpa(const uint8_t *addr)
bool ble_gap_rpa_resolve(uint8_t *rpa, uint8_t *ida, uint8_t *addr_type)
{
if (!rpa || !ida || !addr_type) {
return false;
}
if (!is_rpa(rpa)) {
return ESP_FAIL; /* reject public / static random / non-RPA */
return false; /* reject public / static random / non-RPA */
}
/* ---- Step 1: Try peer IRKs ---- */
@@ -10629,7 +10638,7 @@ bool ble_gap_rpa_resolve(uint8_t *rpa, uint8_t *ida, uint8_t *addr_type)
/* Found a match -> copy peer identity address */
memcpy(ida, sec.peer_addr.val, 6);
*addr_type = sec.peer_addr.type; /* set type */
return ESP_OK;
return true;
}
}
}
@@ -10644,9 +10653,9 @@ bool ble_gap_rpa_resolve(uint8_t *rpa, uint8_t *ida, uint8_t *addr_type)
if (ble_hs_pvcy_resolve_with_irk(rpa, value.irk)) {
/* Match with local IRK -> return ida = 00:00:00:00:00:00 */
memset(ida, 0, 6);
*addr_type = BLE_ADDR_PUBLIC; /* default type */
return ESP_OK;
*addr_type = BLE_ADDR_PUBLIC; /* default type */
return true;
}
return ESP_FAIL; /* No match */
return false; /* No match */
}
+4 -3
View File
@@ -1574,7 +1574,8 @@ ble_gattc_recover_gatt_proc(uint16_t conn_handle, int enc_status)
ble_gattc_write_long(conn_handle, proc->write_long.attr.handle,
proc->write_long.attr.offset, om,
proc->write_long.cb, proc->write_long.cb_arg);
case BLE_GATT_OP_WRITE_RELIABLE:
break;
case BLE_GATT_OP_WRITE_RELIABLE:
for (int i = 0; i < proc->write_reliable.num_attrs; i++) {
attrs[i].handle = proc->write_reliable.attrs[i].handle;
attrs[i].offset = 0;
@@ -1583,7 +1584,8 @@ ble_gattc_recover_gatt_proc(uint16_t conn_handle, int enc_status)
ble_gattc_write_reliable(conn_handle, attrs,
proc->write_reliable.num_attrs,
proc->write_reliable.cb, proc->write_reliable.cb_arg);
}
break;
}
} else {
err_cb = ble_gattc_err_dispatch_get(proc->op);
if (err_cb != NULL) {
@@ -5838,7 +5840,6 @@ ble_gattc_indicate_custom(uint16_t conn_handle, uint16_t chr_val_handle,
{
return ble_gatts_indicate_custom(conn_handle, chr_val_handle, txom);
}
//#endif
int
ble_gatts_indicate(uint16_t conn_handle, uint16_t chr_val_handle)
+1 -1
View File
@@ -2015,7 +2015,7 @@ ble_gattc_cache_conn_disc_incs(struct ble_gattc_cache_conn *peer)
ble_gattc_cache_conn_disc_chrs(peer);
}
} else {
ble_gattc_cache_conn_disc_chrs(peer);
ble_gattc_cache_conn_disc_chrs(peer);
}
return;
}
-3
View File
@@ -495,11 +495,8 @@ ble_store_key_from_value_ead(struct ble_store_key_ead *out_key,
const struct ble_store_value_ead *value)
{
#if NIMBLE_BLE_CONNECT
out_key->peer_addr = value->peer_addr;
out_key->idx = 0;
#else
return BLE_HS_ENOTSUP;
#endif
}
#endif
@@ -87,6 +87,7 @@ struct sockaddr_hci {
#include "nimble/nimble_npl.h"
#include "nimble/transport.h"
#include "socket/ble_hci_socket.h"
#include "esp_nimble_mem.h"
/***
* NOTES: