Clear the existing data before we start advertising

This commit is contained in:
Holden Karau 2022-04-30 18:20:41 -07:00
parent e1f28982cf
commit ca3192b3dc

View File

@ -225,6 +225,11 @@ void NRF52Bluetooth::setup()
Bluefruit.autoConnLed(false); Bluefruit.autoConnLed(false);
Bluefruit.begin(); Bluefruit.begin();
// Clear existing data.
Bluefruit.Advertising.stop();
Bluefruit.Advertising.clearData();
Bluefruit.ScanResponse.clearData();
// Set the advertised device name (keep it short!) // Set the advertised device name (keep it short!)
Bluefruit.setName(getDeviceName()); Bluefruit.setName(getDeviceName());