Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        private async Task <bool> setFormat(IPortPlug port)
        {
            await _mfCmd.ExecuteAsync(port);

            return(_mfCmd.Succeeded());
        }
Esempio n. 4
0
        public async Task <bool> IsAuthenticated(IPortPlug port)
        {
            await _pinQuery.ExecuteAsync(port);

            return(_pinQuery.Succeeded());
        }
Esempio n. 5
0
        /// <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");
        }
Esempio n. 6
0
        /// <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");
        }
Esempio n. 7
0
        private async Task <MatchCollection> scaMatches(IPortPlug port)
        {
            await _scaQuery.ExecuteAsync(port);

            return(_scaQuery.Succeeded() ? Regex.Matches(_scaQuery.Response, @"\+?\d+") : null);
        }