Initial source commit
This commit is contained in:
commit
f1384c11ee
335 changed files with 52715 additions and 0 deletions
27
minorGems/io/serialPort/testSerialPort.cpp
Normal file
27
minorGems/io/serialPort/testSerialPort.cpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
#include "SerialPort.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
|
||||
printf( "Constructing serial port.\n" );
|
||||
SerialPort *port = new SerialPort( 4800, SerialPort::PARITY_NONE, 8, 1 );
|
||||
|
||||
char *line = port->receiveLine();
|
||||
|
||||
// specific to GPS unit
|
||||
port->sendLine( "ASTRAL" );
|
||||
|
||||
while( line != NULL ) {
|
||||
printf( "received: %s\n", line );
|
||||
|
||||
delete [] line;
|
||||
line = port->receiveLine();
|
||||
}
|
||||
|
||||
printf( "Deleting serial port.\n" );
|
||||
delete port;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue