I am writing some kind of application that will communicate (write only) with my custom USB serial device. This is a Cocoa application (OS X) and the part associated with this entry is POSIX-style.
I solved basically everything, but had problems with the NULL character (0x00).
For example, it allows me to say that I need to write 5 characters to a file.
My code is as follows:
char stringAsChar[5]; stringAsChar[0] = 0x77; stringAsChar[1] = 0x44; stringAsChar[2] = 0x00;
Each character in the specified index represents data for some registers in the target device.
The problem occurs when the stream includes the 0x00 character, which I need to have as data, the record stops there (0x00 is interpreted as stopping the stream).
How to overcome this problem?
source share