예제 #1
0
        public async Task <(DeviceStatus devSt, byte[] ctapRes)> SendCommandandResponseAsync(List <string> targetReaders, byte[] payload, int timeoutms)
        {
            var chk = CTAPNFC.CheckAP(targetReaders);

            if (string.IsNullOrEmpty(chk))
            {
                Logger.Err("Connect Error");
                return(DeviceStatus.NotConnected, null);
            }

            var res = await CTAPNFC.SendCommandandResponse(targetReaders, payload);

            if (res == null)
            {
                Logger.Err("Response Error");
                return(DeviceStatus.Unknown, null);
            }

            /* timeoutはとれない?
             * if (res.isTimeout) {
             *  Logger.Err("Wait Response Timeout");
             *  return (DeviceStatus.Timeout, null);
             * }
             */
            return(DeviceStatus.Ok, res);
        }
예제 #2
0
        public bool IsConnected()
        {
            var chk = CTAPNFC.CheckAP(targetReaders);

            return(!string.IsNullOrEmpty(chk));
        }