You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey :) great library! It works beautifully on an Arduino ESP32 for me and I am trying to port the code to the Adafruit Feather ESP32-S3 Reverse TFT now so I can have a display. While doing so I am getting panik resets. I have narrowed this down to the following line in the Scan Continuous example:
#include <NimBLEDevice.h>
int scanTime = 5; //In seconds
BLEScan* pBLEScan;
class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
/*** Only a reference to the advertised device is passed now
void onResult(BLEAdvertisedDevice advertisedDevice) { **/
void onResult(BLEAdvertisedDevice* advertisedDevice) {
/** Serial.printf("Advertised Device: %s \n", advertisedDevice.toString().c_str()); **/
Serial.printf("Advertised Device: %s \n", advertisedDevice->toString().c_str());
}
};
void setup() {
Serial.begin(115200);
Serial.println("Scanning...");
BLEDevice::init("");
pBLEScan = BLEDevice::getScan(); //create new scan
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
pBLEScan->setActiveScan(true); //active scan uses more power, but get results faster
pBLEScan->setInterval(100);
pBLEScan->setWindow(99); // less or equal setInterval value
}
void loop() {
// put your main code here, to run repeatedly:
BLEScanResults foundDevices = pBLEScan->start(scanTime, false);
Serial.print("Devices found: ");
Serial.println(foundDevices.getCount());
Serial.println("Scan done!");
pBLEScan->clearResults(); // delete results fromBLEScan buffer to release memory
delay(2000);
}
I checked that the pBLEScan pointer is not a nullptr. If I comment out the offending line the code runs fine (but doesnt do any scanning of course). The code works fine on my other ESP32 from Arduino.
Any idea what might be going wrong or how to debug it?
The text was updated successfully, but these errors were encountered:
Hey :) great library! It works beautifully on an Arduino ESP32 for me and I am trying to port the code to the Adafruit Feather ESP32-S3 Reverse TFT now so I can have a display. While doing so I am getting panik resets. I have narrowed this down to the following line in the Scan Continuous example:
The example code I am using:
I checked that the pBLEScan pointer is not a nullptr. If I comment out the offending line the code runs fine (but doesnt do any scanning of course). The code works fine on my other ESP32 from Arduino.
Any idea what might be going wrong or how to debug it?
The text was updated successfully, but these errors were encountered: