update advertising with USB PID as board ID

This commit is contained in:
hathach committed 2019-11-26 11:33:16 +07:00
1 parent 74f58f5e2c
commit a1e45995cf
2 files changed
+16 -4

No files matched your search

@@ -143,10 +143,22 @@ void startAdv(void)
{
// Advertising packet
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
Bluefruit.Advertising.addTxPower();
// Include bleuart 128-bit uuid
Bluefruit.Advertising.addService(bleuart);
// Advertising with only board ID
struct ATTR_PACKED {
uint16_t mfr_id;
uint8_t field_len;
uint16_t field_key;
uint16_t field_value;
} mfr_adv;
mfr_adv.mfr_id = UUID16_COMPANY_ID_ADAFRUIT;
mfr_adv.field_len = 4;
mfr_adv.field_key = 1; // board id
mfr_adv.field_value = USB_PID;
Bluefruit.Advertising.addManufacturerData(&mfr_adv, sizeof(mfr_adv));
// Secondary Scan Response packet (optional)
// Since there is no room for 'Name' in Advertising packet
+1 -1
View File
@@ -227,7 +227,7 @@ extern const uint8_t UUID128_CHR_ADAFRUIT_VERSION[16];
* https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
*------------------------------------------------------------------*/
#define UUID16_COMPANY_ID_APPLE 0x004C
#define UUID16_COMPANY_ID_ADAFRUIT 0x0822
/*------------------------------------------------------------------*/
/* Unit values ( used in Characteristic Presentation Format )