Hello everyone, I'm trying to make a Windows program that sends data to a microcontroller, through serial port (usb emulating com).
Till now, I made it with ASCII, but I have to do a job with a classmate, that said me, that I don't have to do that; That I have to send directly to the serial port, the bytes that He needs to use (He program the microcontroller, I, the Windows interface).
I always used writefile with ASCII, in the form:
WriteFile(handlePort,bufferPort,(strlen(buffer_puerto)),&nBytes,NULL);
I have to send a byte chain, like 10000001 10010001 0000000 10100001 11101101.
The problem is, that when Writefile detects the third byte 00000000, interprets it like a null character '\0' and do not send more bytes.
Please, could anyone help me. Is there any way to send all bytes (after the third 00000000) without lost information?
Is There another function apart writefile that can it make that?
How should I do it?
Thanks in advance.
Greetings
Till now, I made it with ASCII, but I have to do a job with a classmate, that said me, that I don't have to do that; That I have to send directly to the serial port, the bytes that He needs to use (He program the microcontroller, I, the Windows interface).
I always used writefile with ASCII, in the form:
WriteFile(handlePort,bufferPort,(strlen(buffer_puerto)),&nBytes,NULL);
I have to send a byte chain, like 10000001 10010001 0000000 10100001 11101101.
The problem is, that when Writefile detects the third byte 00000000, interprets it like a null character '\0' and do not send more bytes.
Please, could anyone help me. Is there any way to send all bytes (after the third 00000000) without lost information?
Is There another function apart writefile that can it make that?
How should I do it?
Thanks in advance.
Greetings