executeCommand method
Implementation
@override
// ignore: missing_return
Future<String?> executeCommand(String atCommand, {bool auth = false}) async {
if (auth) {
if (privateKey != null) {
await authenticate(privateKey);
} else if (cramSecret != null) {
await authenticate_cram(cramSecret);
} else {
throw UnAuthenticatedException(
'Unable to perform atlookup auth. Private key/cram secret is not set');
}
}
try {
await connection!.write(atCommand);
} on Exception catch (e) {
logger.severe('Exception in sending to server, ${e.toString()}');
rethrow;
}
}