zzeroo / libmodbus-rs

Libmodbus bindings for Rust
http://zzeroo.github.io/libmodbus-rs/
GNU Lesser General Public License v2.1
10 stars 5 forks source link

Wrong function codes in modbus.rs #15

Open Ibens3C opened 2 years ago

Ibens3C commented 2 years ago

Hi, in the modbus.rs file is pub enum FunctionCode, where the default Modbus function codes are defined. I've noticed, that the codes were taken over from decimal format and are defined as hex. This seems to be wrong. For example:

/// 0x15 Write Multiple Coils
WriteMultipleCoils = 0x15,

should be

/// 15 Write Multiple Coils
WriteMultipleCoils = 0x0F,