Пример #1
0
        /// <summary>
        /// Gets status of door
        /// </summary>
        /// <param name="door">Door you want to check status</param>
        /// <returns>if door is online</returns>
        public async Task <bool> GetDoorStatus(Door door)
        {
            if (!IPAddress.TryParse(door.IPAddress, out var ipAddress))
            {
                throw new ArgumentException("Door IP address is not a valid address");
            }

            return(await _pingService.SendWithRetry(ipAddress, _retryCount, _interval));
        }