Fix FUNC_COMMAND linked list command buffer corruption by shutter driver

This commit is contained in:
Theo Arends 2024-11-08 23:26:46 +01:00
parent 7c82d3a7ae
commit c2091d7082
4 changed files with 15 additions and 11 deletions

View File

@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file.
- Support KNX for scripts (#22429)
- Support deep sleep (standby) for VL53L0X (#22441)
- Support for MS5837 pressure and temperature sensor (#22376)
- Berry add I2C read16/write16 supporting Little Endian
- Berry add I2C read16/write16 supporting Little Endian (#22448)
### Breaking Changed
@ -24,6 +24,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- ESP32-S3 UART output mode for Tx (#22426)
- Mitsubishi Electric HVAC Standby Stage for MiElHVAC (#22430)
- FUNC_COMMAND linked list command buffer corruption by shutter driver
### Removed

View File

@ -137,6 +137,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Mitsubishi Electric HVAC Auto Clear Remote Temp for MiElHVAC [#22370](https://github.com/arendst/Tasmota/issues/22370)
- SolaxX1 Meter mode [#22330](https://github.com/arendst/Tasmota/issues/22330)
- BLE track devices with RPA [#22300](https://github.com/arendst/Tasmota/issues/22300)
- Berry add I2C read16/write16 supporting Little Endian [#22448](https://github.com/arendst/Tasmota/issues/22448)
- HASPmota `haspmota.get_pages()` to get the sorted list of pages [#22358](https://github.com/arendst/Tasmota/issues/22358)
### Breaking Changed
@ -156,6 +157,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- HASPmota support for page delete and object updates [#22311](https://github.com/arendst/Tasmota/issues/22311)
### Fixed
- FUNC_COMMAND linked list command buffer corruption by shutter driver
- Alexa Hue with multiple devices [#22383](https://github.com/arendst/Tasmota/issues/22383)
- Mitsubishi Electric HVAC Standby Stage for MiElHVAC [#22430](https://github.com/arendst/Tasmota/issues/22430)
- EQ3 TRV firmware version 1.46 fails if the default true is used in subscribe on the notify characteristic [#22328](https://github.com/arendst/Tasmota/issues/22328)

View File

@ -2293,6 +2293,7 @@ bool Xdrv27(uint32_t function)
if (Settings->flag3.shutter_mode) { // SetOption80 - Enable shutter support
uint8_t counter = XdrvMailbox.index == 0 ? 1 : XdrvMailbox.index;
uint8_t counterend = XdrvMailbox.index == 0 ? TasmotaGlobal.shutters_present : XdrvMailbox.index;
uint32_t rescue_index = XdrvMailbox.index;
int32_t rescue_payload = XdrvMailbox.payload;
uint32_t rescue_data_len = XdrvMailbox.data_len;
char stemp1[10];
@ -2323,7 +2324,7 @@ bool Xdrv27(uint32_t function)
XdrvMailbox.index = i;
XdrvMailbox.payload = rescue_payload;
XdrvMailbox.data_len = rescue_data_len;
if (!ShutterSettings.version) {
if (!ShutterSettings.version) {
ShutterSettingsLoad(0);
ShutterSettings.shutter_startrelay[0] = 1;
ShutterInit();
@ -2395,13 +2396,16 @@ bool Xdrv27(uint32_t function)
break;
#ifdef USE_WEBSERVER
case FUNC_WEB_SENSOR:
ShutterShow();
// ShutterShow();
break;
#endif // USE_WEBSERVER
case FUNC_ACTIVE:
result = true;
break;
}
XdrvMailbox.index = rescue_index;
XdrvMailbox.payload = rescue_payload;
XdrvMailbox.data_len = rescue_data_len;
}
return result;
}

View File

@ -1899,6 +1899,7 @@ bool Xdrv27(uint32_t function)
if (Settings->flag3.shutter_mode) { // SetOption80 - Enable shutter support
uint8_t counter = XdrvMailbox.index==0?1:XdrvMailbox.index;
uint8_t counterend = XdrvMailbox.index==0?TasmotaGlobal.shutters_present:XdrvMailbox.index;
uint32_t rescue_index = XdrvMailbox.index;
int32_t rescue_payload = XdrvMailbox.payload;
uint32_t rescue_data_len = XdrvMailbox.data_len;
char stemp1[10];
@ -1922,13 +1923,6 @@ bool Xdrv27(uint32_t function)
result = DecodeCommand(kShutterCommands, ShutterCommand);
}
break;
for (uint8_t i = counter; i <= counterend; i++) {
XdrvMailbox.index = i;
XdrvMailbox.payload = rescue_payload;
XdrvMailbox.data_len = rescue_data_len;
result = DecodeCommand(kShutterCommands, ShutterCommand);
}
break;
case FUNC_JSON_APPEND:
if (!sensor_data_reported) {
sensor_data_reported = true;
@ -1984,13 +1978,16 @@ bool Xdrv27(uint32_t function)
break;
#ifdef USE_WEBSERVER
case FUNC_WEB_SENSOR:
ShutterShow();
// ShutterShow();
break;
#endif // USE_WEBSERVER
case FUNC_ACTIVE:
result = true;
break;
}
XdrvMailbox.index = rescue_index;
XdrvMailbox.payload = rescue_payload;
XdrvMailbox.data_len = rescue_data_len;
}
return result;
}