Bluetooth Low Energy for Smart Plug

Dependencies:   BLE_API mbed nRF51822

Fork of SmartPlugBLE by Pavit Noinongyao

main.cpp

Committer:
Slepnir
Date:
2015-07-08
Revision:
2:6db5c9a2894c
Parent:
0:25ad6eba7916

File content as of revision 2:6db5c9a2894c:

#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);
}