mirror of https://github.com/arendst/Tasmota.git
Refactor serial raw data representation
This commit is contained in:
parent
e83882b655
commit
986a9d10ae
|
@ -1854,8 +1854,7 @@ void SerialInput(void)
|
|||
} else {
|
||||
ResponseAppend_P(PSTR("\""));
|
||||
if (Settings->flag.mqtt_serial_raw) {
|
||||
char hex_char[(TasmotaGlobal.serial_in_byte_counter * 2) + 2];
|
||||
ResponseAppend_P(ToHex_P((unsigned char*)TasmotaGlobal.serial_in_buffer, TasmotaGlobal.serial_in_byte_counter, hex_char, sizeof(hex_char)));
|
||||
ResponseAppend_P(PSTR("%*_H"), TasmotaGlobal.serial_in_byte_counter, TasmotaGlobal.serial_in_buffer);
|
||||
} else {
|
||||
ResponseAppend_P(EscapeJSONString(TasmotaGlobal.serial_in_buffer).c_str());
|
||||
}
|
||||
|
|
|
@ -158,8 +158,7 @@ void SerialBridgeInput(void) {
|
|||
} else {
|
||||
ResponseAppend_P(PSTR("\""));
|
||||
if (serial_bridge_raw) {
|
||||
char hex_char[(serial_bridge_in_byte_counter * 2) + 2];
|
||||
ResponseAppend_P(ToHex_P((unsigned char*)serial_bridge_buffer, serial_bridge_in_byte_counter, hex_char, sizeof(hex_char)));
|
||||
ResponseAppend_P(PSTR("%*_H"), serial_bridge_in_byte_counter, serial_bridge_buffer);
|
||||
} else {
|
||||
ResponseAppend_P(EscapeJSONString(serial_bridge_buffer).c_str());
|
||||
}
|
||||
|
@ -171,7 +170,7 @@ void SerialBridgeInput(void) {
|
|||
XdrvRulesProcess(0);
|
||||
} else {
|
||||
MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, PSTR(D_JSON_SSERIALRECEIVED));
|
||||
}
|
||||
}
|
||||
serial_bridge_in_byte_counter = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue