Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Serial_Flush(SERIAL_0);
- Serial_SetChar(SERIAL_0,114); // 'r' reset
- Serial_Write(SERIAL_0,buf,strlen(buf) ,40);
- Serial_SetChar(SERIAL_0,13); // CR
- Sleep(800);
- int timeout = 10;
- while(!Serial_GetReadable(1) && timeout--)
- Sleep(100);
- int gotten = Serial_Read(SERIAL_0, readbuf, strlen(buf), 40);
- //snprintf(readbuf, BUF_SIZE,"\nReturn chars: %u \n", gotten); // <-- remmed out this
- //Serial_Write(SERIAL_1, readbuf, BUF_SIZE, 30); // <-- remmed out this
- Serial_Write(SERIAL_1, readbuf, strlen(buf), 30); // <--added this
- Serial_SetChar(SERIAL_1,13); // CR
- Serial_SetChar(SERIAL_1,10); // CR
- Serial_SetChar(SERIAL_0,114); // 'r' reset
- Sleep(5000);
- //return(gotten);
- }
Add Comment
Please, Sign In to add comment