Page 5 of 7

Re: [Video]: Bluetooth BLE and C++ classes

Posted: Fri Jul 14, 2017 2:06 pm
by frostyowned
How this process goes is the ESP32 turns on and I go to nRF Connect to see if I can get the services from it.

I press connect on the device, it takes me to the MYDEVICE tab, wait a few seconds, and it will automatically disconnect. Pressing connect then disconnects me almost instantly. After a lot of googling, people say the cause is that the service request is done too quickly and results in the android not getting any services

Re: [Video]: Bluetooth BLE and C++ classes

Posted: Mon Jul 17, 2017 2:52 pm
by frostyowned
-snip-

Re: [Video]: Bluetooth BLE and C++ classes

Posted: Sat Jul 29, 2017 7:25 pm
by kolban
Additional video is now available ... this one is on the subject if using C++ classes to build a BLE client.

https://www.youtube.com/watch?v=UgI7WRr5cgE

Re: [Video]: Bluetooth BLE and C++ classes

Posted: Fri Aug 18, 2017 8:11 pm
by enitalp
Nice work.

But question,

i saw in your sample that you include "ble.h"

and reference it with BLE::initServer("ImagineServer"); for example.

and i can't find either the include or any other place that could define the static BLE class.

Please Help !
thanks;p

Re: [Video]: Bluetooth BLE and C++ classes

Posted: Sat Aug 19, 2017 1:51 am
by kolban
Howdy,
Unfortunately the moment one makes a video, it immediately becomes out of date. The class called "BLE" was renamed "BLEDevice".

See:

https://github.com/nkolban/esp32-snippe ... ffaabedea0

The good news is that the samples found here:

https://github.com/nkolban/esp32-snippe ... s/BLETests

Should always (hopefully) be consistent with the library.

Re: [Video]: Bluetooth BLE and C++ classes

Posted: Mon Aug 21, 2017 1:25 pm
by enitalp
That's mostly the case for any documentation. Writing it is "easy" maintaining it is very hard.

Re: [Video]: Bluetooth BLE and C++ classes

Posted: Mon Aug 21, 2017 3:15 pm
by enitalp
BLEClientCallbacks miss an empty function for the interface onConnect, or should be pure virtual.

Re: [Video]: Bluetooth BLE and C++ classes

Posted: Mon Aug 21, 2017 6:17 pm
by kolban
Thank you sir. Excellent. We have made a change to the code base and committed based on your report. Thank you again.

https://github.com/nkolban/esp32-snippets/issues/40

Re: [Video]: Bluetooth BLE and C++ classes

Posted: Thu Aug 24, 2017 6:50 pm
by enitalp
BLEServerCallbacks,
BLECharacteristicCallbacks

Have the same Problem.
Don't know if BLECharacteristicCallbacks should be virtual pure, because you can have mostly only read or write on a characteristic. not all of them are both.

Re: [Video]: Bluetooth BLE and C++ classes

Posted: Thu Aug 24, 2017 6:55 pm
by enitalp
Ho, and i have a conceptual problem with the BLECharacteristic
getValue();

Because not all value you receive are string, the problem is when you receive binary, if there is a 0 you can't get the correct lenght of data you received. Or the callback could give the lenght. But it should be better peharps to get a char* or U8* than a string.