libmodbus
libmodbus copied to clipboard
modbus_get_socket always return -1
Hi.
I'd like to inquire the amount of data available at a serial port using "ioctl". something like this.
int nread; ioctl(Serial, FIONREAD, &nread);
this is for implementing a non-blocking RTU slave but modbus_get_socket(ctx) always return -1. how can i get socket (file descriptor) of a serial port??