send method

bool send(
  1. dynamic message
)

Send a message to the ROS node

Implementation

bool send(dynamic message) {
  // If we're not connected give up.
  if (status != Status.connected) return false;
  // Format the message into JSON and then stringify.
  final toSend = (message is Request)
      ? json.encode(message.toJson())
      : (message is Map || message is List)
          ? json.encode(message)
          : message;
  //print('OUTGOING: $toSend');
  // Actually send it to the node.
  _channel.sink.add(toSend);
  return true;
}