public async Task <IEnumerable <MessageStorageState> > StorageState(IPortPlug port) { var result = Enumerable.Empty <MessageStorageState>(); await _storageQuery.ExecuteAsync(port); if (_storageQuery.Succeeded()) { result = getStorageState(_storageQuery.Response); } return(result); }
public async Task <IEnumerable <MessageStorageItem> > List(IPortPlug port) { var result = Enumerable.Empty <MessageStorageItem>(); if (await setFormat(port)) { await _listQuery.ExecuteAsync(port); if (_listQuery.Succeeded()) { result = getStorageItems(_listQuery.Response); } } return(result); }
private async Task <bool> setFormat(IPortPlug port) { await _mfCmd.ExecuteAsync(port); return(_mfCmd.Succeeded()); }
public async Task <bool> IsAuthenticated(IPortPlug port) { await _pinQuery.ExecuteAsync(port); return(_pinQuery.Succeeded()); }
/// <summary> /// Doesn't require PIN. /// </summary> public async Task <string> SystemInfo(IPortPlug port) { await _sysInfo.ExecuteAsync(port); return(_sysInfo.Succeeded() ? _sysInfo.Response : port?.LastError?.Message ?? "operation failed"); }
/// <summary> /// Requires PIN. /// </summary> public async Task <string> ReceivedSignalCodePower(IPortPlug port) { await _rscp.ExecuteAsync(port); return(_rscp.Succeeded() ? _rscp.Response : port?.LastError?.Message ?? "operation failed"); }
private async Task <MatchCollection> scaMatches(IPortPlug port) { await _scaQuery.ExecuteAsync(port); return(_scaQuery.Succeeded() ? Regex.Matches(_scaQuery.Response, @"\+?\d+") : null); }