modbus_tcp
fix casting of registers from payload
This commit is contained in:
@@ -62,7 +62,7 @@ static err_t modbus_incoming_data(void* arg, struct tcp_pcb* pcb, struct pbuf* p
|
||||
|
||||
// Putting the buffer in the register array
|
||||
for (uint16_t i = 0; i < p->tot_len && i < MAX_REG; i++) {
|
||||
registers[i] = ((uint*)p->payload)[i];
|
||||
registers[i] = ((uint8_t*)p->payload)[i];
|
||||
}
|
||||
|
||||
if (registers[MODBUS_MODE] == MULTIPLE_REG) {
|
||||
|
||||
Reference in New Issue
Block a user