I'm making an application in C that will interface with a rover. The rover is controlled via strings sent through the serial port. I was thinking that I could just use the port as a file, like so
serial = fopen("/dev/ttyS1","w"
Then write to it using fprintf(). And then close the port and open it for reading, but this doesn't work. Can anyone tell me where I'm going wrong? The rover works by recieving a string, and then returns a string, so I need to write, then read.
When the app is finished it will be used in windows unfortunately, so I assume that /dev/ttyS0 will be interchangable with COM1.