ESP32 UART reading special characters including NULL
Posted: Tue Oct 29, 2024 8:18 pm
Hello,
I am trying to parse serial messages being sent to the ESP32 but the function "uart_read_bytes" seems to look for a NULL terminator similarly to printf. My message has special characters including the NULL terminator so I was wondering if there was any function I can use to extract the raw data from the uart rx buffer.
This is the message the ESP32 receives:
0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x0d 0x00 0x1b 0x79
It breaks the message into 2 parts; the 2nd message being 0x00 0x1b 0x79.
I am trying to parse serial messages being sent to the ESP32 but the function "uart_read_bytes" seems to look for a NULL terminator similarly to printf. My message has special characters including the NULL terminator so I was wondering if there was any function I can use to extract the raw data from the uart rx buffer.
This is the message the ESP32 receives:
0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x0d 0x00 0x1b 0x79
It breaks the message into 2 parts; the 2nd message being 0x00 0x1b 0x79.