![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
demo versie 16/05
Dependencies: EthernetInterface mbed-rto mbed
Fork of ProjectVLC by
Diff: Receiver.cpp
- Revision:
- 4:0d013b7e4dea
- Child:
- 5:0413d42377d1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Receiver.cpp Wed Mar 28 12:25:14 2018 +0000 @@ -0,0 +1,57 @@ +#include "Receiver.h" + +Receiver::Receiver(int* LEDinput,Mutex* lockinput){ + LED=LEDinput; + lock=lockinput; + +} + +void Receiver::run(){ + //Recieve Packet. + char command[512]; + + bool inCommand=true; + + + char *ID=strtok(command,","); + char *direction=strtok(NULL," "); + while((ID!=NULL)&&(direction!=NULL)){ + + + if(){ + + } else { + + } + + + int IDNumber=atoi(ID); + int directionNumber=directionToNumber(direction); + if((IDNumber>=0)&&(IDNumber<=11)&&(directionNumber>=0)&&(directionNumber<=3)){ + LED[IDNumber]= + } + inCommand=false; + } + +} + +int Receiver::directionToNumber(char* direction){ + if(strcmp(direction,"links")==0) + return 0; + else if(strcmp(direction,"rechts")==0) + return 1; + else if(strcmp(direction,"boven")==0) + return 2; + else if(strcmp(direction,"onder")==0) + return 3; + else + return -1; +} + + +/* +in + +int Receiver::directionToNumber(char *direction){ + +}*/ \ No newline at end of file