From 72e3765a552d590088cf3c54940a39b8a9a143ec Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 21 Jul 2020 12:42:18 +0200 Subject: [PATCH] Add command (``S``)``SerialSend6`` \ Add command (``S``)``SerialSend6`` \ (#8937) --- RELEASENOTES.md | 1 + tasmota/CHANGELOG.md | 1 + tasmota/xdrv_08_serial_bridge.ino | 11 ++++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3127bf4db..490280e79 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -75,6 +75,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Add command ``SetOption100 0/1`` to remove Zigbee ``ZbReceived`` value from ``{"ZbReceived":{xxx:yyy}}`` JSON message - Add command ``SetOption101 0/1`` to add the Zigbee source endpoint as suffix to attributes, ex `Power3` instead of `Power` if sent from endpoint 3 - Add command ``Module2`` to configure fallback module on fast reboot (#8464) +- Add command (``S``)``SerialSend6`` \ (#8937) - Add commands ``LedPwmOn 0..255``, ``LedPwmOff 0..255`` and ``LedPwmMode1 0/1`` to control led brightness by George (#8491) - Add ESP32 ethernet commands ``EthType 0/1``, ``EthAddress 0..31`` and ``EthClockMode 0..3`` - Add rule trigger ``System#Init`` to allow early rule execution without wifi and mqtt initialized yet diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 901dfb7e8..45967d240 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -7,6 +7,7 @@ - Change all timer references from ``Arm`` to ``Enable`` in GUI, ``Timer`` command and JSON message - Add command ``SetOption100 0/1`` to remove Zigbee ``ZbReceived`` value from ``{"ZbReceived":{xxx:yyy}}`` JSON message - Add command ``SetOption101 0/1`` to add the Zigbee source endpoint as suffix to attributes, ex `Power3` instead of `Power` if sent from endpoint 3 +- Add command (``S``)``SerialSend6`` \ (#8937) ### 8.3.1.6 20200617 diff --git a/tasmota/xdrv_08_serial_bridge.ino b/tasmota/xdrv_08_serial_bridge.ino index b5a9143b7..210094048 100644 --- a/tasmota/xdrv_08_serial_bridge.ino +++ b/tasmota/xdrv_08_serial_bridge.ino @@ -124,7 +124,7 @@ void SerialBridgeInit(void) void CmndSSerialSend(void) { - if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 5)) { + if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 6)) { serial_bridge_raw = (XdrvMailbox.index > 3); if (XdrvMailbox.data_len > 0) { if (1 == XdrvMailbox.index) { @@ -153,6 +153,15 @@ void CmndSSerialSend(void) codes += 2; } } + else if (6 == XdrvMailbox.index) { + char *p; + uint8_t code; + char *values = XdrvMailbox.data; + for (char* str = strtok_r(values, ",", &p); str; str = strtok_r(nullptr, ",", &p)) { + code = (uint8_t)atoi(str); + SerialBridgeSerial->write(code); // "72,101,108,108" + } + } ResponseCmndDone(); } }