Exemple #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (CamId != null ? CamId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Street != null ? Street.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Latitude.GetHashCode();
         hashCode = (hashCode * 397) ^ Longitude.GetHashCode();
         return(hashCode);
     }
 }
Exemple #2
0
        public async Task <MassConfigData> GetAllConfigurations([FromBody] CamId data)
        {
            _logger.Info("[GetAllConfigurations] Method started");
            var            authStatus = CheckClient(data.Id, out string rtspIp);
            MassConfigData massConfig = new();

            switch (authStatus)
            {
            case 200:
            {
                _logger.Info("[GetAllConfigurations] Auth status 200. Start of configuration");
                Console.WriteLine($"Getting data from {rtspIp}");
                massConfig.Id          = data.Id;
                massConfig.NetworkData = await GetRequests.Ethernet();

                massConfig.DetectionData = await GetRequests.Detection();

                massConfig.EmailData = await GetRequests.Email();

                massConfig.TimeData = await GetRequests.Time();

                massConfig.NtpData = await GetRequests.Ntp();

                massConfig.OsdChannelNameData = await GetRequests.OsdChannelName();

                massConfig.OsdDateTimeData = await GetRequests.OsdDateTime();

                massConfig.StreamingData = await GetRequests.StreamingChannel();

                massConfig.EventTriggerData = await GetRequests.EventNotifications();

                Console.WriteLine("Done");
                _logger.Info("[GetAllConfigurations] Configuration is complete. \nMethod has completed");
                return(massConfig);
            }

            case 401:
            {
                _logger.Info("[GetAllConfigurations] Auth status 401. Unauthorized. \nMethod has completed");
                return(null);
            }

            case 404:
            {
                _logger.Info("[GetAllConfigurations] Auth status 404. Device not supported. \nMethod has completed");
                return(null);
            }

            case 601:
            {
                _logger.Info("[GetAllConfigurations] Status 601. Rtsp_ip is null. \nMethod has completed");
                return(null);
            }

            default:
            {
                _logger.Info($"[GetAllConfigurations] Auth status {authStatus}. Default error. \nMethod has completed");
                return(null);
            }
            }
        }