![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
BLE fota Robot Demo
Dependencies: mbed-rtos mbed mbed_fota_fan_control
Fork of mbed_fota_lamp_control by
main.cpp@5:e11b23f9aacc, 2015-07-13 (annotated)
- Committer:
- dudnwjs
- Date:
- Mon Jul 13 06:32:05 2015 +0000
- Revision:
- 5:e11b23f9aacc
- Parent:
- 4:60be78a172c2
- Child:
- 6:8dd20294b2aa
Fota Service Add complete
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dudnwjs | 0:a1f6b1ba8a1e | 1 | #include "mbed.h" |
dudnwjs | 1:5cf3a6c969be | 2 | #include "BleMsgHandler.h" |
dudnwjs | 3:1e70387e1337 | 3 | #include "app.h" |
dudnwjs | 0:a1f6b1ba8a1e | 4 | |
dudnwjs | 0:a1f6b1ba8a1e | 5 | Serial hostpc(USBTX,USBRX); |
dudnwjs | 0:a1f6b1ba8a1e | 6 | Serial device(p13,p14); |
dudnwjs | 0:a1f6b1ba8a1e | 7 | |
dudnwjs | 0:a1f6b1ba8a1e | 8 | DigitalOut myled(LED1); |
dudnwjs | 0:a1f6b1ba8a1e | 9 | |
dudnwjs | 1:5cf3a6c969be | 10 | using namespace sevencore_fota; |
dudnwjs | 1:5cf3a6c969be | 11 | |
dudnwjs | 5:e11b23f9aacc | 12 | int main() { |
dudnwjs | 5:e11b23f9aacc | 13 | |
dudnwjs | 5:e11b23f9aacc | 14 | hostpc.baud(9600); |
dudnwjs | 3:1e70387e1337 | 15 | device.baud(115200); |
dudnwjs | 5:e11b23f9aacc | 16 | device.set_flow_control(device.RTS,p12,p12); |
dudnwjs | 3:1e70387e1337 | 17 | |
dudnwjs | 5:e11b23f9aacc | 18 | BleMsgHandler myfota(&device,&hostpc); |
dudnwjs | 1:5cf3a6c969be | 19 | myfota.PrintTitle(); |
dudnwjs | 3:1e70387e1337 | 20 | app_rst_gap(&myfota); |
dudnwjs | 3:1e70387e1337 | 21 | |
dudnwjs | 5:e11b23f9aacc | 22 | for(int i = 0; i < 20; i++) { |
dudnwjs | 4:60be78a172c2 | 23 | myfota.BleReceiveMsg(); |
dudnwjs | 4:60be78a172c2 | 24 | myfota.BleMsgHandle(); |
dudnwjs | 4:60be78a172c2 | 25 | } |
dudnwjs | 3:1e70387e1337 | 26 | |
dudnwjs | 0:a1f6b1ba8a1e | 27 | while(1) { |
dudnwjs | 0:a1f6b1ba8a1e | 28 | myled = 1; |
dudnwjs | 0:a1f6b1ba8a1e | 29 | wait(0.5); |
dudnwjs | 0:a1f6b1ba8a1e | 30 | myled = 0; |
dudnwjs | 0:a1f6b1ba8a1e | 31 | wait(0.5); |
dudnwjs | 0:a1f6b1ba8a1e | 32 | } |
dudnwjs | 5:e11b23f9aacc | 33 | |
dudnwjs | 0:a1f6b1ba8a1e | 34 | } |