Changed removed leading spaces on commands ``(S)SerialSend1 to 6``

Removed leading spaces on commands ``(S)SerialSend1 to 6`` but keep on duplicate commands ``(S)SerialSend11 to 16`` (#16723)
This commit is contained in:
Theo Arends 2022-12-04 15:09:39 +01:00
parent b4a688f495
commit e1221b924d
4 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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