Alexandre Lemay
/
APP3_Coordonator
first psuh
Revision 4:0b0dfd5ebf44, committed 2017-10-03
- Comitter:
- evrast
- Date:
- Tue Oct 03 10:04:15 2017 +0000
- Parent:
- 3:eda76f539da3
- Commit message:
- comments;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Oct 03 08:58:02 2017 +0000 +++ b/main.cpp Tue Oct 03 10:04:15 2017 +0000 @@ -27,7 +27,7 @@ uint8_t nd_Command[8] = { 0x7E, 0x00, 0x04, 0x08, 0x01, 0x4E, 0x44, 0x64 }; - +//send to the XBEE void sendNDCommand() { for ( int i = 0 ; i < 8; i++ ) @@ -35,11 +35,11 @@ xBee.putc(nd_Command[i]); } } - +//flag for the LED notification void sendRemoteAtCommand(){ atCommand = true; } - +//send LED pauqet to turn on of off void sendRemoteLedCommandPaquet(){ static bool nextState = true; @@ -91,15 +91,13 @@ paquet[length+3] = checkSum; - pc.printf("\n packet"); for(int i =0;i<length + 4;i++) { xBee.putc(paquet[i]); - pc.printf("%x ",paquet[i]); } } - +//receie the ND response void receiveAtCommandResponse(int length, uint8_t* data) { // 1 Command id @@ -143,12 +141,12 @@ } } - +//receive the data to print void receiveTransmitRequest(uint8_t* data,int length){ for(int i = TRANSMIT_REQUEST_DATA; i <length;i++) { - // pc.printf("%c", data[i]); + pc.printf("%c", data[i]); } } @@ -165,7 +163,7 @@ t.detach(); t.attach(stopLed,1.0); } - +//triage for new paquet void receiveNewPaquet() { int length; @@ -209,7 +207,7 @@ break; case 0x88: - pc.printf("\nat response : length %i, frame time %i\n",length,frame_type); + //pc.printf("\nat response : length %i, frame time %i\n",length,frame_type); receiveAtCommandResponse(length, data);