init method

  1. @override
Future<bool> init()
override

Initializes the connection to the device.

Implementation

@override
Future<bool> init() async {
  try {
    _delegate = SerialPort(portName);
    return _delegate!.openReadWrite();
  } catch (error) {
    return false;
  }
}