| 29 | #include <wiringSerial.h> |
| 30 | |
| 31 | int main () |
| 32 | { |
| 33 | int fd ; |
| 34 | |
| 35 | if ((fd = serialOpen ("/dev/ttyAMA0", 115200)) < 0) |
| 36 | { |
| 37 | fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ; |
| 38 | return 1 ; |
| 39 | } |
| 40 | |
| 41 | // Loop, getting and printing characters |
| 42 | |
| 43 | for (;;) |
| 44 | { |
| 45 | putchar (serialGetchar (fd)) ; |
| 46 | fflush (stdout) ; |
| 47 | } |
| 48 | } |
nothing calls this directly
no test coverage detected