protected bool RunSingleWritableCommand(IWritableCommand aCommand) { try { //_communicatorInstance.ReadTimeout = 2000; _communicatorInstance.FlushBuffer(); _communicatorInstance.WriteLine(aCommand.WriteCommand()); string zAnswerLine = ""; bool zResult = false; while (!BaseATCommand.CheckCommandAnswer(zAnswerLine)) { zAnswerLine = _communicatorInstance.ReadLine(); zResult = zResult || BaseATCommand.PositiveAnswer(zAnswerLine); } _logger.Debug("Correct Answer received OK"); return(zResult); } catch (Exception zException) { _logger.WarnException("Failed Single command run", zException); return(false); } }
protected virtual bool DeviceWakeUp() { _logger.Debug("Try to Device wake up"); try { _communicatorInstance.WriteLine("AT"); string zAnswer = ""; while (!BaseATCommand.PositiveAnswer(zAnswer)) { zAnswer = _communicatorInstance.ReadLine(); } _logger.Debug("Device wake up OK"); return(true); } catch (Exception zException) { _logger.WarnException("Failed Device wake up", zException); return(false); } }