![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
BLE fota Lamp Demo
Dependencies: mbed-rtos mbed mbed_fota_fan_control
Fork of mbed_fota_fan_control by
main.cpp@3:1e70387e1337, 2015-06-23 (annotated)
- Committer:
- dudnwjs
- Date:
- Tue Jun 23 06:32:40 2015 +0000
- Revision:
- 3:1e70387e1337
- Parent:
- 1:5cf3a6c969be
- Child:
- 4:60be78a172c2
Add feature : Msg Sender, Msg Receiver (using Serial);
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 | 0:a1f6b1ba8a1e | 12 | int main() { |
dudnwjs | 3:1e70387e1337 | 13 | device.baud(115200); |
dudnwjs | 3:1e70387e1337 | 14 | |
dudnwjs | 1:5cf3a6c969be | 15 | BleMsgHandler myfota(&device,&hostpc); |
dudnwjs | 0:a1f6b1ba8a1e | 16 | |
dudnwjs | 1:5cf3a6c969be | 17 | myfota.PrintTitle(); |
dudnwjs | 0:a1f6b1ba8a1e | 18 | |
dudnwjs | 3:1e70387e1337 | 19 | app_rst_gap(&myfota); |
dudnwjs | 3:1e70387e1337 | 20 | |
dudnwjs | 3:1e70387e1337 | 21 | myfota.BleReceiveMsg(); |
dudnwjs | 3:1e70387e1337 | 22 | myfota.BleMsgHandle(); |
dudnwjs | 3:1e70387e1337 | 23 | |
dudnwjs | 0:a1f6b1ba8a1e | 24 | |
dudnwjs | 0:a1f6b1ba8a1e | 25 | while(1) { |
dudnwjs | 0:a1f6b1ba8a1e | 26 | myled = 1; |
dudnwjs | 0:a1f6b1ba8a1e | 27 | wait(0.5); |
dudnwjs | 0:a1f6b1ba8a1e | 28 | myled = 0; |
dudnwjs | 0:a1f6b1ba8a1e | 29 | wait(0.5); |
dudnwjs | 0:a1f6b1ba8a1e | 30 | } |
dudnwjs | 0:a1f6b1ba8a1e | 31 | } |