C Language Development Kit/Functions/ResetReceive2
From OptiWiki
< C Language Development Kit | Functions(Redirected from C Language Development Kit/Functions/Resetrecieve2)
| Description | This function resets the serial receiver electronics and associated
software of the specified communications port. It also clears the receive buffers. | |||||||||
| Syntax | void resetreceive2(unsigned int port); | |||||||||
| Arguments | port specifies which serial communications port is to be reset. See the table below for details.
unsigned int port
| |||||||||
| Returns | None | |||||||||
| Remarks | Like resetkey(), this routine can be used to
delete old data. In this case data still placed in the receive buffer is cleared. | |||||||||
| Example | #include "lib.h" #include <stdio.h> #defineCOM COM2 void main( void ) { comopen( COM ); while( 1 ) { while( 1 ) { resetkey(); resetreceive2(COM); printf("\fReceiving..\n"); if( xmodemreceive("a:test.dat") != XMR_OK) { printf("\fERROR:\nfile not received\npress any key"); while( !kbhit()) idle(); continue; } printf("file Received OK\n\rPress key\n\r"); while( !kbhit()) idle(); break; } while( 1 ) { resetkey(); resetreceive2(COM); printf("\fSending..\n"); if( xmodemtransmit("a:test.dat") != XMT_OK) { printf("\fERROR:\nfile not send\npress any key"); while( !kbhit()) idle(); continue; } printf("file send OK\n\rPress key\n\r"); while( !kbhit()) idle(); break; } } } |
