diff --git a/CHANGELOG.md b/CHANGELOG.md index 71a2005f0..65dc09e1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. ### Changed - TasmotaSerial library from v3.5.0 to v3.6.0 +- Removed leading spaces on commands ``(S)SerialSend1 to 6`` but keep on duplicate commands ``(S)SerialSend11 to 16`` (#16723) ### Fixed - TasmotaSerial ``read(buffer, size)`` regression from v9.3.0 diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 913348801..511885cba 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -153,6 +153,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - WS2812 sends signal to only ``Pixels`` leds instead of sending to 512 leds [#17055](https://github.com/arendst/Tasmota/issues/17055) - AC PWM dimmer lineair power distribution [#17177](https://github.com/arendst/Tasmota/issues/17177) - Zigbee improved Aqara plug support and completed cluster 0x0702 [#17073](https://github.com/arendst/Tasmota/issues/17073) +- Removed leading spaces on commands ``(S)SerialSend1 to 6`` but keep on duplicate commands ``(S)SerialSend11 to 16`` [#16723](https://github.com/arendst/Tasmota/issues/16723 ### Fixed - TasmotaSerial ``read(buffer, size)`` regression from v9.3.0 diff --git a/tasmota/tasmota_support/support_command.ino b/tasmota/tasmota_support/support_command.ino index 51f7b41ca..e50167def 100644 --- a/tasmota/tasmota_support/support_command.ino +++ b/tasmota/tasmota_support/support_command.ino @@ -412,7 +412,8 @@ void CommandHandler(char* topicBuf, char* dataBuf, uint32_t data_len) bool binary_data = (index > 199); // Suppose binary data on topic index > 199 if (!binary_data) { - if (strstr_P(type, PSTR("SERIALSEND")) == nullptr) { // Do not skip leading spaces on (s)serialsend + bool keep_spaces = ((strstr_P(type, PSTR("SERIALSEND")) != nullptr) && (index > 9)); // Do not skip leading spaces on (s)serialsend10 and up + if (!keep_spaces) { while (*dataBuf && isspace(*dataBuf)) { dataBuf++; // Skip leading spaces in data data_len--; @@ -1880,8 +1881,8 @@ void CmndSerialBuffer(void) { #endif } -void CmndSerialSend(void) -{ +void CmndSerialSend(void) { + if (XdrvMailbox.index > 9) { XdrvMailbox.index -= 10; } if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 6)) { SetSeriallog(LOG_LEVEL_NONE); Settings->flag.mqtt_serial = 1; // CMND_SERIALSEND and CMND_SERIALLOG diff --git a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino index b5b626ad8..bcb38fc90 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino @@ -212,6 +212,7 @@ void SerialBridgeInit(void) { \*********************************************************************************************/ void CmndSSerialSend(void) { + if (XdrvMailbox.index > 9) { XdrvMailbox.index -= 10; } if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 6)) { serial_bridge_raw = (XdrvMailbox.index > 3); Settings->sbflag1.serbridge_console = 0; // Disable console Tee