@@ -474,12 +474,13 @@ uint32_t ws_sdcard::HexStrToInt(const char *hex_str) {
474474*/
475475bool ws_sdcard::ParseUartAdd (JsonObject &component,
476476 wippersnapper_uart_UartAdd &msg_uart_add) {
477+ delay (5500 );
477478 // Configure the Serial
478479 msg_uart_add.has_cfg_serial = true ;
479- strncpy (msg_uart_add.cfg_serial .pin_rx , component[ " pinRx " ] | UNKNOWN_VALUE,
480- sizeof (msg_uart_add. cfg_serial . pin_rx ) - 1 );
481- strncpy (msg_uart_add.cfg_serial .pin_tx , component[ " pinTx " ] | UNKNOWN_VALUE,
482- sizeof (msg_uart_add. cfg_serial . pin_tx ) - 1 );
480+ snprintf (msg_uart_add.cfg_serial .pin_rx , sizeof (msg_uart_add. cfg_serial . pin_rx ),
481+ " %d " , component[ " pinRx " ] | - 1 );
482+ snprintf (msg_uart_add.cfg_serial .pin_tx , sizeof (msg_uart_add. cfg_serial . pin_tx ),
483+ " %d " , component[ " pinTx " ] | - 1 );
483484 msg_uart_add.cfg_serial .uart_nbr = component[" uartNbr" ] | 0 ;
484485 msg_uart_add.cfg_serial .baud_rate = component[" baudRate" ] | 9600 ;
485486 msg_uart_add.cfg_serial .format =
@@ -1426,10 +1427,16 @@ bool ws_sdcard::LogEventUart(
14261427 doc[" uart_device_id" ] = msg_uart_input_event->device_id ;
14271428 doc[" uart_port" ] = msg_uart_input_event->uart_nbr ;
14281429
1430+ WS_DEBUG_PRINT (" UART Events: " );
1431+ WS_DEBUG_PRINTLN (msg_uart_input_event->events_count );
14291432 // Log each event
14301433 for (pb_size_t i = 0 ; i < msg_uart_input_event->events_count ; i++) {
14311434 doc[" value" ] = msg_uart_input_event->events [i].value .float_value ;
14321435 doc[" si_unit" ] = SensorTypeToSIUnit (msg_uart_input_event->events [i].type );
1436+ WS_DEBUG_PRINT (" Logging UART Event: " );
1437+ WS_DEBUG_PRINTLN (doc[" value" ].as <float >());
1438+ WS_DEBUG_PRINT (" SI Unit: " );
1439+ WS_DEBUG_PRINTLN (doc[" si_unit" ].as <const char *>());
14331440 }
14341441
14351442 if (!LogJSONDoc (doc))
0 commit comments