... | ... | @@ -24,12 +24,12 @@ Other serial ports can be used as follows, but they have to be configured first. |
|
|
```cpp
|
|
|
#include <fcntl.h>
|
|
|
//...
|
|
|
fd=open("/dev/auxtty",O_RDWR); //open serial port named auxtty
|
|
|
int fd=open("/dev/auxtty",O_RDWR); //open serial port named auxtty
|
|
|
if(fd<0) printf("Cannot open /dev/auxtty");
|
|
|
|
|
|
char buffer[11]; //Buffer is 10 chars + '\0'
|
|
|
read(fd, 10, buffer); //Read 10 chars
|
|
|
write(fd, 10, buffer); //Write 10 chars
|
|
|
read(fd, buffer, 10); //Read 10 chars
|
|
|
write(fd, buffer, 10); //Write 10 chars
|
|
|
```
|
|
|
Pay attention to the baudrate at which the used port is set!
|
|
|
|
... | ... | |