Skip to content

Commit 64150ac

Browse files
committed
Merge branch 'bugfix/ad_type_example_v5.5' into 'release/v5.5'
fix(nimble): Add AD type macros in example (v5.5) See merge request espressif/esp-idf!44981
2 parents 8c7d825 + 54f5822 commit 64150ac

17 files changed

Lines changed: 81 additions & 81 deletions

File tree

  • examples/bluetooth

examples/bluetooth/bluedroid/ble/ble_ibeacon/main/esp_ibeacon_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const uint8_t uuid_zeros[ESP_UUID_LEN_128] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00
2929
/* For iBeacon packet format, please refer to Apple "Proximity Beacon Specification" doc */
3030
/* Constant part of iBeacon data */
3131
esp_ble_ibeacon_head_t ibeacon_common_head = {
32-
.flags = {0x02, 0x01, 0x06},
32+
.flags = {0x02, ESP_BLE_AD_TYPE_FLAG, ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT},
3333
.length = 0x1A,
34-
.type = 0xFF,
34+
.type = ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE,
3535
.company_id = 0x004C,
3636
.beacon_type = 0x1502
3737
};

examples/bluetooth/nimble/ble_ancs/main/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ static ble_uuid128_t data_source = BLE_UUID128_INIT(
6969

7070
#if CONFIG_EXAMPLE_EXTENDED_ADV
7171
static uint8_t ext_adv_pattern_1[] = {
72-
0x02, 0x01, 0x06,
73-
0x03, 0x03, 0xab, 0xcd,
74-
0x03, 0x03, 0x18, 0x11,
75-
0x0e, 0X09, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'a', 'n', 'c', 's', '-', 'e',
72+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
73+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0xab, 0xcd,
74+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0x18, 0x11,
75+
0x0e, BLE_HS_ADV_TYPE_COMP_NAME, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'a', 'n', 'c', 's', '-', 'e',
7676
};
7777
#endif
7878

examples/bluetooth/nimble/ble_chan_sound_reflector/main/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232

3333
#if CONFIG_EXAMPLE_EXTENDED_ADV
3434
static uint8_t ext_adv_pattern_1[] = {
35-
0x02, 0x01, 0x06,
36-
0x03, 0x03, 0xab, 0xcd,
37-
0x03, 0x03, 0x5B, 0x18,
38-
0x11, 0X09, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'b', 'l', 'e', 'p', 'r', 'p', 'h', '-', 'e',
35+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
36+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0xab, 0xcd,
37+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0x5B, 0x18,
38+
0x11, BLE_HS_ADV_TYPE_COMP_NAME, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'b', 'l', 'e', 'p', 'r', 'p', 'h', '-', 'e',
3939
};
4040
#endif
4141
static const char *tag = "NimBLE_BLE_CHAN_REFLECTOR";

examples/bluetooth/nimble/ble_cte/ble_periodic_adv_with_cte/main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/* Global constants */
2121
static const char *TAG = "CTE_ADV_EXAMPLE";
22-
static uint8_t s_periodic_adv_raw_data[] = {0x0D, 0x09, 'C','T','E',' ','P','e','r','i','o','d','i','c'};
22+
static uint8_t s_periodic_adv_raw_data[] = {0x0D, BLE_HS_ADV_TYPE_COMP_NAME, 'C','T','E',' ','P','e','r','i','o','d','i','c'};
2323

2424
/* Configuration based on Kconfig settings */
2525
#if CONFIG_EXAMPLE_RANDOM_ADDR

examples/bluetooth/nimble/ble_cts/cts_prph/main/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919

2020
#if CONFIG_EXAMPLE_EXTENDED_ADV
2121
static uint8_t ext_adv_pattern_1[] = {
22-
0x02, 0x01, 0x06,
23-
0x03, 0x03, 0xab, 0xcd,
24-
0x03, 0x03, 0x05, 0x18,
25-
0x12, 0X09, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'c', 't', 's', '-', 'p', 'r', 'p', 'h', '-', 'e',
22+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
23+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0xab, 0xcd,
24+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0x05, 0x18,
25+
0x12, BLE_HS_ADV_TYPE_COMP_NAME, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'c', 't', 's', '-', 'p', 'r', 'p', 'h', '-', 'e',
2626
};
2727
#endif
2828

examples/bluetooth/nimble/ble_htp/htp_prph/main/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
#if CONFIG_EXAMPLE_EXTENDED_ADV
2020
static uint8_t ext_adv_pattern_1[] = {
21-
0x02, 0x01, 0x06,
22-
0x03, 0x03, 0xab, 0xcd,
23-
0x03, 0x03, 0x18, 0x09,
24-
0x12, 0X09, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'h', 't', 'p', '-', 'p', 'r', 'p', 'h', '-', 'e',
21+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
22+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0xab, 0xcd,
23+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0x18, 0x09,
24+
0x12, BLE_HS_ADV_TYPE_COMP_NAME, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'h', 't', 'p', '-', 'p', 'r', 'p', 'h', '-', 'e',
2525
};
2626
#endif
2727

examples/bluetooth/nimble/ble_l2cap_coc/coc_bleprph/main/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
#if CONFIG_EXAMPLE_EXTENDED_ADV
1919
static uint8_t ext_adv_pattern_1[] = {
20-
0x02, 0x01, 0x06,
21-
0x03, 0x03, 0xab, 0xcd,
22-
0x03, 0x03, 0x18, 0x12,
23-
0x12, 0X09, 'e', 'x', 't', '-', 'b', 'l', 'e', 'p', 'r', 'p', 'h', '-', 'l', '2', 'c', 'o', 'c',
20+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
21+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0xab, 0xcd,
22+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0x18, 0x12,
23+
0x12, BLE_HS_ADV_TYPE_COMP_NAME, 'e', 'x', 't', '-', 'b', 'l', 'e', 'p', 'r', 'p', 'h', '-', 'l', '2', 'c', 'o', 'c',
2424
};
2525
#endif
2626

examples/bluetooth/nimble/ble_multi_adv/main/main.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,33 @@ static void ble_multi_advertise(ble_addr_t addr);
3030

3131
/* Advertising patterns */
3232
static uint8_t legacy_dur_adv_pattern[] = {
33-
0x02, 0x01, 0x06,
34-
0x03, 0x03, 0xab, 0xcd,
35-
0x03, 0x03, 0x18, 0x11,
36-
0x12, 0X09, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'l', 'e', 'g', 'a', 'c', 'y', '-', 'd', 'u',
33+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
34+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0xab, 0xcd,
35+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0x18, 0x11,
36+
0x12, BLE_HS_ADV_TYPE_COMP_NAME, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'l', 'e', 'g', 'a', 'c', 'y', '-', 'd', 'u',
3737
'r'
3838
};
3939

4040
static uint8_t scannable_legacy_adv_pattern[] = {
41-
0x02, 0x01, 0x06,
42-
0x03, 0x03, 0xab, 0xcd,
43-
0x03, 0x03, 0x18, 0x11,
44-
0x13, 0X09, 'n', 'i', 'm', 'b', 'l', 'e', '-', 's', 'c', 'a', 'n', '-', 'l', 'e', 'g', 'a',
41+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
42+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0xab, 0xcd,
43+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0x18, 0x11,
44+
0x13, BLE_HS_ADV_TYPE_COMP_NAME, 'n', 'i', 'm', 'b', 'l', 'e', '-', 's', 'c', 'a', 'n', '-', 'l', 'e', 'g', 'a',
4545
'c', 'y'
4646
};
4747

4848
static uint8_t connectable_adv_pattern[] = {
49-
0x02, 0x01, 0x06,
50-
0x03, 0x03, 0xab, 0xcd,
51-
0x03, 0x03, 0x18, 0x11,
52-
0x12, 0X09, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'c', 'o', 'n', 'n', 'e', 't', 'a', 'b', 'l', 'e'
49+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
50+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0xab, 0xcd,
51+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0x18, 0x11,
52+
0x12, BLE_HS_ADV_TYPE_COMP_NAME, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'c', 'o', 'n', 'n', 'e', 't', 'a', 'b', 'l', 'e'
5353
};
5454

5555
static uint8_t non_conn_adv_pattern[] = {
56-
0x02, 0x01, 0x06,
57-
0x03, 0x03, 0xab, 0xcd,
58-
0x03, 0x03, 0x18, 0x11,
59-
0x10, 0X09, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'n', 'o', 'n', '-', 'c', 'o', 'n', 'n'
56+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
57+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0xab, 0xcd,
58+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0x18, 0x11,
59+
0x10, BLE_HS_ADV_TYPE_COMP_NAME, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'n', 'o', 'n', '-', 'c', 'o', 'n', 'n'
6060
};
6161

6262
/**

examples/bluetooth/nimble/ble_multi_conn/ble_multi_conn_cent/main/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ static const ble_uuid_t *remote_svc_uuid =
2626
0x99, 0x99, 0x43, 0x95, 0x12, 0x2f, 0x46, 0x59);
2727

2828
static uint8_t ext_adv_pattern_1[] = {
29-
0x02, 0x01, 0x06,
30-
0x14, 0X09, 'e', 's', 'p', '-', 'b', 'l', 'e', '-', 'r', 'o', 'l', 'e', '-', 'c', 'o', 'e', 'x', '-', 'e',
29+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
30+
0x14, BLE_HS_ADV_TYPE_COMP_NAME, 'e', 's', 'p', '-', 'b', 'l', 'e', '-', 'r', 'o', 'l', 'e', '-', 'c', 'o', 'e', 'x', '-', 'e',
3131
};
3232

3333
void ble_store_config_init(void);

examples/bluetooth/nimble/ble_multi_conn/ble_multi_conn_prph/main/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
#if CONFIG_EXAMPLE_EXTENDED_ADV
1717
static uint8_t ext_adv_pattern_1[] = {
18-
0x02, 0x01, 0x06,
19-
0x03, 0x03, 0xab, 0xcd,
20-
0x03, 0x03, 0x18, 0x11,
21-
0x11, 0X09, 'e', 's', 'p', '-', 'm', 'u', 'l', 't', 'i', '-', 'c', 'o', 'n', 'n', '-', 'e',
18+
0x02, BLE_HS_ADV_TYPE_FLAGS, 0x06,
19+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0xab, 0xcd,
20+
0x03, BLE_HS_ADV_TYPE_COMP_UUIDS16, 0x18, 0x11,
21+
0x11, BLE_HS_ADV_TYPE_COMP_NAME, 'e', 's', 'p', '-', 'm', 'u', 'l', 't', 'i', '-', 'c', 'o', 'n', 'n', '-', 'e',
2222
};
2323
#endif
2424

0 commit comments

Comments
 (0)