char * mbtcp_read_bit_req_fn(uint8_t fc, mbtcp_handle_s *handle, cJSON *req)
Help function.
Definition: mbtcp.c:288
modbus_t * ctx
is connect to modbus slave?
Definition: mb.h:46
`structure key` for modbus tcp hash table
Definition: mb.h:31
void mbtcp_list_handles()
List all handles in mbtcp hash table.
Definition: mbtcp.c:161
cJSON helper functions header
char * set_modbus_success_resp_str_with_data(char *tid, cJSON *json_arr)
Set modbusd success response string with data (i.e., read func)
Definition: mb.c:15
char * set_modbus_success_resp_str(char *tid)
Set modbusd success response string without data (i.e., write func)
Definition: mb.c:36
bool mbtcp_get_handle(mbtcp_handle_s **ptr_handle, char *ip, char *port)
Get mbtcp handle from hashtable.
Definition: mbtcp.c:135
mbtcp_key_s key
Definition: mb.h:44
char * set_modbus_fail_resp_str_with_errno(char *tid, mbtcp_handle_s *handle, int errnum)
Set modbusd fail response string with error number.
Definition: mb.c:59
bool connected
key
Definition: mb.h:45
char * mbtcp_multi_write_req_fn(uint8_t fc, mbtcp_handle_s *handle, cJSON *req)
Help function.
Definition: mbtcp.c:417
char * mbtcp_read_reg_req_fn(uint8_t fc, mbtcp_handle_s *handle, cJSON *req)
Help function.
Definition: mbtcp.c:337
char *(* mbtcp_fc)(uint8_t fc, mbtcp_handle_s *handle, cJSON *req)
Function pointer of modbus tcp function code.
Definition: mb.h:61
char * mbtcp_get_response_timeout(char *tid)
Get mbtcp response timeout.
Definition: mbtcp.c:270
bool mbtcp_get_connection_status(mbtcp_handle_s *handle)
Get mbtcp handle's connection status.
Definition: mbtcp.c:202
char * set_modbus_fail_resp_str(char *tid, const char *reason)
Set modbusd fail response string.
Definition: mb.c:41
bool mbtcp_do_connect(mbtcp_handle_s *handle, char **reason)
Connect to mbtcp slave via mbtcp hashed handle.
Definition: mbtcp.c:174
unsigned char uint8_t
Definition: uthash.h:78
char * mbtcp_cmd_hanlder(uint8_t fc, cJSON *req, mbtcp_fc ptr_handler)
Generic mbtcp command handler.
Definition: mbtcp.c:220
bool mbtcp_init_handle(mbtcp_handle_s **ptr_handle, char *ip, char *port)
Init mbtcp handle (to hashtable) and try to connect.
Definition: mbtcp.c:89
Logging system (Syslog Marcos)
char * mbtcp_single_write_req_fn(uint8_t fc, mbtcp_handle_s *handle, cJSON *req)
Help function.
Definition: mbtcp.c:386
hashable mbtcp handle type
Definition: mb.h:42
char * mbtcp_set_response_timeout(char *tid, long timeout)
Set mbtcp response timeout in usec.
Definition: mbtcp.c:250
UT_hash_handle hh
modbus context pointer
Definition: mb.h:47
Definition: uthash.h:1063