How to transmit NULL(0x00) character through uart in esp-idf 3.3 .
I need to pass a string which contains NULL in middle of strings .
How to transmit NULL character through uart in esp-idf 3.3
Re: How to transmit NULL character through uart in esp-idf 3.3
fwrite().
You cannot printf() a string with NULLs. A printf() string is null terminated! First null & boom!
I am 99% sure stdio (EDIT: must be stdout) is attached to the idf/monitor UART so fwrite() will be cool.
EDIT: PS
I assume that you are attempting UART access using printf(). The basic UART routines will not be 'string' based. UARTs are used for binary as much as strings.
You cannot printf() a string with NULLs. A printf() string is null terminated! First null & boom!
I am 99% sure stdio (EDIT: must be stdout) is attached to the idf/monitor UART so fwrite() will be cool.
EDIT: PS
I assume that you are attempting UART access using printf(). The basic UART routines will not be 'string' based. UARTs are used for binary as much as strings.
& I also believe that IDF CAN should be fixed.
Re: How to transmit NULL character through uart in esp-idf 3.3
I have not tried it, but maybe "uart_write_bytes" might work.
https://docs.espressif.com/projects/esp ... ansmitting
https://docs.espressif.com/projects/esp ... ansmitting
Who is online
Users browsing this forum: No registered users and 129 guests