writeSingleCoil abstract method

Future<void> writeSingleCoil(
  1. int slaveId,
  2. int address,
  3. bool isOn
)

Write single coil (FC 05).

Writes a single coil to either ON or OFF.

Parameters:

  • slaveId: The slave device ID (0-247, 0 for broadcast)
  • address: Coil address
  • isOn: true for ON (0xFF00), false for OFF (0x0000)

Example:

await client.writeSingleCoil(1, 0, true); // Turn on coil 0

Implementation

Future<void> writeSingleCoil(int slaveId, int address, bool isOn);