Skip to content

Commit 5c93b08

Browse files
committed
Expose libmodbus's flush command
* Expose libmodbus's flush command to ModbusRTUServer API
1 parent 12c32ce commit 5c93b08

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Diff for: src/ModbusRTUServer.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,9 @@ int ModbusRTUServerClass::poll()
7070
return 0;
7171
}
7272

73+
int ModbusRTUServerClass::flush()
74+
{
75+
return modbus_flush(_mb);
76+
}
77+
7378
ModbusRTUServerClass ModbusRTUServer;

Diff for: src/ModbusRTUServer.h

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ class ModbusRTUServerClass : public ModbusServer {
4646
*/
4747
virtual int poll();
4848

49+
/**
50+
* Flush modbus
51+
*/
52+
virtual int flush();
53+
4954
private:
5055
RS485Class* _rs485 = &RS485;
5156
};

0 commit comments

Comments
 (0)