Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 871 Bytes

0009-2019-12-19.md

File metadata and controls

20 lines (13 loc) · 871 Bytes

19 Dec 2019

I need to finish 02-control from yesterday.

I also need to write a Linux program for communicating with it. A simple version would do the following:

  1. Take a directive via command-line, e.g. to get pin status, or change it.
  2. Open a connection to the device (i.e. open("/dev/ttyACM0", ...)).
  3. Write a check byte (e.g. A).
  4. Read a byte back to make sure it's working (which will be the status of pins).
  5. Write the actual requested command-line command.
  6. Read back the status, and output it to STDOUT in a meaningful format.

Note that steps 4 and 6 will need a timeout.

More info: https://stackoverflow.com/questions/6947413/how-to-open-read-and-write-from-serial-port-in-c

...and: https://stackoverflow.com/questions/11100630/receive-one-byte-from-serial-port-in-linux