![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
A blue button is always a nice toy ...
Dependencies: BLE_API X_NUCLEO_IDB0XA1 mbed
Fork of BLE_HeartRate_IDB0XA1 by
main.cpp
- Committer:
- hux
- Date:
- 2017-01-14
- Revision:
- 27:32267cee7cb8
- Parent:
- 26:fd06c8b57d16
- Child:
- 28:307f58df778a
File content as of revision 27:32267cee7cb8:
// S07_Detection - Easy GATT setup using bricks for DETECTION services #include "bricks/bricks.h" #include "detection.h" //============================================================================== // Callbacks //============================================================================== void cbError(O&o) // Error Reporting Callback { blinkError(o); // 'error' blink sequence } void cbConnect(O&o) // Connection Callback { blinkConnected(o); // 'error' blink sequence } void cbDisconnect(O&o) // Disconnection Callback { advertise(o); // start advertising on client disconnect blinkAdvertise(o); // 'advertise' blink sequence } void cbSetup(O&o) // Immediately After Initializing BLE { services(o); // enroll all services & setup callbacks onConnect(o,cbConnect); // setup connection callback onDisconnect(o,cbDisconnect); // setup disconnection callback device(o,"S07 Detector #3.47"); // setup device name name(o,"Detector"); // setup advertising name data(o,"My Layout"); // setup advertising data advertise(o,"C:ng",100); // start advertising @ 100 msec interval blinkAdvertise(o); // 'advertise' blink sequence } //============================================================================== // Main Program //============================================================================== int main(void) { O o; // declare a blob (BLE OBject) verbose(o); // enable all trace messages blinkIdle(o); // idle blinking - just started! init(o,cbSetup,cbError); // init BLE base layer, always do first while (true) // Infinite loop waiting for BLE events sleep(o); // low power waiting for BLE events }