Conversation
|
I believe #140 would be a better solution to this problem, (and also solves many more) |
|
Maybe so, but one does not interfere with the other. And it can be implemented in the code base at the same time. |
|
PS: Callbacks are convenient to use when you need to do something non-trivial. In your link #140 I see an implicit link to the size of the data. In my opinion, my solution is simple, convenient to use and very intelligible (solving a specific problem). |
|
mazi thanx! |
|
I would need this improvement to implement user defined functions. What is missing for merging it ? |
|
I've been asking the same question for a few years now.... ( |
Add new API function
int modbus_send_generic_request(modbus_t *ctx, const uint8_t *raw_req, int raw_req_length, int wanted_resp_data_length);to enable the implementation of user-defined modbus functions (by standard in the range 65...72 and 100...110) with a predetermined number of requested bytes.
wanted_resp_data_length is number of data bytes between the function code and the checksum
(address, function, data[wanted_resp_data_length], crc).