Skip to content

Commit 56754f5

Browse files
committed
2 parents f601525 + e5c7341 commit 56754f5

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ http://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf
7070
+ added removeOnSetCoil\... methods
7171
+ added read/write/push/pullCoil/Hreg/Ireg/Ists() parameter to specify Modbus unit id
7272
+ added ability to auto connect to slave. Setting is global. Disabled by default.
73-
// ToDo for 2.0.1
73+
// 2.0.1
74+
+ Fix readCoil\Hreg\Ists\Ireg not read value from slave
75+
+ Fix cresh on disconnect with Arduino Core 2.5.x
76+
// ToDo for 2.0.2
7477
- modify examples
7578
- code cleanup
7679
// ToDo later

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=modbus-esp8266
2-
version=2.0
2+
version=2.0.1
33
author=Andre Sarmento Barbosa
44
maintainer=Alexander Emelianov<[email protected]>
55
sentence=Modbus Master-Slave Library for ESP8266/ESP32

src/ModbusIP_ESP8266.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ uint16_t ModbusIP::writeCoil(IPAddress ip, uint16_t offset, bool* value, uint16_
257257
uint16_t ModbusIP::readCoil(IPAddress ip, uint16_t offset, bool* value, uint16_t numregs, cbTransaction cb, uint8_t unit) {
258258
if (numregs < 0x0001 || numregs > 0x007B) return false;
259259
readSlave(offset, numregs, FC_READ_COILS);
260-
return send(ip, COIL(offset), cb, unit, value, cb);
260+
return send(ip, COIL(offset), cb, unit, value);
261261
}
262262

263263
uint16_t ModbusIP::writeHreg(IPAddress ip, uint16_t offset, uint16_t value, cbTransaction cb, uint8_t unit) {
@@ -274,19 +274,19 @@ uint16_t ModbusIP::writeHreg(IPAddress ip, uint16_t offset, uint16_t* value, uin
274274
uint16_t ModbusIP::readHreg(IPAddress ip, uint16_t offset, uint16_t* value, uint16_t numregs, cbTransaction cb, uint8_t unit) {
275275
if (numregs < 0x0001 || numregs > 0x007B) return false;
276276
readSlave(offset, numregs, FC_READ_REGS);
277-
return send(ip, HREG(offset), cb, unit, value, cb);
277+
return send(ip, HREG(offset), cb, unit, value);
278278
}
279279

280280
uint16_t ModbusIP::readIsts(IPAddress ip, uint16_t offset, bool* value, uint16_t numregs, cbTransaction cb, uint8_t unit) {
281281
if (numregs < 0x0001 || numregs > 0x007B) return false;
282282
readSlave(offset, numregs, FC_READ_INPUT_STAT);
283-
return send(ip, ISTS(offset), cb, unit, value, cb);
283+
return send(ip, ISTS(offset), cb, unit, value);
284284
}
285285

286286
uint16_t ModbusIP::readIreg(IPAddress ip, uint16_t offset, uint16_t* value, uint16_t numregs, cbTransaction cb, uint8_t unit) {
287287
if (numregs < 0x0001 || numregs > 0x007B) return false;
288288
readSlave(offset, numregs, FC_READ_INPUT_REGS);
289-
return send(ip, IREG(offset), cb, unit, value, cb);
289+
return send(ip, IREG(offset), cb, unit, value);
290290
}
291291

292292
uint16_t ModbusIP::pushCoil(IPAddress ip, uint16_t to, uint16_t from, uint16_t numregs, cbTransaction cb, uint8_t unit) {

0 commit comments

Comments
 (0)