echo method

Future<String> echo(
  1. String msg,
  2. Duration timeout
)

Sends an echo message to the device.

The response should contain the same message.

Implementation

Future<String> echo(String msg, Duration timeout) {
  return execute(
    Message(
      op: Operation.write,
      group: _osGroup,
      id: _osCmdEcho,
      flags: 0,
      data: CborMap({
        CborString("d"): CborString(msg),
      }),
    ),
    timeout,
  ).unwrap().then(
        (msg) => (msg.data[CborString("r")] as CborString).toString(),
      );
}