MonitorSession constructor
MonitorSession(
- AtClient _atClient, {
- String? regex,
- bool shouldDecrypt = true,
- IOSink? output,
})
Implementation
MonitorSession(this._atClient, {String? regex, bool shouldDecrypt = true, IOSink? output})
: _regex = regex ?? defaultMonitorRegex,
_shouldDecrypt = shouldDecrypt,
_output = output ?? stdout {
_output.writeln(green.wrap(
"Starting monitor${_regex != defaultMonitorRegex ? ' with regex: $_regex' : ' (excluding statsNotification)'}..."));
_output.writeln(cyan.wrap("Type 'q' to stop monitoring"));
Stream<AtNotification> stream = _atClient.notificationService
.subscribe(regex: _regex, shouldDecrypt: _shouldDecrypt);
stream.listen(_onData);
_output.writeln(lightYellow.wrap(
"Monitor session started. Using regex: '$_regex'. Waiting for notifications..."));
}