getConnectionStatusStream method

Stream<bool> getConnectionStatusStream()

Returns a broadcast stream that emits true when the printer is connected and false when it is not.

The native side checks the connection every 60 seconds using the ~HS (Health Status) ZPL command.

Implementation

Stream<bool> getConnectionStatusStream() {
  return _connectionStreamChannel
      .receiveBroadcastStream()
      .map<bool>((dynamic event) => event as bool);
}