update code
This commit is contained in:
1 parent
1beef88ada
commit
eef021aec6
9 files changed
+42
-38
No files matched your search
@@ -13,6 +13,10 @@
|
||||
*********************************************************************/
|
||||
#include <bluefruit.h>
|
||||
|
||||
// https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
|
||||
// 0x004C is Apple
|
||||
#define MANUFACTURER_ID 0x004C
|
||||
|
||||
uint8_t beaconUuid[16] =
|
||||
{
|
||||
0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
|
||||
@@ -31,7 +35,7 @@ void setup()
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
beacon.setManufacturer(0x004C); // 0x004C is Apple
|
||||
beacon.setManufacturer(MANUFACTURER_ID);
|
||||
|
||||
// Set up Advertising Packet
|
||||
setupAdv();
|
||||
|
||||
@@ -70,16 +70,16 @@ void setup()
|
||||
|
||||
void setupAdv(void)
|
||||
{
|
||||
//Bluefruit.addAdvTxPower();
|
||||
Bluefruit.addAdvFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.addAdvTxPower();
|
||||
//Bluefruit.Advertising.addTxPower();
|
||||
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.Advertising.addTxPower();
|
||||
|
||||
// Include bleuart 128-bit uuid
|
||||
Bluefruit.addAdvService(blemidi);
|
||||
Bluefruit.Advertising.addService(blemidi);
|
||||
|
||||
// There is no room for Name in Advertising packet
|
||||
// Use Scan response for Name
|
||||
Bluefruit.addScanRespName();
|
||||
Bluefruit.ScanResponse.addName();
|
||||
}
|
||||
|
||||
void midi_write_callback(uint32_t tstamp, uint8_t data[])
|
||||
|
||||
@@ -65,15 +65,15 @@ void setup()
|
||||
|
||||
void setupAdv(void)
|
||||
{
|
||||
Bluefruit.addAdvFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.addAdvTxPower();
|
||||
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.Advertising.addTxPower();
|
||||
|
||||
// Include bleuart 128-bit uuid
|
||||
Bluefruit.addAdvService(bleuart);
|
||||
Bluefruit.Advertising.addService(bleuart);
|
||||
|
||||
// There is no room for Name in Advertising packet
|
||||
// Use Scan response for Name
|
||||
Bluefruit.addScanRespName();
|
||||
Bluefruit.ScanResponse.addName();
|
||||
}
|
||||
|
||||
void loop()
|
||||
|
||||
@@ -32,13 +32,13 @@ void setup()
|
||||
|
||||
void setupAdv(void)
|
||||
{
|
||||
//Bluefruit.addAdvTxPower();
|
||||
Bluefruit.addAdvFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.addAdvTxPower();
|
||||
//Bluefruit.Advertising.addTxPower();
|
||||
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.Advertising.addTxPower();
|
||||
|
||||
// There is no room for Name in Advertising packet
|
||||
// Use Scan response for Name
|
||||
Bluefruit.addScanRespName();
|
||||
Bluefruit.ScanResponse.addName();
|
||||
}
|
||||
|
||||
void loop()
|
||||
|
||||
@@ -52,16 +52,16 @@ void setup(void)
|
||||
|
||||
void setupAdv(void)
|
||||
{
|
||||
//Bluefruit.addAdvTxPower();
|
||||
Bluefruit.addAdvFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.addAdvTxPower();
|
||||
//Bluefruit.Advertising.addTxPower();
|
||||
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.Advertising.addTxPower();
|
||||
|
||||
// Include bleuart 128-bit uuid
|
||||
Bluefruit.addAdvService(bleuart);
|
||||
Bluefruit.Advertising.addService(bleuart);
|
||||
|
||||
// There is no room for Name in Advertising packet
|
||||
// Use Scan response for Name
|
||||
Bluefruit.addScanRespName();
|
||||
Bluefruit.ScanResponse.addName();
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
@@ -62,16 +62,16 @@ void setup()
|
||||
|
||||
void setupAdv(void)
|
||||
{
|
||||
Bluefruit.addAdvFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.addAdvTxPower();
|
||||
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.Advertising.addTxPower();
|
||||
|
||||
Bluefruit.addAdvApperance(BLE_APPEARANCE_HID_KEYBOARD);
|
||||
Bluefruit.Advertising.addApperance(BLE_APPEARANCE_HID_KEYBOARD);
|
||||
|
||||
// Include BLE HID service
|
||||
Bluefruit.addAdvService(blehid);
|
||||
Bluefruit.Advertising.addService(blehid);
|
||||
|
||||
// There is enough room for the dev name in the advertising packet
|
||||
Bluefruit.addAdvName();
|
||||
Bluefruit.Advertising.addName();
|
||||
}
|
||||
|
||||
void loop()
|
||||
|
||||
@@ -55,16 +55,16 @@ void setup()
|
||||
|
||||
void setupAdv(void)
|
||||
{
|
||||
Bluefruit.addAdvFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.addAdvTxPower();
|
||||
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.Advertising.addTxPower();
|
||||
|
||||
Bluefruit.addAdvApperance(BLE_APPEARANCE_HID_MOUSE);
|
||||
Bluefruit.Advertising.addApperance(BLE_APPEARANCE_HID_MOUSE);
|
||||
|
||||
// Include BLE HID service
|
||||
Bluefruit.addAdvService(blehid);
|
||||
Bluefruit.Advertising.addService(blehid);
|
||||
|
||||
// There is enough room for the name in the advertising packet
|
||||
Bluefruit.addAdvName();
|
||||
Bluefruit.Advertising.addName();
|
||||
}
|
||||
|
||||
void loop()
|
||||
|
||||
@@ -67,16 +67,16 @@ void setup(void)
|
||||
|
||||
void setupAdv(void)
|
||||
{
|
||||
//Bluefruit.addAdvTxPower();
|
||||
Bluefruit.addAdvFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.addAdvTxPower();
|
||||
//Bluefruit.Advertising.addTxPower();
|
||||
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.Advertising.addTxPower();
|
||||
|
||||
// Include bleuart 128-bit uuid
|
||||
Bluefruit.addAdvService(bleuart);
|
||||
Bluefruit.Advertising.addService(bleuart);
|
||||
|
||||
// There is no room for Name in Advertising packet
|
||||
// Use Scan response for Name
|
||||
Bluefruit.addScanRespName();
|
||||
Bluefruit.ScanResponse.addName();
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
@@ -64,15 +64,15 @@ void setup(void)
|
||||
|
||||
void setupAdv(void)
|
||||
{
|
||||
Bluefruit.addAdvFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.addAdvTxPower();
|
||||
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.Advertising.addTxPower();
|
||||
|
||||
// Include bleuart 128-bit uuid
|
||||
Bluefruit.addAdvService(bleuart);
|
||||
Bluefruit.Advertising.addService(bleuart);
|
||||
|
||||
// There is no room for Name in Advertising packet
|
||||
// Use Scan response for Name
|
||||
Bluefruit.addScanRespName();
|
||||
Bluefruit.ScanResponse.addName();
|
||||
}
|
||||
|
||||
void connect_callback(void)
|
||||
|
||||
Reference in new issue
Block a user