transmit method Null safety

Future<bool> transmit(
  1. Message msg
)
override

transmit places the message on the wire immediately

Implementation

Future<bool> transmit(Message msg) async {
  if (_characteristic == null) {
    throw Exception("Not connected");
  }
  List<int> data = msg.encode();
  print("Sending: ${Helper.toHex(data)}");
  await _characteristic!.write(data);
  return true;
}