Open Murtaza7745 opened 3 years ago
Thanks so much for replying so fast @chegewara. Let me explain you in a different way, I have a esp32 BLE acting as a client, i have a smart ble watch which is acting as a server. I want the client to connect to that server only, without scanning or anything, just use "static BLEClient*pClient->connect("60:35:0d:6c:79:21");"
PLEASE HELP
In post i linked you can read its not possible. You have to scan.
so how do I increase the memory size? if there are so many ble scan results, esp32 reboots.
I have attached my code.
static BLEAddress Address (addr); static BLEClient* pClient; static boolean connected = false;
class MyClientCallback : public BLEClientCallbacks { void onConnect(BLEClient* pclient) { connected = true; Serial.println("Connected"); }
void onDisconnect(BLEClient* pclient) {
connected = false;
Serial.println("Disconnected");
}
}; void connectToServer(BLEAddress pAddress) { Serial.print("Forming a connection to "); pClient = BLEDevice::createClient(); Serial.println(" - Created client");
pClient->setClientCallbacks(new MyClientCallback());
// Connect to the remove BLE Server. pClient->connect(pAddress); // if you pass BLEAdvertisedDevice instead of address, it will be recognized type of peer device address (public or private) Serial.println(" - Connected to server"); } void setup() { // put your setup code here, to run once: Serial.begin(115200); BLEDevice::init(""); connectToServer(Address); }
void loop() { // put your main code here, to run repeatedly: Serial.println("."); delay(2000); }
PLEASE HELP
There is few options.
Thanks @chegewara :)
I am new to ESP32 BLE programming, I want to connect ESP32 BLE client to only one particular server, I have the server ble address and its charac UUID and service UUID.
PLEASE HELP