Beispiel #1
0
        /// <summary>
        /// Human-readable version of the object.
        /// </summary>
        /// <returns>String.</returns>
        public override string ToString()
        {
            string ret =
                "--- Statistics ---" + Environment.NewLine +
                "    Start Time     : " + StartTime.ToString() + Environment.NewLine +
                "    Up Time        : " + UpTime.ToString() + Environment.NewLine +
                "    Received Payload Bytes : " + ReceivedPayloadBytes + " bytes" + Environment.NewLine +
                "    Sent Payload Bytes     : " + SentPayloadBytes + " bytes" + Environment.NewLine +
                "    Requests By Method     : " + Environment.NewLine;

            lock (_DictionaryLock)
            {
                if (_RequestsByMethod.Count > 0)
                {
                    foreach (KeyValuePair <HttpMethod, long> curr in _RequestsByMethod)
                    {
                        ret +=
                            "        " + curr.Key.ToString().PadRight(18) + " : " + curr.Value + Environment.NewLine;
                    }
                }
                else
                {
                    ret += "        (none)" + Environment.NewLine;
                }
            }

            return(ret);
        }
Beispiel #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (upTime_ != null)
            {
                hash ^= UpTime.GetHashCode();
            }
            if (Age != 0)
            {
                hash ^= Age.GetHashCode();
            }
            hash ^= modelList_.GetHashCode();
            if (model_ != null)
            {
                hash ^= Model.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Beispiel #3
0
 public void MergeFrom(HelloRequest other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.upTime_ != null)
     {
         if (upTime_ == null)
         {
             UpTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         UpTime.MergeFrom(other.UpTime);
     }
     if (other.Age != 0)
     {
         Age = other.Age;
     }
     modelList_.Add(other.modelList_);
     if (other.model_ != null)
     {
         if (model_ == null)
         {
             Model = new global::GRpc.Model.TestModel();
         }
         Model.MergeFrom(other.Model);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Beispiel #4
0
        public DynamicJsonValue ToJson()
        {
            return(new DynamicJsonValue
            {
                [nameof(Name)] = Name,
                [nameof(Disabled)] = Disabled,
                [nameof(TotalSize)] = new DynamicJsonValue
                {
                    [nameof(Size.HumaneSize)] = TotalSize.HumaneSize,
                    [nameof(Size.SizeInBytes)] = TotalSize.SizeInBytes
                },

                [nameof(IsAdmin)] = IsAdmin,
                [nameof(IsEncrypted)] = IsEncrypted,
                [nameof(UpTime)] = UpTime?.ToString(),
                [nameof(BackupInfo)] = BackupInfo?.ToJson(),

                [nameof(Alerts)] = Alerts,
                [nameof(RejectClients)] = false,
                [nameof(IndexingErrors)] = IndexingErrors,

                [nameof(DocumentsCount)] = DocumentsCount,
                [nameof(HasRevisionsConfiguration)] = HasRevisionsConfiguration,
                [nameof(HasExpirationConfiguration)] = HasExpirationConfiguration,
                [nameof(IndexesCount)] = IndexesCount,
                [nameof(IndexingStatus)] = IndexingStatus.ToString(),

                [nameof(NodesTopology)] = NodesTopology?.ToJson(),
                [nameof(ReplicationFactor)] = ReplicationFactor,
                [nameof(DynamicNodesDistribution)] = DynamicNodesDistribution,
                [nameof(DeletionInProgress)] = DynamicJsonValue.Convert(DeletionInProgress)
            });
        }
Beispiel #5
0
        internal override void UpdateProperties(Dictionary <string, Dictionary <string, string> > properties)
        {
            base.UpdateProperties(properties);

            try
            {
                if (properties.ContainsKey("hdmiInput"))
                {
                    HdmiInput.UpdateFromProperties(properties["hdmiInput"]);
                }
            }
            catch (Exception e)
            {
                CloudLog.Error("Error processing property values in {0}, {1}", GetType().Name, e.Message);
            }

#if DEBUG
            CrestronConsole.PrintLine("Updated {0}, \"{1}\": State: {2}", GetType().Name, Name, State);
            if (State != DeviceState.Up)
            {
                return;
            }
            CrestronConsole.PrintLine("   Uptime: {0}", UpTime.ToPrettyFormat());
            CrestronConsole.PrintLine("   HdmiInput: {0}{1}{2}",
                                      HdmiInput.Connected ? "Connected" : "Disconnected",
                                      HdmiInput.Connected ? " " + HdmiInput.Format : "",
                                      HdmiInput.Connected ? " HDCP: " + HdmiInput.Hdcp : "",
                                      HdmiInput.Connected ? " HDMI 2.0: " + HdmiInput.Hdmi2Point0 : "");
#endif
        }
Beispiel #6
0
        /// <summary>
        /// Return human-readable version of the object.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            string ret =
                "--- Statistics ---" + Environment.NewLine +
                "    Started        : " + _StartTime.ToString() + Environment.NewLine +
                "    Uptime         : " + UpTime.ToString() + Environment.NewLine +
                "    Received bytes : " + ReceivedBytes + Environment.NewLine +
                "    Sent bytes     : " + SentBytes + Environment.NewLine;

            return(ret);
        }
Beispiel #7
0
        internal override void UpdateProperties(Dictionary <string, Dictionary <string, string> > properties)
        {
            base.UpdateProperties(properties);

            try
            {
                if (properties.ContainsKey("connectedEncoder"))
                {
                    var values = properties["connectedEncoder"];

                    if (Server.Devices.Any(d => d.MacAddress == values["mac"]))
                    {
                        _connectedEncoder = Server.Devices[values["mac"]] as ZeeVeeEncoder;
                    }
                    else
                    {
                        _connectedEncoder = null;
                    }
                    ReceivingVideoFromEncoder = (values["receivingVideoFromEncoder"] == "yes");
                }

                if (properties.ContainsKey("hdmiOutput"))
                {
                    HdmiOutput.UpdateFromProperties(properties["hdmiOutput"]);
                }
            }
            catch (Exception e)
            {
                CloudLog.Exception("Error processing property values", e);
            }

#if DEBUG
            CrestronConsole.PrintLine("Updated {0}, \"{1}\": State: {2}", GetType().Name, Name, State);
            if (State != DeviceState.Up)
            {
                return;
            }
            CrestronConsole.PrintLine("   Uptime: {0}", UpTime.ToPrettyFormat());
            if (ConnectedEncoder != null)
            {
                CrestronConsole.PrintLine("   Connected Encoder: {0}, Receiving Video: {1}", ConnectedEncoder.Name,
                                          ReceivingVideoFromEncoder);
            }
            CrestronConsole.PrintLine("   HdmiOutput: {0}{1}{2}",
                                      HdmiOutput.Connected ? "Connected" : "Disconnected",
                                      HdmiOutput.Connected ? " " + HdmiOutput.Format : "",
                                      HdmiOutput.Connected ? " HDCP: " + HdmiOutput.Hdcp : "",
                                      HdmiOutput.Connected ? " HDMI 2.0: " + HdmiOutput.Hdmi2Point0 : "");
            if (HdmiOutput.Connected)
            {
                CrestronConsole.PrintLine("   Edid Status: {0}", HdmiOutput.EdidStatus);
            }
#endif
        }
Beispiel #8
0
        public void DisplayWiFiNodesInfo()
        {
            var toString = $"{HostName.Trim().PadRight(20, ' ').Substring(0, 20)}, " +
                           $"{IpAddress.Trim().PadRight(15)}, {MacAddress}," +
                           //$"{ Interface}, " +
                           $"{ UpTime.ToString("c").PadLeft(11)}, { TxRateMb.ToString().PadLeft(3)}, { RxRateMb.ToString().PadLeft(3)}, " +
                           //$"{ Info}, " +
                           $"{SignalLeveldB.ToString().PadLeft(3)}, {NoiseLeveldB.ToString().PadLeft(4)}, {SignalToNoiseRatiodB.ToString().PadLeft(4)}, {SignalQuality.ToString().PadLeft(3)}%";

            Console.WriteLine(toString);
        }
 public override int GetHashCode()
 {
     return
         ((HMDeviceID != null ? HMDeviceID.GetHashCode() : 0) +
          (MQTTRootTopicLevel != null ? MQTTRootTopicLevel.GetHashCode() : 0) +
          (Version != null ? Version.GetHashCode() : 0) +
          (Status.GetHashCode()) +
          (Name != null ? Name.GetHashCode() : 0) +
          (LocalIP != null ? LocalIP.GetHashCode() : 0) +
          (MAC != null ? MAC.GetHashCode() : 0) +
          (UpTime != null ? UpTime.GetHashCode() : 0) +
          (Signal != null ? Signal.GetHashCode() : 0)); //finish
 }
Beispiel #10
0
 protected override void OnStart(string[] args)
 {
     try
     {
         up              = new UpTime();
         _timer          = new Timer(minute * 60 * 1000);
         _timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
         _timer.Start();
     }
     catch (Exception ex)
     {
         MessageBox.Show("OnStart Error: " + ex.Message + "\nin string " + Regex.Match(ex.StackTrace.ToString(), @"\d+$").Value);
         Environment.Exit(0);
     }
 }
        /// <summary>
        /// Return human-readable version of the object.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            string ret =
                "--- Statistics ---" + Environment.NewLine +
                "    Started     : " + _StartTime.ToString() + Environment.NewLine +
                "    Uptime      : " + UpTime.ToString() + Environment.NewLine +
                "    Received    : " + Environment.NewLine +
                "       Bytes    : " + ReceivedBytes + Environment.NewLine +
                "       Messages : " + ReceivedMessages + Environment.NewLine +
                "       Average  : " + ReceivedMessageSizeAverage + " bytes" + Environment.NewLine +
                "    Sent        : " + Environment.NewLine +
                "       Bytes    : " + SentBytes + Environment.NewLine +
                "       Messages : " + SentMessages + Environment.NewLine +
                "       Average  : " + SentMessageSizeAverage + " bytes" + Environment.NewLine;

            return(ret);
        }
        public TaskTrayApplicationContext()
        {
            AppDomain.CurrentDomain.ProcessExit += new EventHandler(Exit);
            MenuItem configMenuItem   = new MenuItem("Configuration", new EventHandler(ShowConfig));
            MenuItem settingsMenuItem = new MenuItem("Settings", new EventHandler(ShowSettings));
            MenuItem exitMenuItem     = new MenuItem("Exit", new EventHandler(Exit));

            up = new UpTime();
            notifyIcon.DoubleClick += new EventHandler(ShowMessage);
            notifyIcon.ContextMenu  = new ContextMenu(
                new MenuItem[] {
                configMenuItem,
                settingsMenuItem,
                exitMenuItem
            });
            notifyIcon.Visible = true;
            LoadSettings();
            timer_Elapsed();
        }
Beispiel #13
0
        public void WriteTo(BlittableJsonTextWriter writer)
        {
            writer.WriteStartObject();

            writer.WritePropertyName(nameof(UpTime));
            writer.WriteString(UpTime.ToString("c"));
            writer.WriteComma();

            writer.WritePropertyName(nameof(StartUpTime));
            writer.WriteDateTime(StartUpTime, isUtc: true);
            writer.WriteComma();

            writer.WritePropertyName(nameof(LastRequestTime));
            if (LastRequestTime.HasValue)
            {
                writer.WriteDateTime(LastRequestTime.Value, isUtc: true);
            }
            else
            {
                writer.WriteNull();
            }

            writer.WriteEndObject();
        }
Beispiel #14
0
      private void button1_Click(object sender, EventArgs e)
      {
          string data = "", fn = "";
          //формировать имя файла по типу
          // имякомп_день-мес-год_час-мин-сек_время аптайма.txt
          string p2 = "R", name = "", rx_byte, tx_byte, rx_packet, tx_packet;
          int    p1 = 0;

          //  label1.Text = GetLocalIpAddress();
          foreach (var netI in NetworkInterface.GetAllNetworkInterfaces())
          {
              if (netI.NetworkInterfaceType != NetworkInterfaceType.Wireless80211 &&
                  (//netI.NetworkInterfaceType != NetworkInterfaceType.Ethernet ||
                      netI.OperationalStatus != OperationalStatus.Up))
              {
                  continue;
              }
              name      = (netI.Name + "        ").Substring(0, 8);
              rx_byte   = "                  " + netI.GetIPv4Statistics().BytesSent.ToString();
              rx_byte   = rx_byte.Substring(rx_byte.Length - 18, 18);
              tx_byte   = "                  " + netI.GetIPv4Statistics().BytesReceived.ToString();//18 symb
              tx_byte   = tx_byte.Substring(tx_byte.Length - 18, 18);
              rx_packet = "                  " + netI.GetIPv4Statistics().UnicastPacketsSent.ToString();
              rx_packet = rx_packet.Substring(rx_packet.Length - 18, 18);
              tx_packet = "                  " + netI.GetIPv4Statistics().UnicastPacketsReceived.ToString();
              tx_packet = tx_packet.Substring(tx_packet.Length - 18, 18);
              //
              string ip_addr = "";
              foreach (var uniIpAddrInfo in netI.GetIPProperties().UnicastAddresses.Where(x => netI.GetIPProperties().GatewayAddresses.Count > 0))
              {
                  ip_addr += uniIpAddrInfo.Address.ToString() + "_";
              }

              //

              label2.Text +=
                  p1++.ToString() + "_" + name + "_" + rx_byte + "_" + tx_byte + "_" + ip_addr + Environment.NewLine;
              data +=
                  p1++.ToString() + "_" + name + "_" + rx_byte + "_" + tx_byte + "_" + ip_addr + Environment.NewLine;
          }
          //скидываем в файл
          string s = DateTime.Now.ToString("dd-MMMM-yyyy_HH-mm");

          string[] m_ru = { "января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря" };
          string[] m_en = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" };
          for (int i = 0; i < 12; i++)
          {
              s = s.Replace(m_ru[i], m_en[i]);
          }
          //формируем имя файла
          string mname = Environment.MachineName, upti = UpTime.ToString().Remove(UpTime.ToString().LastIndexOf("."));

          label1.Text = mname + "_" + s + "_" + upti;
          fn          = mname + "_" + s + "_" + upti;
          fn          = fn.Replace(":", "_");
          fn         += ".txt";
          File.WriteAllText(@path + @fn, data);
          //отправляем файл на почту...
          send_mail(@path + @fn);
          button1.Text += "ok";
      }
Beispiel #15
0
        static void HandleElapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            System.Collections.Generic.Dictionary <string, string> dConfig = new System.Collections.Generic.Dictionary <string, string> ();

            if (!System.IO.Directory.Exists("dyndata"))
            {
                System.IO.Directory.CreateDirectory("dyndata");
            }

            bool Enable = false; string ConnectionStatus = "Unbekannt"; string PossibleConnectionTypes = "Unbekannt"; string ConnectionType = "Unbekannt"; string Name = "Unbekannt"; uint Uptime = 0; uint UpstreamMaxBitRate = 0; uint DownstreamMaxBitRate = 0; string LastConnectionError = ""; uint IdleDisconnectTime = 0; bool RSIPAvailable = false; string UserName = "******"; bool NATEnabled = false; string ExternalIPAddress = "0.0.0.0"; string DNSServers = "0.0.0.0"; string MACAddress = "::::"; string ConnectionTrigger = "Unbekannt"; string LastAuthErrorInfo = ""; ushort MaxCharsUsername = 0; ushort MinCharsUsername = 0; string AllowedCharsUsername = "******"; ushort MaxCharsPassword = 0; ushort MinCharsPassword = 0; string AllowedCharsPassword = "******"; string TransportType = "Unbekannt"; string RouteProtocolRx = "Unbekannt"; string PPPoEServiceName = "Unbekannt"; string RemoteIPAddress = "0.0.0.0"; string PPPoEACName = "Unbekannt"; bool DNSEnabled = false; bool DNSOverrideAllowed = false;

            try {
                Wanpppconn1 service = new Wanpppconn1("https://" + NetConfig["Gateway"] + ":" + NetConfig["GW-SSL-Port"]);
                service.SoapHttpClientProtocol.Credentials = new NetworkCredential(NetConfig["TR064-Username"], NetConfig["FRITZPass"]);
                service.GetInfo(out Enable, out ConnectionStatus, out PossibleConnectionTypes, out ConnectionType, out Name, out Uptime, out UpstreamMaxBitRate, out DownstreamMaxBitRate, out LastConnectionError, out IdleDisconnectTime, out RSIPAvailable, out UserName, out NATEnabled, out ExternalIPAddress, out DNSServers, out MACAddress, out ConnectionTrigger, out LastAuthErrorInfo, out MaxCharsUsername, out MinCharsUsername, out AllowedCharsUsername, out MaxCharsPassword, out MinCharsPassword, out AllowedCharsPassword, out TransportType, out RouteProtocolRx, out PPPoEServiceName, out RemoteIPAddress, out PPPoEACName, out DNSEnabled, out DNSOverrideAllowed);
                dConfig.Clear();
                dConfig.Add("Enable", Enable.ToString());
                dConfig.Add("ConnectionStatus", ConnectionStatus.ToString());
                dConfig.Add("PossibleConnectionTypes", PossibleConnectionTypes.ToString());
                dConfig.Add("ConnectionType", ConnectionType.ToString());
                dConfig.Add("Name", Name.ToString());
                dConfig.Add("Uptime", System.DateTime.Now.AddSeconds(Uptime).ToString());
                dConfig.Add("UpstreamMaxBitRate", UpstreamMaxBitRate.ToString());
                dConfig.Add("DownstreamMaxBitRate", DownstreamMaxBitRate.ToString());
                dConfig.Add("LastConnectionError", LastConnectionError.ToString());
                dConfig.Add("IdleDisconnectTime", IdleDisconnectTime.ToString());
                dConfig.Add("RSIPAvailable", RSIPAvailable.ToString());
                dConfig.Add("UserName", UserName.ToString());
                dConfig.Add("NATEnabled", NATEnabled.ToString());
                dConfig.Add("ExternalIPAddress", ExternalIPAddress.ToString());
                dConfig.Add("DNSServers", DNSServers.ToString());
                dConfig.Add("MACAddress", MACAddress.ToString());
                dConfig.Add("ConnectionTrigger", ConnectionTrigger.ToString());
                dConfig.Add("LastAuthErrorInfo", LastAuthErrorInfo.ToString());
                dConfig.Add("MaxCharsUsername", MaxCharsUsername.ToString());
                dConfig.Add("MinCharsUsername", MinCharsUsername.ToString());
                dConfig.Add("AllowedCharsUsername", AllowedCharsUsername.ToString());
                dConfig.Add("MaxCharsPassword", MaxCharsPassword.ToString());
                dConfig.Add("MinCharsPassword", MinCharsPassword.ToString());
                dConfig.Add("AllowedCharsPassword", AllowedCharsPassword.ToString());
                dConfig.Add("TransportType", TransportType.ToString());
                dConfig.Add("RouteProtocolRx", RouteProtocolRx.ToString());
                dConfig.Add("PPPoEServiceName", PPPoEServiceName.ToString());
                dConfig.Add("RemoteIPAddress", RemoteIPAddress.ToString());
                dConfig.Add("PPPoEACName", PPPoEACName.ToString());
                dConfig.Add("DNSEnabled", DNSEnabled.ToString());
                dConfig.Add("DNSOverrideAllowed", DNSOverrideAllowed.ToString());
                FeuerwehrCloud.Helper.AppSettings.Save(dConfig, "dyndata/wanppp.info");
            } catch (Exception ex) {
                FeuerwehrCloud.Helper.Logger.WriteLine(FeuerwehrCloud.Helper.Helper.GetExceptionDescription(ex));
            }



            System.Net.WebClient WC = new WebClient();

            FritzTR064.Generated.Tam cTam = new Tam("https://" + NetConfig["Gateway"] + ":" + NetConfig["GW-SSL-Port"]);
            cTam.SoapHttpClientProtocol.Credentials = new NetworkCredential(NetConfig["TR064-Username"], NetConfig["FRITZPass"]);
            string TamList;

            for (ushort i = 0; i < 5; i++)
            {
                ushort Index;
                bool   abEnable;
                string abName;
                bool   TAMRunning;
                ushort Stick;
                ushort Status;
                cTam.GetInfo(i, out abEnable, out abName, out TAMRunning, out Stick, out Status);
                dConfig.Clear();
                dConfig.Add("Enable", abEnable.ToString());
                dConfig.Add("Name", abName.ToString());
                dConfig.Add("TAMRunning", TAMRunning.ToString());
                dConfig.Add("Stick", Stick.ToString());
                dConfig.Add("Status", Status.ToString());
                if (abEnable == true)
                {
                    cTam.GetMessageList(i, out TamList);
                    WC.Credentials = cTam.SoapHttpClientProtocol.Credentials;
                    WC.DownloadFile(TamList, "dyndata/tam" + i.ToString() + ".xml");
                }
                FeuerwehrCloud.Helper.AppSettings.Save(dConfig, "dyndata/tam.info");
            }


            FritzTR064.Generated.Contact c = new Contact("https://" + NetConfig["Gateway"] + ":" + NetConfig["GW-SSL-Port"]);
            c.SoapHttpClientProtocol.Credentials = new NetworkCredential(NetConfig["TR064-Username"], NetConfig["FRITZPass"]);
            string calllist; string DectIDList; string HandsetName; ushort PhonebookID;  bool cEnable; string cStatus; string LastConnect; string Url; string ServiceId; string Username;

            dConfig.Clear();
            c.GetCallList(out calllist);
            WC.Credentials = c.SoapHttpClientProtocol.Credentials;
            WC.DownloadFile(calllist, "dyndata/calllist.xml");
            try {
                c.GetInfo(out cEnable, out cStatus, out LastConnect, out Url, out ServiceId, out UserName, out Name);
                dConfig.Add("Enable", cEnable.ToString());
                dConfig.Add("Status", cStatus.ToString());
                dConfig.Add("LastConnect", LastConnect.ToString());
                dConfig.Add("Url", Url.ToString());
                dConfig.Add("ServiceId", ServiceId.ToString());
                dConfig.Add("Name", Name.ToString());
                if (cEnable)
                {
                    c.GetDECTHandsetList(out DectIDList);
                    for (ushort DectID = 1; DectID < 10; DectID++)
                    {
                        c.GetDECTHandsetInfo(DectID, out HandsetName, out PhonebookID);
                        dConfig.Add("DectID", DectID.ToString());
                        dConfig.Add("HandsetName-" + DectID.ToString(), HandsetName.ToString());
                        dConfig.Add("PhonebookID-" + DectID.ToString(), PhonebookID.ToString());
                    }
                }
                //			c.GetInfoByIndex();
                //			c.GetNumberOfEntries();
                //			c.GetPhonebook();
                //			c.GetPhonebookList();
            } catch (Exception ex) {
                FeuerwehrCloud.Helper.Logger.WriteLine(FeuerwehrCloud.Helper.Helper.GetExceptionDescription(ex));
            }


            FritzTR064.Generated.Wandslifconfig1 w1 = new Wandslifconfig1("https://" + NetConfig["Gateway"] + ":" + NetConfig["GW-SSL-Port"]);
            w1.SoapHttpClientProtocol.Credentials = new NetworkCredential(NetConfig["TR064-Username"], NetConfig["FRITZPass"]);
            //FritzTR064.Generated.Wandsllinkconfig1 w2 = new Wandsllinkconfig1(());
            bool wandslIFEnable; string dslStatus; string DataPath; uint UpstreamCurrRate; uint DownstreamCurrRate; uint UpstreamMaxRate; uint DownstreamMaxRate; uint UpstreamNoiseMargin; uint DownstreamNoiseMargin; uint UpstreamAttenuation; uint DownstreamAttenuation; string ATURVendor; string ATURCountry; ushort UpstreamPower; ushort DownstreamPower;

            w1.GetInfo(out wandslIFEnable, out dslStatus, out DataPath, out UpstreamCurrRate, out DownstreamCurrRate, out UpstreamMaxRate, out DownstreamMaxRate, out UpstreamNoiseMargin, out DownstreamNoiseMargin, out UpstreamAttenuation, out DownstreamAttenuation, out ATURVendor, out ATURCountry, out UpstreamPower, out DownstreamPower);
            dConfig.Clear();
            dConfig.Add("wandslIFEnable", wandslIFEnable.ToString());
            dConfig.Add("Status", dslStatus.ToString());
            dConfig.Add("DataPath", DataPath.ToString());
            dConfig.Add("UpstreamCurrRate", UpstreamCurrRate.ToString());
            dConfig.Add("DownstreamCurrRate", DownstreamCurrRate.ToString());
            dConfig.Add("UpstreamMaxRate", UpstreamMaxRate.ToString());
            dConfig.Add("DownstreamMaxRate", DownstreamMaxRate.ToString());
            dConfig.Add("UpstreamNoiseMargin", UpstreamNoiseMargin.ToString());
            dConfig.Add("DownstreamNoiseMargin", DownstreamNoiseMargin.ToString());
            dConfig.Add("UpstreamAttenuation", UpstreamAttenuation.ToString());
            dConfig.Add("DownstreamAttenuation", DownstreamAttenuation.ToString());
            dConfig.Add("ATURVendor", ATURVendor.ToString());
            dConfig.Add("ATURCountry", ATURCountry.ToString());
            dConfig.Add("UpstreamPower", UpstreamPower.ToString());
            dConfig.Add("DownstreamPower", DownstreamPower.ToString());
            FeuerwehrCloud.Helper.AppSettings.Save(dConfig, "dyndata/wandsl.info");

            FritzTR064.Generated.Wlanconfig1 wlc = new Wlanconfig1("https://" + NetConfig["Gateway"] + ":" + NetConfig["GW-SSL-Port"]);
            wlc.SoapHttpClientProtocol.Credentials = new NetworkCredential(NetConfig["TR064-Username"], NetConfig["FRITZPass"]);
            string wlStatus; bool wlEnable; string MaxBitRate; byte Channel; string SSID; string BeaconType; bool MACAddressControlEnabled; string Standard; string BSSID; string BasicEncryptionModes; string BasicAuthenticationMode; byte MaxCharsSSID; byte MinCharsSSID; string AllowedCharsSSID; byte MinCharsPSK; byte MaxCharsPSK; string AllowedCharsPSK;

            wlc.GetInfo(out wlEnable, out wlStatus, out MaxBitRate, out Channel, out SSID, out BeaconType, out MACAddressControlEnabled, out Standard, out BSSID, out BasicEncryptionModes, out BasicAuthenticationMode, out MaxCharsSSID, out MinCharsSSID, out AllowedCharsSSID, out MinCharsPSK, out MaxCharsPSK, out AllowedCharsPSK);
            dConfig.Clear();
            dConfig.Add("Enable", wlEnable.ToString());
            dConfig.Add("Status", wlStatus.ToString());
            dConfig.Add("MaxBitRate", MaxBitRate.ToString());
            dConfig.Add("Channel", Channel.ToString());
            dConfig.Add("SSID", SSID.ToString());
            dConfig.Add("BeaconType", BeaconType.ToString());
            dConfig.Add("MACAddressControlEnabled", MACAddressControlEnabled.ToString());
            dConfig.Add("Standard", Standard.ToString());
            dConfig.Add("BSSID", BSSID.ToString());
            dConfig.Add("BasicEncryptionModes", BasicEncryptionModes.ToString());
            dConfig.Add("BasicAuthenticationMode", BasicAuthenticationMode.ToString());
            dConfig.Add("MaxCharsSSID", MaxCharsSSID.ToString());
            dConfig.Add("MinCharsSSID", MinCharsSSID.ToString());
            dConfig.Add("AllowedCharsSSID", AllowedCharsSSID.ToString());
            dConfig.Add("MinCharsPSK", MinCharsPSK.ToString());
            dConfig.Add("MaxCharsPSK", MaxCharsPSK.ToString());
            dConfig.Add("AllowedCharsPSK", AllowedCharsPSK.ToString());
            FeuerwehrCloud.Helper.AppSettings.Save(dConfig, "dyndata/wlan.info");

            FritzTR064.Generated.Voip voip1 = new Voip("https://" + NetConfig["Gateway"] + ":" + NetConfig["GW-SSL-Port"]);
            voip1.SoapHttpClientProtocol.Credentials = new NetworkCredential(NetConfig["TR064-Username"], NetConfig["FRITZPass"]);
            string NumberList; bool FaxT38Enable; string VoiceCoding; string ClientList; ushort ExistingVoIPNumbers; string PhoneName; uint NumberOfNumbers; ushort NumberOfClients; ushort MaxVoipNumbers;

            voip1.GetInfo(out FaxT38Enable, out VoiceCoding);
            voip1.GetClients(out ClientList);
            voip1.GetExistingVoIPNumbers(out ExistingVoIPNumbers);
            voip1.DialGetConfig(out PhoneName);
            voip1.GetNumbers(out NumberList);
            voip1.GetNumberOfNumbers(out NumberOfNumbers);
            voip1.GetNumberOfClients(out NumberOfClients);
            voip1.GetMaxVoIPNumbers(out MaxVoipNumbers);
            dConfig.Clear();
            dConfig.Add("NumberList", NumberList.ToString());
            dConfig.Add("FaxT38Enable", FaxT38Enable.ToString());
            dConfig.Add("VoiceCoding", VoiceCoding.ToString());
            dConfig.Add("ClientList", ClientList.ToString());
            dConfig.Add("ExistingVoIPNumbers", ExistingVoIPNumbers.ToString());
            dConfig.Add("PhoneName", PhoneName.ToString());
            dConfig.Add("NumberOfNumbers", NumberOfNumbers.ToString());
            dConfig.Add("NumberOfClients", NumberOfClients.ToString());
            dConfig.Add("MaxVoipNumbers", MaxVoipNumbers.ToString());
            FeuerwehrCloud.Helper.AppSettings.Save(dConfig, "dyndata/phone.info");

            string ManufacturerName; string ManufacturerOUI; string ModelName; string Description; string ProductClass; string SerialNumber; string SoftwareVersion; string HardwareVersion; string SpecVersion; string ProvisioningCode; uint UpTime; string DeviceLog;

            FritzTR064.Generated.Deviceinfo DevInfo = new Deviceinfo("https://" + NetConfig["Gateway"] + ":" + NetConfig["GW-SSL-Port"]);
            DevInfo.SoapHttpClientProtocol.Credentials = new NetworkCredential(NetConfig["TR064-Username"], NetConfig["FRITZPass"]);
            DevInfo.GetInfo(out ManufacturerName, out ManufacturerOUI, out ModelName, out Description, out ProductClass, out SerialNumber, out SoftwareVersion, out HardwareVersion, out SpecVersion, out ProvisioningCode, out UpTime, out DeviceLog);
            dConfig.Clear();
            dConfig.Add("ManufacturerName", ManufacturerName.ToString());
            dConfig.Add("ManufacturerOUI", ManufacturerOUI.ToString());
            dConfig.Add("ModelName", ModelName.ToString());
            dConfig.Add("Description", Description.ToString());
            dConfig.Add("ProductClass", ProductClass.ToString());
            dConfig.Add("SerialNumber", SerialNumber.ToString());
            dConfig.Add("SoftwareVersion", SoftwareVersion.ToString());
            dConfig.Add("HardwareVersion", HardwareVersion.ToString());
            dConfig.Add("SpecVersion", SpecVersion.ToString());
            dConfig.Add("ProvisioningCode", ProvisioningCode.ToString());
            dConfig.Add("UpTime", UpTime.ToString());
            dConfig.Add("DeviceLog", DeviceLog.ToString());
            FeuerwehrCloud.Helper.AppSettings.Save(dConfig, "dyndata/DeviceInfo.info");


            //FritzTR064.Generated.Contact

            //dConfig.Add("",xxxxxx.ToString());


            System.Diagnostics.Process P;

            P = new System.Diagnostics.Process()
            {
                StartInfo =
                {
                    FileName               = NetConfig ["fing"],
                    Arguments              = " -n " + NetConfig ["Gateway"] + "/24 -r 1 --session " + System.IO.Path.Combine(System.Environment.CurrentDirectory, "network.fing") + " -o table,csv," + System.IO.Path.Combine(System.Environment.CurrentDirectory, "network.csv"),
                    UseShellExecute        = false,
                    CreateNoWindow         = true,
                    RedirectStandardOutput = true
                }
            };
            P.Start();
            P.WaitForExit(10000);


            P = new System.Diagnostics.Process()
            {
                StartInfo =
                {
                    FileName               = "/usr/local/bin/lsusb",
                    WorkingDirectory       = "/tmp/",
                    UseShellExecute        = false,
                    CreateNoWindow         = true,
                    RedirectStandardOutput = true
                }
            };
            P.Start();
            string lsusb    = P.StandardOutput.ReadToEnd();
            int    USBCount = lsusb.Split(new [] { "\n" }, StringSplitOptions.RemoveEmptyEntries).Length;

            P.WaitForExit(10000);
            dConfig.Clear();
            dConfig.Add("Count", USBCount.ToString());
            FeuerwehrCloud.Helper.AppSettings.Save(dConfig, "dyndata/usb.info");

            P = new System.Diagnostics.Process()
            {
                StartInfo =
                {
                    FileName               = "/Users/systemiya-apple/i2cdetect.sh",
                    WorkingDirectory       = "/tmp/",
                    UseShellExecute        = false,
                    CreateNoWindow         = true,
                    RedirectStandardOutput = true
                }
            };
            P.Start();
            string lsi2c = P.StandardOutput.ReadToEnd();

            P.WaitForExit(10000);
            dConfig.Clear();
            string[] i2C      = lsi2c.Split(new [] { "--" }, StringSplitOptions.RemoveEmptyEntries);
            int      I2Ccount = 116 - (i2C.Length - 2);

            dConfig.Add("Count", I2Ccount.ToString());
            FeuerwehrCloud.Helper.AppSettings.Save(dConfig, "dyndata/i2c.info");
        }
Beispiel #16
0
        }                                       // should always be <= 100

        public override string ToString()
        {
            return($"{MacAddress}, {Interface}, {UpTime.ToString().PadLeft(11)}, {TxRateMb.ToString().PadLeft(3)}, {RxRateMb.ToString().PadLeft(3)}, {Info}, " +
                   $"{SignalLeveldB.ToString().PadLeft(2)}, {NoiseLeveldB.ToString().PadLeft(2)}, {SignalToNoiseRatiodB.ToString().PadLeft(2)}, {SignalQuality.ToString().PadLeft(3)}");
        }
Beispiel #17
0
 public string Uptime(string[] args)
 {
     return(UpTime.ToReadableString());
 }
Beispiel #18
0
 private void UpTime(object sender, RoutedEventArgs e)
 {
     DataContext = new UpTime();
 }
Beispiel #19
0
 public string Process(string[] args)
 {
     return(UpTime.ToReadableString());
 }