Skip to content

Commit

Permalink
changed wrong copying of tcp data to writedata
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenSt committed Aug 24, 2022
1 parent 6995b5b commit e9fca82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ void ModbusTCPHandle(void)
writeData = (uint16_t *)malloc(dataSendCount);
for (uint8_t dataPointer = 0; dataPointer < dataSendCount; dataPointer++)
{
writeData[dataPointer] = (uint16_t)((((uint16_t)modbusBridgeTCP.tcp_buf[dataStartByte+dataPointer]) << 8)
| ((uint16_t)modbusBridgeTCP.tcp_buf[dataStartByte + 1 + dataPointer]));
writeData[dataPointer] = (uint16_t)((((uint16_t)modbusBridgeTCP.tcp_buf[dataStartByte+(dataPointer*2)]) << 8)
| ((uint16_t)modbusBridgeTCP.tcp_buf[dataStartByte + 1 + (dataPointer*2)]));
}
}

Expand Down

0 comments on commit e9fca82

Please sign in to comment.