@@ -475,18 +475,13 @@ void setup()
475
475
metaRxChar.setWriteCallback (handleMetaWritten);
476
476
disableMagnetometerRx.setWriteCallback (handleDisableMagnetometerRxWritten);
477
477
478
- #if 0
479
- // Start the core BLE engine.
480
- if (!BLE.begin())
481
- {
482
- Serial.println("Failed to initialized BLE!");
483
- setState(ERROR_STATE);
484
- while (1) showErrorLed();
485
- }
486
- #endif
487
478
488
- #if 0
489
- String address = BLE.address();
479
+ uint8_t mac[6 ];
480
+ char mac_str[20 ];
481
+ Bluefruit.getAddr (mac);
482
+ sprintf (mac_str, " %02X:%02X:%02X:%02X:%02X:%02X" , mac[5 ], mac[4 ], mac[3 ], mac[2 ], mac[1 ], mac[0 ]);
483
+
484
+ String address (mac_str);
490
485
491
486
// Output BLE settings over Serial.
492
487
Serial.print (" address = " );
@@ -506,17 +501,13 @@ void setup()
506
501
507
502
Serial.print (" localName = " );
508
503
Serial.println (deviceName);
504
+
509
505
// Set up properties for the whole service.
510
- BLE.setLocalName(deviceName.c_str());
511
- BLE.setDeviceName(deviceName.c_str());
512
- BLE.setAdvertisedService(service);
513
- #endif
506
+ Bluefruit.setName (deviceName.c_str ());
514
507
515
508
// Advertising packet
516
509
Bluefruit.Advertising .addFlags (BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
517
510
Bluefruit.Advertising .addTxPower ();
518
-
519
- // Include bleuart 128-bit uuid
520
511
Bluefruit.Advertising .addService (service);
521
512
522
513
// Secondary Scan Response packet (optional)
0 commit comments