BLE fota Lamp Demo
Dependencies: mbed-rtos mbed mbed_fota_fan_control
Fork of mbed_fota_fan_control by
dialog_fota/app.cpp@3:1e70387e1337, 2015-06-23 (annotated)
- Committer:
- dudnwjs
- Date:
- Tue Jun 23 06:32:40 2015 +0000
- Revision:
- 3:1e70387e1337
- 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 | 3:1e70387e1337 | 1 | #include "app.h" |
dudnwjs | 3:1e70387e1337 | 2 | #include "gapm_task.h" |
dudnwjs | 3:1e70387e1337 | 3 | #include "dialog_fota_config.h" |
dudnwjs | 3:1e70387e1337 | 4 | |
dudnwjs | 3:1e70387e1337 | 5 | |
dudnwjs | 3:1e70387e1337 | 6 | namespace sevencore_fota{ |
dudnwjs | 3:1e70387e1337 | 7 | |
dudnwjs | 3:1e70387e1337 | 8 | void app_rst_gap(BleMsgHandler *BMH) |
dudnwjs | 3:1e70387e1337 | 9 | { |
dudnwjs | 3:1e70387e1337 | 10 | struct gapm_reset_cmd gm_cmd; |
dudnwjs | 3:1e70387e1337 | 11 | gm_cmd.operation = GAPM_RESET; |
dudnwjs | 3:1e70387e1337 | 12 | uint8_t *msg; |
dudnwjs | 3:1e70387e1337 | 13 | unsigned short msg_size = 1+sizeof(ble_hdr) + sizeof(gapm_reset_cmd); |
dudnwjs | 3:1e70387e1337 | 14 | msg = new uint8_t[msg_size]; |
dudnwjs | 3:1e70387e1337 | 15 | BMH->BleMsgAlloc(GAPM_RESET_CMD, TASK_GAPM, TASK_GTL, |
dudnwjs | 3:1e70387e1337 | 16 | sizeof(struct gapm_reset_cmd),&gm_cmd,msg); |
dudnwjs | 3:1e70387e1337 | 17 | |
dudnwjs | 3:1e70387e1337 | 18 | BMH->BleSendMsg(msg,msg_size); |
dudnwjs | 3:1e70387e1337 | 19 | |
dudnwjs | 3:1e70387e1337 | 20 | return; |
dudnwjs | 3:1e70387e1337 | 21 | } |
dudnwjs | 3:1e70387e1337 | 22 | |
dudnwjs | 3:1e70387e1337 | 23 | }//namespace |