Skip to content

Commit b743bda

Browse files
authored
Merge pull request #115 from kidpixo/master
add MODBUS explicit function codes to docs/api.md
2 parents 12c32ce + fd168ae commit b743bda

File tree

2 files changed

+797
-3
lines changed

2 files changed

+797
-3
lines changed

docs/api.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,12 @@ int beginTransmission(int id, int type, int address, int nb);
167167

168168
#### Parameters
169169
- id (slave) - id of target, defaults to 0x00 if not specified
170-
- type - type of write to perform, either COILS or HOLDING_REGISTERS
170+
- type - type of write to perform, either
171+
- COILS (FC 0x01)
172+
- HOLDING_REGISTERS (FC 0x03)
171173
- address start address to use for operation
172174
- nb - number of values to write
173175

174-
175176
#### Returns
176177
1 on success, 0 on failure
177178

@@ -229,7 +230,11 @@ int requestFrom(int id, int type, int address,int nb);
229230

230231
#### Parameters
231232
- id (slave) - id of target, defaults to 0x00 if not specified
232-
- type - type of read to perform, either COILS, DISCRETE_INPUTS, HOLDING_REGISTERS, or INPUT_REGISTERS
233+
- type - type of read to perform, either
234+
- COILS (FC 0x01)
235+
- DISCRETE_INPUTS (FC 0x02)
236+
- HOLDING_REGISTERS (FC 0x03)
237+
- INPUT_REGISTERS (FC 0x04)
233238
- address start address to use for operation
234239
- nb - number of values to read
235240

0 commit comments

Comments
 (0)