Bluefruit.setName() from example to use default board name from USB_PRODUCT
This commit is contained in:
parent
be4fb6cb35
commit
10f51fbc1b
29 changed files with 7 additions and 35 deletions
|
|
@ -42,7 +42,6 @@ void setup()
|
|||
// SRAM usage required by SoftDevice will increase with number of connections
|
||||
Bluefruit.begin(1, 1);
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52 duo");
|
||||
|
||||
// Callbacks for Peripheral
|
||||
Bluefruit.Periph.setConnectCallback(prph_connect_callback);
|
||||
|
|
|
|||
|
|
@ -790,7 +790,6 @@ void setup()
|
|||
Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);
|
||||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
|
||||
// try to go as fast as possible, could be rejected by some central, increase it if needed
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ char nibble_to_hex(uint8_t nibble) { // convert a 4-bit nibble to a hexadecimal
|
|||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while ( !Serial ) delay(10); // for nrf52840 with native usb
|
||||
// Serial.begin(115200);
|
||||
// while ( !Serial ) delay(10);
|
||||
|
||||
Serial.println("Bluefruit52 Color Advertising Example");
|
||||
Serial.println("----------------------------------------\n");
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// Set up and start advertising
|
||||
startAdv();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ void setup()
|
|||
// off Blue LED for lowest power consumption
|
||||
Bluefruit.autoConnLed(false);
|
||||
Bluefruit.setTxPower(0); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// Manufacturer ID is required for Manufacturer Specific Data
|
||||
beacon.setManufacturer(MANUFACTURER_ID);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ void setup()
|
|||
Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);
|
||||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setName("Bluefruit52 MIDI");
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
|
||||
// Setup the on board blue LED to be enabled on CONNECT
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
//Bluefruit.setName(getMcuUniqueID()); // useful testing with multiple central connections
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ void setup()
|
|||
// Initialize Bluefruit with max concurrent connections as Peripheral = 2, Central = 0
|
||||
Bluefruit.begin(MAX_PRPH_CONNECTION, 0);
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// To be consistent OTA DFU should be added first if it exists
|
||||
bledfu.begin();
|
||||
|
|
|
|||
|
|
@ -331,7 +331,6 @@ void setup()
|
|||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(8); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName(DEVICE_NAME);
|
||||
//Bluefruit.setName(getMcuUniqueID()); // useful testing with multiple central connections
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ void setup(void)
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// To be consistent OTA DFU should be added first if it exists
|
||||
bledfu.begin();
|
||||
|
|
|
|||
|
|
@ -39,10 +39,6 @@ void setup()
|
|||
Serial.println("Initialise the Bluefruit nRF52 module");
|
||||
Bluefruit.begin();
|
||||
|
||||
// Set the advertised device name (keep it short!)
|
||||
Serial.println("Setting Device Name to 'Feather52 HRM'");
|
||||
Bluefruit.setName("Bluefruit52 HRM");
|
||||
|
||||
// Set the connect/disconnect callback handlers
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ void setup()
|
|||
// Initialise the Bluefruit module
|
||||
Serial.println("Initialise the Bluefruit nRF52 module");
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// Set the connect/disconnect callback handlers
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// Setup the advertising packet
|
||||
startAdv();
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// Configure and start DIS (Device Information Service)
|
||||
bledis.setManufacturer("Adafruit Industries");
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// Configure and Start Device Information Service
|
||||
bledis.setManufacturer("Adafruit Industries");
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// Configure and Start Device Information Service
|
||||
bledis.setManufacturer("Adafruit Industries");
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ void setup()
|
|||
// HID Device can have a min connection interval of 9*1.25 = 11.25 ms
|
||||
Bluefruit.Periph.setConnInterval(9, 16); // min = 9*1.25=11.25 ms, max = 16*1.25=20ms
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// Configure and Start Device Information Service
|
||||
bledis.setManufacturer("Adafruit Industries");
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
|
||||
Bluefruit.Periph.setConnInterval(6, 12); // 7.5 - 15 ms
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
|
||||
Bluefruit.Periph.setConnInterval(6, 12); // 7.5 - 15 ms
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ void setup()
|
|||
// Init Bluefruit
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
|
||||
// Configure and Start Device Information Service
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ void setup()
|
|||
// Init Bluefruit
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
|
||||
// To be consistent OTA DFU should be added first if it exists
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
Serial.println("Setting pairing PIN to: " PAIRING_PIN);
|
||||
Bluefruit.Security.setPIN(PAIRING_PIN);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ void setup(void)
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
Bluefruit.Periph.setConnectCallback(connect_callback);
|
||||
Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
|
||||
Bluefruit.Periph.setConnInterval(6, 12); // 7.5 - 15 ms
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@ void setup()
|
|||
|
||||
Bluefruit.begin();
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
//InternalFS.remove(CRYPTO_KEYFILE);
|
||||
//File file(CRYPTO_KEYFILE, FILE_O_WRITE, InternalFS);
|
||||
|
|
|
|||
|
|
@ -186,9 +186,6 @@ void setup()
|
|||
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
|
||||
/* Set the device name */
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
/* Set the LED interval for blinky pattern on BLUE LED */
|
||||
Bluefruit.setConnLedInterval(250);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ void setup()
|
|||
}
|
||||
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setName("Bluefruit52");
|
||||
|
||||
// Set up and start advertising
|
||||
startAdv();
|
||||
|
|
|
|||
Loading…
Reference in a new issue