(address, value)
| 183 | |
| 184 | // Protocol encoders (pure helpers, always available). |
| 185 | function modbusWriteRegister(address, value) { |
| 186 | var a = address & 0xFFFF, v = Math.round(value) & 0xFFFF; |
| 187 | return String.fromCharCode((a >> 8) & 0xFF, a & 0xFF, (v >> 8) & 0xFF, v & 0xFF); |
| 188 | } |
| 189 | function modbusWriteCoil(address, on) { |
| 190 | return modbusWriteRegister(address, on ? 0xFF00 : 0x0000); |
| 191 | } |
no test coverage detected