mirror of https://github.com/arendst/Tasmota.git
parent
ec899817aa
commit
caff54da7c
|
@ -1286,9 +1286,9 @@ void SerialInput(void)
|
|||
char hex_char[(serial_in_byte_counter * 2) + 2];
|
||||
bool assume_json = (!Settings.flag.mqtt_serial_raw && (serial_in_buffer[0] == '{'));
|
||||
Response_P(PSTR("{\"" D_JSON_SERIALRECEIVED "\":%s%s%s}"),
|
||||
(assume_json) ? "" : """",
|
||||
(assume_json) ? "" : "\"",
|
||||
(Settings.flag.mqtt_serial_raw) ? ToHex_P((unsigned char*)serial_in_buffer, serial_in_byte_counter, hex_char, sizeof(hex_char)) : serial_in_buffer,
|
||||
(assume_json) ? "" : """");
|
||||
(assume_json) ? "" : "\"");
|
||||
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_SERIALRECEIVED));
|
||||
XdrvRulesProcess();
|
||||
serial_in_byte_counter = 0;
|
||||
|
|
|
@ -73,9 +73,9 @@ void SerialBridgeInput(void)
|
|||
char hex_char[(serial_bridge_in_byte_counter * 2) + 2];
|
||||
bool assume_json = (!serial_bridge_raw && (serial_bridge_buffer[0] == '{'));
|
||||
Response_P(PSTR("{\"" D_JSON_SSERIALRECEIVED "\":%s%s%s}"),
|
||||
(assume_json) ? "" : """",
|
||||
(assume_json) ? "" : "\"",
|
||||
(serial_bridge_raw) ? ToHex_P((unsigned char*)serial_bridge_buffer, serial_bridge_in_byte_counter, hex_char, sizeof(hex_char)) : serial_bridge_buffer,
|
||||
(assume_json) ? "" : """");
|
||||
(assume_json) ? "" : "\"");
|
||||
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_SSERIALRECEIVED));
|
||||
XdrvRulesProcess();
|
||||
serial_bridge_in_byte_counter = 0;
|
||||
|
|
Loading…
Reference in New Issue