Merge branch 'bugfix/gap_name_appearance_clobber_v5.2' into 'release/v5.2'

fix(nimble): Fix few nimble issues 21042026 (v5.2)

See merge request espressif/esp-idf!47943
This commit is contained in:
Rahul Tank
2026-05-20 11:58:59 +05:30
3 changed files with 8 additions and 17 deletions

View File

@@ -15,8 +15,12 @@
* attempt to use these macros without including this header will result in a
* compiler error.
*/
#ifndef MYNEWT_VAL
#define MYNEWT_VAL(_name) MYNEWT_VAL_ ## _name
#endif
#ifndef MYNEWT_VAL_CHOICE
#define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val
#endif
#ifndef IRAM_ATTR_64MCPU
#define IRAM_ATTR_64MCPU IRAM_ATTR

View File

@@ -24,14 +24,6 @@ static int8_t tx_pwr_lvl;
static struct ble_prox_cent_conn_peer conn_peer[MYNEWT_VAL(BLE_MAX_CONNECTIONS) + 1];
static struct ble_prox_cent_link_lost_peer disconn_peer[MYNEWT_VAL(BLE_MAX_CONNECTIONS) + 1];
/* Note: Path loss is calculated using formula : threshold - RSSI value
* by default threshold is kept -128 as per the spec
* high_threshold and low_threshold are hardcoded after testing and noting
* RSSI values when distance between devices are less and more.
*/
static int8_t high_threshold = -70;
static int8_t low_threshold = -100;
void ble_store_config_init(void);
static void ble_prox_cent_scan(void);
static int ble_prox_cent_gap_event(struct ble_gap_event *event, void *arg);
@@ -661,16 +653,11 @@ ble_prox_cent_path_loss_task(void *pvParameters)
MODLOG_DFLT(INFO, "path loss = %d pwr lvl = %d rssi = %d",
path_loss, tx_pwr_lvl, rssi);
if ((conn_peer[i].val_handle != 0) &&
(path_loss > high_threshold || path_loss < low_threshold)) {
if (path_loss < low_threshold) {
path_loss = 0;
}
if (conn_peer[i].val_handle != 0) {
int8_t path_loss_val = (int8_t)path_loss;
#if MYNEWT_VAL(BLE_GATTC)
rc = ble_gattc_write_no_rsp_flat(i, conn_peer[i].val_handle,
&path_loss, sizeof(path_loss));
&path_loss_val, sizeof(path_loss_val));
if (rc != 0) {
MODLOG_DFLT(ERROR, "Error: Failed to write characteristic; rc=%d\n",
rc);