X-Git-Url: https://git.realraum.at/?p=svn42.git;a=blobdiff_plain;f=rf433rcv%2Fpc%2Frawhid_test.c;h=38f34015ccbe11323f5b4597f2e7d9f8ffb86170;hp=eaef389ff30aa771ea785395b334aa13431739c2;hb=ac71234587241032871cfb0745471f011fcbb943;hpb=f505a1c37ea1c76897991f9882de765e34f0cc98 diff --git a/rf433rcv/pc/rawhid_test.c b/rf433rcv/pc/rawhid_test.c index eaef389..38f3401 100644 --- a/rf433rcv/pc/rawhid_test.c +++ b/rf433rcv/pc/rawhid_test.c @@ -17,7 +17,7 @@ static char get_keystroke(void); void sendstr(char * tosend) { - rawhid_send(0, tosend, strlen(tosend),100); + rawhid_send(0, tosend, strlen(tosend),1000); } int main (int argc, char *argv[]) @@ -40,14 +40,18 @@ int main (int argc, char *argv[]) FILE * f = fopen (argv[1], "r"); if (!f) return -3; + printf("Clearing Buffer\n"); sendstr("c"); // clear the buffer buf[0]='f'; - size_t len= fread(buf+1, 1, 63, f); - for(i=len+1;i<64;i++) - buf[i]=0xff; - rawhid_send(0, buf, 64, 100); //fill the buffer + while ( fread(buf+1, 1, 63, f) ) + { + + rawhid_send(0, buf, 64, 1000); //fill the buffer + printf("Sending Buffer\n"); + } + printf("Executing Send command\n"); sendstr("s\x10"); // send 4 times - len = rawhid_recv(0, buf, 64, 255); + size_t len = rawhid_recv(0, buf, 64, 255); for(i=0;i