MethodChannelSerialCommunication class
An implementation of SerialCommunicationPlatform that uses method channels.
- Inheritance
-
- Object
- PlatformInterface
- SerialCommunicationPlatform
- MethodChannelSerialCommunication
Constructors
Properties
- eventChannel → EventChannel
-
EventChannel for opening the inputStream and OutputStream
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- methodChannel → MethodChannel
-
The method channel used to interact with the native platform.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearLog(
) → Future< String?> -
clearLog will clear the log message
it will empty the previous operation log
override
-
clearRead(
) → Future< String?> -
clearRead will clear the read message
all the previous RX data will be clear when you call this method
override
-
closePort(
) → Future< String?> -
close the opened port which you have opened from openPort this method
At a time you can't opened two ports
Close the previous to open the new
override
-
destroyResources(
) → Future< String?> -
destroyResources will destroy the resources
and clear all the background threads from the memory.
override
-
getAvailablePorts(
) → Future< List< String> ?> -
Call the delegate availablePorts method to provide available
serial ports on the device
getAvailablePorts : return type List of String
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openPort(
{required DataFormat dataFormat, required String serialPort, required int baudRate}) → Future< String?> -
Call the delegate openPort native method to start the communication
with available port on the device
the native method have three required arguments:
override
-
sendCommand(
{required String message}) → Future< String?> -
sendCommand call the native method to write the transmit data
the argument
message
will be transmitoverride -
startSerial(
) → Stream< SerialResponse> -
Once this method is called, Operations like openPort,closePort etc...
result will be return from this stream
Providing InputStream and OutputStream
startSerial : return type SerialResponse
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited