Skip to content

Commit a1e4599

Browse files
committed
update advertising with USB PID as board ID
1 parent 74f58f5 commit a1e4599

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

libraries/Bluefruit52Lib/examples/Peripheral/cplay_ble/cplay_ble.ino

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,22 @@ void startAdv(void)
143143
{
144144
// Advertising packet
145145
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
146-
Bluefruit.Advertising.addTxPower();
147146

148-
// Include bleuart 128-bit uuid
149-
Bluefruit.Advertising.addService(bleuart);
147+
// Advertising with only board ID
148+
struct ATTR_PACKED {
149+
uint16_t mfr_id;
150+
151+
uint8_t field_len;
152+
uint16_t field_key;
153+
uint16_t field_value;
154+
} mfr_adv;
155+
156+
mfr_adv.mfr_id = UUID16_COMPANY_ID_ADAFRUIT;
157+
mfr_adv.field_len = 4;
158+
mfr_adv.field_key = 1; // board id
159+
mfr_adv.field_value = USB_PID;
160+
161+
Bluefruit.Advertising.addManufacturerData(&mfr_adv, sizeof(mfr_adv));
150162

151163
// Secondary Scan Response packet (optional)
152164
// Since there is no room for 'Name' in Advertising packet

libraries/Bluefruit52Lib/src/BLEUuid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ extern const uint8_t UUID128_CHR_ADAFRUIT_VERSION[16];
227227
* https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
228228
*------------------------------------------------------------------*/
229229
#define UUID16_COMPANY_ID_APPLE 0x004C
230-
230+
#define UUID16_COMPANY_ID_ADAFRUIT 0x0822
231231

232232
/*------------------------------------------------------------------*/
233233
/* Unit values ( used in Characteristic Presentation Format )

0 commit comments

Comments
 (0)