device FAQ

device FAQ

device FAQ

Which devices are currently supported?

The current source code implementation supports serial serial port. Calling open or scan on other device types returns an unsupported device type error.

Which reading method should be used for binary protocols?

It is recommended to use read_bytes() for industrial protocols and custom binary messages, and the return value is fixed to Bytes. read() retains compatible behavior, legal UTF-8 returns String, illegal UTF-8 returns byte array; read_text() strictly converts according to UTF-8, and returns null on failure.

What naming rules are used for serial port fields?

All configuration fields and return object fields use snake_case uniformly, such as baud_rate, data_bits, stop_bits, serial_number.

Does write support binary?

Support. When passing in a string, UTF-8 bytes are written; when passing in an array, each element must be an integer from 0 to 255.