Add command (`S)SerialSend6` \<comma seperated values\>

Add command (``S``)``SerialSend6`` \<comma seperated values\> (#8937)
This commit is contained in:
Theo Arends 2020-07-21 12:42:18 +02:00
parent ac780d5e9a
commit 72e3765a55
3 changed files with 12 additions and 1 deletions

View File

@ -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`` \<comma seperated values\> (#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

View File

@ -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`` \<comma seperated values\> (#8937)
### 8.3.1.6 20200617

View File

@ -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();
}
}