io library

dart:io-only additions for mcp_io_modbus.

Importing the main mcp_io_modbus library keeps the package web-safe (codecs + abstract transport + InMemory paired). Importing this io library opts in to the TCP-socket byte transport used to drive Modbus RTU / ASCII frames through industrial gateways that expose their serial port over plain TCP (no MBAP header).

import 'package:mcp_io_modbus/mcp_io_modbus.dart';
import 'package:mcp_io_modbus/io.dart';

final transport = TcpModbusByteTransport(host: '10.1.2.3', port: 502);
final client = ModbusRtuClient(transport: transport);
final adapter = ModbusRtuAdapter(deviceId: 'plc-1', unitId: 1, client: client);
await adapter.connect();