MCPcopy Create free account
hub / github.com/WiringPi/WiringPi / main

Function main

examples/serialRead.c:31–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29#include <wiringSerial.h>
30
31int 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}

Callers

nothing calls this directly

Calls 2

serialOpenFunction · 0.85
serialGetcharFunction · 0.85

Tested by

no test coverage detected