create method

  1. @override
Future<void> create({
  1. String portId = "",
  2. int byteSize = 8,
  3. int readIntervalTimeout = 10,
  4. int readTotalTimeoutConstant = 2,
})
override

初始化

Implementation

@override
Future<void> create(
    {String portId = "",
    int byteSize = 8,
    int readIntervalTimeout = 10,
    int readTotalTimeoutConstant = 2}) async {
  if (portId == "") {
    portId = (await getAvailablePorts()).first;
  }
  port = SerialPort(portId,
      openNow: false,
      ByteSize: byteSize,
      ReadIntervalTimeout: readIntervalTimeout,
      ReadTotalTimeoutConstant: readTotalTimeoutConstant);
}