BLE fota Lamp Demo

Dependencies:   mbed-rtos mbed mbed_fota_fan_control

Fork of mbed_fota_fan_control by KIM HyoengJun

main.cpp

Committer:
dudnwjs
Date:
2015-07-13
Revision:
5:e11b23f9aacc
Parent:
4:60be78a172c2
Child:
6:8dd20294b2aa

File content as of revision 5:e11b23f9aacc:

#include "mbed.h"
#include "BleMsgHandler.h"
#include "app.h"

Serial hostpc(USBTX,USBRX);
Serial device(p13,p14);

DigitalOut myled(LED1);

using namespace sevencore_fota;

int main() {  
  
    hostpc.baud(9600);
    device.baud(115200);
    device.set_flow_control(device.RTS,p12,p12);
    
    BleMsgHandler myfota(&device,&hostpc);   
    myfota.PrintTitle();
    app_rst_gap(&myfota);
    
    for(int i = 0; i < 20; i++) {
        myfota.BleReceiveMsg();
        myfota.BleMsgHandle();
    }
    
    while(1) {
        myled = 1;
        wait(0.5);
        myled = 0;
        wait(0.5);
    }
    
}