A nice BLE demo program which allows remote switch of an LED via GATT interface.
Dependencies: BLE_API mbed nRF51822
Fork of BLE_Button by
bricks/callback.h@13:0563f1aa6a75, 2017-10-21 (annotated)
- Committer:
- hux
- Date:
- Sat Oct 21 19:56:15 2017 +0000
- Revision:
- 13:0563f1aa6a75
- Parent:
- 12:0d0ca44397dd
Switch LED via BLE GATT
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hux | 12:0d0ca44397dd | 1 | // callback.h - deal with callbacks |
hux | 12:0d0ca44397dd | 2 | // |
hux | 12:0d0ca44397dd | 3 | // |
hux | 12:0d0ca44397dd | 4 | #ifndef _CALLBACK_H_ |
hux | 12:0d0ca44397dd | 5 | #define _CALLBACK_H_ |
hux | 12:0d0ca44397dd | 6 | |
hux | 12:0d0ca44397dd | 7 | #include "bricks/o.h" |
hux | 12:0d0ca44397dd | 8 | |
hux | 12:0d0ca44397dd | 9 | void onConnect (O&o, void(*fptr)(O&o)); // setup connection callback |
hux | 12:0d0ca44397dd | 10 | void onDisconnect(O&o, void(*fptr)(O&o)); // setup disconnect callback |
hux | 12:0d0ca44397dd | 11 | void onWritten (O&o, void (*fptr)(O&)); // setup data written callback |
hux | 12:0d0ca44397dd | 12 | |
hux | 12:0d0ca44397dd | 13 | #endif // _CALLBACK_H_ |