Bluetooth Low Energy for Smart Plug
Dependencies: BLE_API mbed nRF51822
main.cpp
- Committer:
- Slepnir
- Date:
- 2015-07-13
- Revision:
- 3:aaa92c61931a
- Parent:
- 2:6db5c9a2894c
File content as of revision 3:aaa92c61931a:
#include "mbed.h" #include "SmartPlugBLE.h" #include "BLECommunication.h" #include "BLE.h" BLE ble; void disconnectionCallback(Gap::Handle_t handle, Gap::DisconnectionReason_t reason) { printf("reason = x%08x\r\n",reason); ble.gap().startAdvertising(); } int main(void) { ble.gap().onDisconnection(disconnectionCallback); Ticker ticker; SmartPlugBLE smartPlugBLE; BLECommunication bleComm(smartPlugBLE,ble); }