Bluetooth Low Energy for Smart Plug

Dependencies:   BLE_API mbed nRF51822

Fork of SmartPlugBLE by Pavit Noinongyao

main.cpp

Committer:
Slepnir
Date:
2015-07-14
Revision:
4:721ae30c92f8
Parent:
2:6db5c9a2894c

File content as of revision 4:721ae30c92f8:

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