I need to write a "character device" that reads data from an arduino and writes that data to a log file. I have been searching this subject for hours and I have seen a couple of ways to make this work, but they don't use a character device.
I know that this can simply be done using cat from usb device but I am doing this for System Programming class and I need to use a character device. The closest thing I have found was a similar assignment done by the last year's students, but they opened and closed
/dev/ttyACM0 file as shown in this answer.
Is there a correct way other than that to do this from a chacacter device file or is that the correct way?