close method
Close the serial port. This synchronously closes the handle. The returned future completes after the complete cleanup is done.
Implementation
@override
Future<void> close({bool immediate = false}) {
assert(_isOpen);
_isOpen = false;
PlatformInterface.instance.close(_fd);
final result = _inputController.close();
_writeLock.synchronized(() {
ffi.malloc.free(_writeBuffer);
});
return result.then<void>((value) => null);
}