File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
libraries/n-able/examples Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ void setup() {
3030void loop () {
3131 if (!pAdvertising->isAdvertising ()) {
3232 // Update the advertised data
33- pAdvertising->setServiceData (dataUuid, std::string (( char *) &count, sizeof (count) ));
33+ pAdvertising->setServiceData (dataUuid, static_cast < uint8_t *>( &count) , sizeof (count));
3434
3535 // Start advertising the data
3636 pAdvertising->start (5 );
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ NimBLEScan* pBLEScan;
1515uint32_t scanTime = 30 ; // Scan duration in seconds (0 = forever)
1616
1717// Callback class for received advertisements
18- class MyAdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks {
19- void onResult (NimBLEAdvertisedDevice* advertisedDevice) {
18+ class ScanCallbacks : public NimBLEScanCallbacks {
19+ void onResult (const NimBLEAdvertisedDevice* advertisedDevice) {
2020 Serial.printf (" Advertised Device: %s \n " , advertisedDevice->toString ().c_str ());
2121 }
22- };
22+ } scanCallbacks ;
2323
2424void setup () {
2525 Serial.begin (115200 );
@@ -32,7 +32,7 @@ void setup() {
3232 pBLEScan = NimBLEDevice::getScan ();
3333
3434 // Set the callback for when devices are discovered, no duplicates.
35- pBLEScan->setAdvertisedDeviceCallbacks ( new MyAdvertisedDeviceCallbacks () , false );
35+ pBLEScan->setScanCallbacks (&scanCallbacks , false );
3636
3737 // Set active scanning, this will get scan response data from the advertiser.
3838 pBLEScan->setActiveScan (true );
You can’t perform that action at this time.
0 commit comments