Librairie xbee.
Dependents: NerfUS-Coord NerfUSTarget
Fork of APP3_xbee by
Revision 33:da71d952fcd6, committed 2017-04-10
- Comitter:
- GaiSensei
- Date:
- Mon Apr 10 17:33:13 2017 +0000
- Parent:
- 32:e4809bc86901
- Commit message:
- Only handle nerfus transmit requests
Changed in this revision
mbed_source/xbee.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r e4809bc86901 -r da71d952fcd6 mbed_source/xbee.cpp --- a/mbed_source/xbee.cpp Mon Apr 10 16:49:36 2017 +0000 +++ b/mbed_source/xbee.cpp Mon Apr 10 17:33:13 2017 +0000 @@ -309,17 +309,20 @@ void parse_nerfus_message(const vector<char>& parsed_frame, void (*callback)(vector<uint8_t>, int*)) { - int address[8]; - for(int i=1; i<9; i++) + if(parsed_frame[0] == FRAME_TYPE_RECEIVE_PACKET) { - address[i-1] = parsed_frame[i]; + int address[8]; + for(int i=1; i<9; i++) + { + address[i-1] = parsed_frame[i]; + } + vector<uint8_t> message; + for(int i=9; i<13; i++) + { + message.push_back(parsed_frame[i]); + } + callback(message, address); } - vector<uint8_t> message; - for(int i=9; i<13; i++) - { - message.push_back(parsed_frame[i]); - } - callback(message, address); } void parsed_button_event_frame_to_string(const vector<char>& parsed_frame, char* readable_string_output)