mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fix_ble_power_save_ci_v5.0' into 'release/v5.0'
fix(ble): fix conn error of ble power save ci test(v5.0) See merge request espressif/esp-idf!29824
This commit is contained in:
commit
a463942e14
@ -28,6 +28,26 @@
|
|||||||
#include "services/gap/ble_svc_gap.h"
|
#include "services/gap/ble_svc_gap.h"
|
||||||
#include "blecent.h"
|
#include "blecent.h"
|
||||||
|
|
||||||
|
#if CONFIG_EXAMPLE_USE_CI_ADDRESS
|
||||||
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (0)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32C2
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (1)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (2)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32C6
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (3)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32C5
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (4)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (5)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (6)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (7)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*** The UUID of the service containing the subscribable characterstic ***/
|
/*** The UUID of the service containing the subscribable characterstic ***/
|
||||||
static const ble_uuid_t * remote_svc_uuid =
|
static const ble_uuid_t * remote_svc_uuid =
|
||||||
BLE_UUID128_DECLARE(0x2d, 0x71, 0xa2, 0x59, 0xb4, 0x58, 0xc8, 0x12,
|
BLE_UUID128_DECLARE(0x2d, 0x71, 0xa2, 0x59, 0xb4, 0x58, 0xc8, 0x12,
|
||||||
@ -474,6 +494,7 @@ ext_blecent_should_connect(const struct ble_gap_ext_disc_desc *disc)
|
|||||||
addr_offset = (uint32_t *)&peer_addr[1];
|
addr_offset = (uint32_t *)&peer_addr[1];
|
||||||
*addr_offset = atoi(CONFIG_EXAMPLE_PEER_ADDR);
|
*addr_offset = atoi(CONFIG_EXAMPLE_PEER_ADDR);
|
||||||
peer_addr[5] = 0xC3;
|
peer_addr[5] = 0xC3;
|
||||||
|
peer_addr[0] = TEST_CI_ADDRESS_CHIP_OFFSET;
|
||||||
#endif // !CONFIG_EXAMPLE_USE_CI_ADDRESS
|
#endif // !CONFIG_EXAMPLE_USE_CI_ADDRESS
|
||||||
if (memcmp(peer_addr, disc->addr.val, sizeof(disc->addr.val)) != 0) {
|
if (memcmp(peer_addr, disc->addr.val, sizeof(disc->addr.val)) != 0) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -537,6 +558,7 @@ blecent_should_connect(const struct ble_gap_disc_desc *disc)
|
|||||||
addr_offset = (uint32_t *)&peer_addr[1];
|
addr_offset = (uint32_t *)&peer_addr[1];
|
||||||
*addr_offset = atoi(CONFIG_EXAMPLE_PEER_ADDR);
|
*addr_offset = atoi(CONFIG_EXAMPLE_PEER_ADDR);
|
||||||
peer_addr[5] = 0xC3;
|
peer_addr[5] = 0xC3;
|
||||||
|
peer_addr[0] = TEST_CI_ADDRESS_CHIP_OFFSET;
|
||||||
#endif // !CONFIG_EXAMPLE_USE_CI_ADDRESS
|
#endif // !CONFIG_EXAMPLE_USE_CI_ADDRESS
|
||||||
if (memcmp(peer_addr, disc->addr.val, sizeof(disc->addr.val)) != 0) {
|
if (memcmp(peer_addr, disc->addr.val, sizeof(disc->addr.val)) != 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
CONFIG_EXAMPLE_USE_CI_ADDRESS=y
|
CONFIG_EXAMPLE_USE_CI_ADDRESS=y
|
||||||
CONFIG_EXAMPLE_PEER_ADDR="${CI_JOB_ID}"
|
CONFIG_EXAMPLE_PEER_ADDR="${CI_PIPELINE_ID}"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
CONFIG_IDF_TARGET="esp32c2"
|
CONFIG_IDF_TARGET="esp32c2"
|
||||||
CONFIG_XTAL_FREQ_26=y
|
CONFIG_XTAL_FREQ_26=y
|
||||||
CONFIG_EXAMPLE_USE_CI_ADDRESS=y
|
CONFIG_EXAMPLE_USE_CI_ADDRESS=y
|
||||||
CONFIG_EXAMPLE_PEER_ADDR="${CI_JOB_ID}"
|
CONFIG_EXAMPLE_PEER_ADDR="${CI_PIPELINE_ID}"
|
||||||
|
@ -17,6 +17,26 @@
|
|||||||
#include "services/gap/ble_svc_gap.h"
|
#include "services/gap/ble_svc_gap.h"
|
||||||
#include "bleprph.h"
|
#include "bleprph.h"
|
||||||
|
|
||||||
|
#if CONFIG_EXAMPLE_USE_CI_ADDRESS
|
||||||
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (0)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32C2
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (1)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (2)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32C6
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (3)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32C5
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (4)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (5)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (6)
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||||
|
#define TEST_CI_ADDRESS_CHIP_OFFSET (7)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if CONFIG_EXAMPLE_EXTENDED_ADV
|
#if CONFIG_EXAMPLE_EXTENDED_ADV
|
||||||
static uint8_t ext_adv_pattern_1[] = {
|
static uint8_t ext_adv_pattern_1[] = {
|
||||||
0x02, 0x01, 0x06,
|
0x02, 0x01, 0x06,
|
||||||
@ -468,6 +488,7 @@ bleprph_on_sync(void)
|
|||||||
uint32_t *offset = (uint32_t *)&addr[1];
|
uint32_t *offset = (uint32_t *)&addr[1];
|
||||||
*offset = atoi(CONFIG_EXAMPLE_CI_ADDRESS_OFFSET);
|
*offset = atoi(CONFIG_EXAMPLE_CI_ADDRESS_OFFSET);
|
||||||
addr[5] = 0xC3;
|
addr[5] = 0xC3;
|
||||||
|
addr[0] = TEST_CI_ADDRESS_CHIP_OFFSET;
|
||||||
rc = ble_hs_id_set_rnd(addr);
|
rc = ble_hs_id_set_rnd(addr);
|
||||||
assert(rc == 0);
|
assert(rc == 0);
|
||||||
}
|
}
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
# Test Config
|
# Test Config
|
||||||
#
|
#
|
||||||
CONFIG_EXAMPLE_USE_CI_ADDRESS=y
|
CONFIG_EXAMPLE_USE_CI_ADDRESS=y
|
||||||
CONFIG_EXAMPLE_CI_ADDRESS_OFFSET="${CI_JOB_ID}"
|
CONFIG_EXAMPLE_CI_ADDRESS_OFFSET="${CI_PIPELINE_ID}"
|
||||||
|
@ -4,4 +4,4 @@ CONFIG_XTAL_FREQ_26=y
|
|||||||
# Test Config
|
# Test Config
|
||||||
#
|
#
|
||||||
CONFIG_EXAMPLE_USE_CI_ADDRESS=y
|
CONFIG_EXAMPLE_USE_CI_ADDRESS=y
|
||||||
CONFIG_EXAMPLE_CI_ADDRESS_OFFSET="${CI_JOB_ID}"
|
CONFIG_EXAMPLE_CI_ADDRESS_OFFSET="${CI_PIPELINE_ID}"
|
||||||
|
Loading…
Reference in New Issue
Block a user