Getting Started with BLE on the ESP32
Posted: Fri Feb 17, 2017 12:29 am
Hello! I am a huge fan of the ESP8266 and I have done a ton of really neat projects using the ESP8266. Several of my projects support some really practical uses on my boat....remotely controlling a trolling motor and the trim and tilt of my outboard motor. I have even made a cosplay battle lance with IMU and 8266 that has flashing LEDS. I recently received my first ESP32 and I am very interested in learning how BLE comms works from a programing standpoint so that I can replace the ESP8266 wifi in my projects.
Based on my research and study so far I understand that the BLE communication architecture is broken up into two part - GAP and GATT. GAP being the initial comms step between two devices...... a peripheral BLE device is advertizing its self in a "Hello, Im a here" format and then GATT function calls kick in to exchange information assuming the peripheral device allows it through its "Hello..." advertisement. But thats about as far I as I can get with a basic understanding. The examples from the SDK are really helpful getting me this far but I need for things to sink in my head and stick! With this post I am asking for any information on the sequence that I should follow to creating a program to support a peripheral device advertising "Hello, I am here!"....My strategy here is to learn one part at a time writing my own peripheral program. I will be using an Android to connect to my ESP32 since they seem to work better with BLE.
There are several function calls and it appears that esp_ble_gap_register_callback is one of the main ones. Any one that can provide the other function calls that are needed and their sequence I would really appreciate it. Until then I will be poking at the sequence and compiling a bunch of errors!
Based on my research and study so far I understand that the BLE communication architecture is broken up into two part - GAP and GATT. GAP being the initial comms step between two devices...... a peripheral BLE device is advertizing its self in a "Hello, Im a here" format and then GATT function calls kick in to exchange information assuming the peripheral device allows it through its "Hello..." advertisement. But thats about as far I as I can get with a basic understanding. The examples from the SDK are really helpful getting me this far but I need for things to sink in my head and stick! With this post I am asking for any information on the sequence that I should follow to creating a program to support a peripheral device advertising "Hello, I am here!"....My strategy here is to learn one part at a time writing my own peripheral program. I will be using an Android to connect to my ESP32 since they seem to work better with BLE.
There are several function calls and it appears that esp_ble_gap_register_callback is one of the main ones. Any one that can provide the other function calls that are needed and their sequence I would really appreciate it. Until then I will be poking at the sequence and compiling a bunch of errors!