Hello again.
I am trying to make a continuous connection with a BT device and perform continuous scanning of becons in @beegee’s post on the page ESP32 Bluetooth Serial and BLE server running together – Bernd's development stuff
it mentions that something similar only that I initialize first BLE and then BT however this is applied to server mode. and in my case I can’t get both to work together. am I getting something wrong?
the code of my setup is the following.
void setup() {
Serial.begin(115200);
Serial.setTimeout(100);
Serial1.begin(115200);
Serial1.setTimeout(100);
Serial.println("\n\n SYSTEM STARTED\n ------------------------------------\n");
SerialBT.begin(“ESP32test”, true);/////////////////
BLEDevice::init("");
if (!SerialBT.connect(“TEST”))
{
Serial.println(“Couldn’t connect to TEST scanner”);
}
Serial.println(“Connected to TEST”);
SerialBT.print(“AT@1\r”);
while(SerialBT.available())//read response
{
char c = SerialBT.read();
Serial.write(c);//print response
}
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 valu
Serial.println(“Init scanning adv…”);
}