private void ServerAddressTypeCB_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                GXServerAddress server = Manufacturer.GetActiveServer();
                server.Selected = false;
                //Save old values.
                UpdateServer(server);

                server          = ((GXServerAddress)ServerAddressTypeCB.SelectedItem);
                server.Selected = true;
                RefreshServer(server);
            }
            catch (Exception Ex)
            {
                GXDLMS.Common.Error.ShowError(this, Ex);
            }
        }
Exemplo n.º 2
0
 private void ManufacturerCB_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         GXManufacturer man = (GXManufacturer)ManufacturerCB.SelectedItem;
         StartProtocolCB.SelectedItem = man.StartProtocol;
         this.ClientAddTB.Value       = Convert.ToDecimal(Convert.ToUInt32(man.GetActiveAuthentication().ClientID));
         AuthenticationCB.Items.Clear();
         foreach (GXAuthentication it in man.Settings)
         {
             int pos = AuthenticationCB.Items.Add(it);
             if (it.Type == Device.Authentication)
             {
                 this.AuthenticationCB.SelectedIndex = pos;
             }
         }
         ServerAddressTypeCB.Items.Clear();
         HDLCAddressType type = Device.HDLCAddressing;
         //If we are creating new device.
         if (Device.Name == null)
         {
             type = man.GetActiveServer().HDLCAddress;
         }
         foreach (GXServerAddress it in ((GXManufacturer)ManufacturerCB.SelectedItem).ServerSettings)
         {
             ServerAddressTypeCB.Items.Add(it);
             if (it.HDLCAddress == type)
             {
                 ServerAddressTypeCB.SelectedItem = it;
             }
         }
         UpdateStartProtocol();
     }
     catch (Exception Ex)
     {
         GXDLMS.Common.Error.ShowError(this, Ex);
     }
 }
        public ManufacturerForm(GXManufacturerCollection manufacturers, GXManufacturer manufacturer)
        {
            InitializeComponent();
            Manufacturers = manufacturers;
            Manufacturer  = manufacturer;
            if (manufacturer.Settings.Count == 0)
            {
                manufacturer.Settings.Add(new GXAuthentication(Gurux.DLMS.Authentication.None, (byte)0x10));
                manufacturer.Settings.Add(new GXAuthentication(Gurux.DLMS.Authentication.Low, (byte)0x11));
                manufacturer.Settings.Add(new GXAuthentication(Gurux.DLMS.Authentication.High, (byte)0x12));
                manufacturer.Settings.Add(new GXAuthentication(Gurux.DLMS.Authentication.HighMD5, (byte)0x13));
                manufacturer.Settings.Add(new GXAuthentication(Gurux.DLMS.Authentication.HighSHA1, (byte)0x14));
                GXAuthentication gmac = new GXAuthentication(Gurux.DLMS.Authentication.HighGMAC, (byte)0x15);
                gmac.BlockCipherKey    = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F };
                gmac.AuthenticationKey = new byte[] { 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF };
                manufacturer.Settings.Add(gmac);
            }
            GXAuthentication authentication = manufacturer.GetActiveAuthentication();

            foreach (GXAuthentication it in manufacturer.Settings)
            {
                AuthenticationCB.Items.Add(it);
            }
            AuthenticationCB.SelectedItem = authentication;
            if (authentication.Type == Gurux.DLMS.Authentication.High ||
                authentication.Type == Gurux.DLMS.Authentication.HighSHA1 ||
                authentication.Type == Gurux.DLMS.Authentication.HighGMAC)
            {
                AdvancedBtn.Enabled = true;
            }
            this.AuthenticationCB.SelectedIndexChanged += new System.EventHandler(this.AuthenticationCB_SelectedIndexChanged);
            if (manufacturer.ServerSettings.Count == 0)
            {
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.Default, (byte)1, true));
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.SerialNumber, (byte)1, false));
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.Custom, (byte)1, false));
            }
            foreach (GXServerAddress it in manufacturer.ServerSettings)
            {
                ServerAddressTypeCB.Items.Add(it);
            }

            ServerAddTypeCB.Items.Add(typeof(byte));
            ServerAddTypeCB.Items.Add(typeof(ushort));
            ServerAddTypeCB.Items.Add(typeof(uint));
            GXServerAddress server = manufacturer.GetActiveServer();

            ServerAddressTypeCB.SelectedItem = server;
            RefreshServer(server);
            this.ServerAddressTypeCB.SelectedIndexChanged += new System.EventHandler(this.ServerAddressTypeCB_SelectedIndexChanged);

            ServerAddressTypeCB.DrawMode = AuthenticationCB.DrawMode = ClientAddTypeCB.DrawMode = ServerAddTypeCB.DrawMode = DrawMode.OwnerDrawFixed;
            ClientAddTypeCB.Items.Add(typeof(byte));
            ClientAddTypeCB.Items.Add(typeof(ushort));
            ClientAddTypeCB.Items.Add(typeof(uint));
            if (authentication.ClientID != null)
            {
                ClientAddTB.Value            = Convert.ToDecimal(authentication.ClientID);
                ClientAddTypeCB.SelectedItem = authentication.ClientID.GetType();
            }
            RefreshAuthentication(authentication);

            InactivityModeCB.Items.Add(InactivityMode.None);
            InactivityModeCB.Items.Add(InactivityMode.KeepAlive);
            InactivityModeCB.Items.Add(InactivityMode.Reopen);
            InactivityModeCB.Items.Add(InactivityMode.ReopenActive);
            InactivityModeCB.Items.Add(InactivityMode.Disconnect);
            StartProtocolCB.Items.Add(StartProtocolType.IEC);
            StartProtocolCB.Items.Add(StartProtocolType.DLMS);
            NameTB.Text                   = manufacturer.Name;
            ManufacturerIdTB.Text         = manufacturer.Identification;
            ForceKeepAliveCB.Checked      = manufacturer.ForceInactivity;
            UseLNCB.Checked               = manufacturer.UseLogicalNameReferencing;
            UseIEC47CB.Checked            = manufacturer.UseIEC47;
            StartProtocolCB.SelectedItem  = manufacturer.StartProtocol;
            InactivityModeCB.SelectedItem = Manufacturer.InactivityMode;
            //Manufacturer ID can not change after creation.
            ManufacturerIdTB.Enabled  = string.IsNullOrEmpty(manufacturer.Identification);
            KeepAliveIntervalTB.Value = Manufacturer.KeepAliveInterval / 1000;
        }
        private void ManufacturerCB_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                GXManufacturer man = (GXManufacturer)ManufacturerCB.SelectedItem;
                StartProtocolCB.SelectedItem = man.StartProtocol;
                this.ClientAddTB.Value       = man.GetActiveAuthentication().ClientAddress;
                AuthenticationCB.Items.Clear();
                foreach (GXAuthentication it in man.Settings)
                {
                    int pos = AuthenticationCB.Items.Add(it);
                    if (it.Type == Device.Authentication)
                    {
                        this.AuthenticationCB.SelectedIndex = pos;
                    }
                }
                ServerAddressTypeCB.Items.Clear();
                HDLCAddressType type = Device.HDLCAddressing;
                //If we are creating new device.
                if (Device.Name == null)
                {
                    type = man.GetActiveServer().HDLCAddress;
                }
                foreach (GXServerAddress it in ((GXManufacturer)ManufacturerCB.SelectedItem).ServerSettings)
                {
                    ServerAddressTypeCB.Items.Add(it);
                    if (it.HDLCAddress == type)
                    {
                        ServerAddressTypeCB.SelectedItem = it;
                    }
                }
                UpdateStartProtocol();

                SecurityCB.SelectedItem = man.Security;
                if (man.SystemTitle != null || man.BlockCipherKey != null ||
                    man.AuthenticationKey != null)
                {
                    SystemTitleTB.Text       = GXCommon.ToHex(man.SystemTitle, true);
                    BlockCipherKeyTB.Text    = GXCommon.ToHex(man.BlockCipherKey, true);
                    AuthenticationKeyTB.Text = GXCommon.ToHex(man.AuthenticationKey, true);
                    if (!DeviceTab.TabPages.Contains(CipheringTab))
                    {
                        DeviceTab.TabPages.Add(CipheringTab);
                        if (DeviceTab.TabPages.Contains(SupportedServicesTab))
                        {
                            DeviceTab.TabPages.Remove(SupportedServicesTab);
                            DeviceTab.TabPages.Add(SupportedServicesTab);
                        }
                    }
                    if (!IsPrintable(man.SystemTitle) ||
                        !IsPrintable(man.BlockCipherKey) ||
                        !IsPrintable(man.AuthenticationKey))
                    {
                        AsciiRB.Enabled = false;
                    }
                    else
                    {
                        AsciiRB.Enabled = true;
                    }
                }
                else if (DeviceTab.TabPages.Contains(CipheringTab))
                {
                    DeviceTab.TabPages.Remove(CipheringTab);
                }
            }
            catch (Exception Ex)
            {
                GXDLMS.Common.Error.ShowError(this, Ex);
            }
        }
Exemplo n.º 5
0
        public ManufacturerForm(GXManufacturerCollection manufacturers, GXManufacturer manufacturer)
        {
            InitializeComponent();
            Manufacturers = manufacturers;
            Manufacturer  = manufacturer;
            if (manufacturer.Settings.Count == 0)
            {
                manufacturer.Settings.Add(new GXAuthentication(Authentication.None, (byte)0x10));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.Low, (byte)0x11));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.High, (byte)0x12));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighMD5, (byte)0x13));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighSHA1, (byte)0x14));
                GXAuthentication gmac = new GXAuthentication(Authentication.HighGMAC, (byte)0x15);
            }
            GXAuthentication authentication = manufacturer.GetActiveAuthentication();

            foreach (GXAuthentication it in manufacturer.Settings)
            {
                AuthenticationCB.Items.Add(it);
            }
            AuthenticationCB.SelectedItem = authentication;
            AdvancedBtn.Enabled           = authentication.Type == Authentication.HighGMAC;
            this.AuthenticationCB.SelectedIndexChanged += new System.EventHandler(this.AuthenticationCB_SelectedIndexChanged);
            if (manufacturer.ServerSettings.Count == 0)
            {
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.Default, (byte)1, true));
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.SerialNumber, (byte)1, false));
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.Custom, (byte)1, false));
            }
            foreach (GXServerAddress it in manufacturer.ServerSettings)
            {
                ServerAddressTypeCB.Items.Add(it);
            }

            GXServerAddress server = manufacturer.GetActiveServer();

            ServerAddressTypeCB.SelectedItem = server;
            RefreshServer(server);
            this.ServerAddressTypeCB.SelectedIndexChanged += new System.EventHandler(this.ServerAddressTypeCB_SelectedIndexChanged);

            ServerAddressTypeCB.DrawMode = AuthenticationCB.DrawMode = DrawMode.OwnerDrawFixed;
            ClientAddTB.Value            = authentication.ClientAddress;

            InactivityModeCB.Items.Add(InactivityMode.None);
            InactivityModeCB.Items.Add(InactivityMode.KeepAlive);
            InactivityModeCB.Items.Add(InactivityMode.Reopen);
            InactivityModeCB.Items.Add(InactivityMode.ReopenActive);
            InactivityModeCB.Items.Add(InactivityMode.Disconnect);
            StartProtocolCB.Items.Add(StartProtocolType.IEC);
            StartProtocolCB.Items.Add(StartProtocolType.DLMS);
            NameTB.Text                   = manufacturer.Name;
            ManufacturerIdTB.Text         = manufacturer.Identification;
            ForceKeepAliveCB.Checked      = manufacturer.ForceInactivity;
            UseLNCB.Checked               = manufacturer.UseLogicalNameReferencing;
            UseIEC47CB.Checked            = manufacturer.UseIEC47;
            StartProtocolCB.SelectedItem  = manufacturer.StartProtocol;
            InactivityModeCB.SelectedItem = Manufacturer.InactivityMode;
            //Manufacturer ID can not change after creation.
            ManufacturerIdTB.Enabled  = string.IsNullOrEmpty(manufacturer.Identification);
            KeepAliveIntervalTB.Value = Manufacturer.KeepAliveInterval / 1000;
            AdvancedBtn.Enabled       = SecuredConnectionCB.Checked = manufacturer.SystemTitle != null;
            WebAddressTB.Text         = Manufacturer.WebAddress;
            if (!string.IsNullOrEmpty(Manufacturer.Info))
            {
                try
                {
                    InfoTB.Text = ASCIIEncoding.UTF8.GetString(Convert.FromBase64String(Manufacturer.Info));
                }
                catch (Exception)
                {
                    InfoTB.Text = "";
                }
            }
        }
Exemplo n.º 6
0
        public ManufacturerForm(GXManufacturerCollection manufacturers, GXManufacturer manufacturer)
        {
            InitializeComponent();
            foreach (object it in Enum.GetValues(typeof(Standard)))
            {
                StandardCb.Items.Add(it);
            }
            StandardCb.SelectedItem = manufacturer.Standard;

            SecurityCB.Items.AddRange(new object[] { Security.None, Security.Authentication,
                                                     Security.Encryption, Security.AuthenticationEncryption });
            Manufacturers = manufacturers;
            Manufacturer  = manufacturer;
            if (manufacturer.Settings.Count == 0)
            {
                manufacturer.Settings.Add(new GXAuthentication(Authentication.None, (byte)0x10));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.Low, (byte)0x11));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.High, (byte)0x12));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighMD5, (byte)0x13));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighSHA1, (byte)0x14));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighGMAC, (byte)0x14));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighSHA256, (byte)0x14));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighECDSA, (byte)0x14));
                GXAuthentication gmac = new GXAuthentication(Authentication.HighGMAC, (byte)0x15);
            }
            GXAuthentication authentication = manufacturer.GetActiveAuthentication();

            foreach (GXAuthentication it in manufacturer.Settings)
            {
                AuthenticationCB.Items.Add(it);
            }
            AuthenticationCB.SelectedItem = authentication;
            this.AuthenticationCB.SelectedIndexChanged += new System.EventHandler(this.AuthenticationCB_SelectedIndexChanged);
            if (manufacturer.ServerSettings.Count == 0)
            {
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.Default, (byte)1, true));
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.SerialNumber, (byte)1, false));
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.Custom, (byte)1, false));
            }
            foreach (GXServerAddress it in manufacturer.ServerSettings)
            {
                ServerAddressTypeCB.Items.Add(it);
            }

            GXServerAddress server = manufacturer.GetActiveServer();

            ServerAddressTypeCB.SelectedItem = server;
            RefreshServer(server);
            this.ServerAddressTypeCB.SelectedIndexChanged += new System.EventHandler(this.ServerAddressTypeCB_SelectedIndexChanged);

            ServerAddressTypeCB.DrawMode = AuthenticationCB.DrawMode = DrawMode.OwnerDrawFixed;
            ClientAddTB.Value            = authentication.ClientAddress;

            StartProtocolCB.Items.Add(StartProtocolType.IEC);
            StartProtocolCB.Items.Add(StartProtocolType.DLMS);
            NameTB.Text                  = manufacturer.Name;
            ManufacturerIdTB.Text        = manufacturer.Identification;
            UseLNCB.Checked              = manufacturer.UseLogicalNameReferencing;
            UseIEC47CB.Checked           = manufacturer.UseIEC47;
            StartProtocolCB.SelectedItem = manufacturer.StartProtocol;
            //Manufacturer ID can not change after creation.
            ManufacturerIdTB.Enabled = string.IsNullOrEmpty(manufacturer.Identification);
            WebAddressTB.Text        = Manufacturer.WebAddress;
            if (!string.IsNullOrEmpty(Manufacturer.Info))
            {
                try
                {
                    InfoTB.Text = ASCIIEncoding.UTF8.GetString(Convert.FromBase64String(Manufacturer.Info));
                }
                catch (Exception)
                {
                    InfoTB.Text = "";
                }
            }
            SecurityCB.SelectedItem = manufacturer.Security;
            if (DevicePropertiesForm.IsAscii(manufacturer.SystemTitle))
            {
                SystemTitleAsciiCb.Checked = true;
                SystemTitleTB.Text         = ASCIIEncoding.ASCII.GetString((manufacturer.SystemTitle));
            }
            else
            {
                SystemTitleTB.Text = GXCommon.ToHex(manufacturer.SystemTitle, true);
            }
            if (DevicePropertiesForm.IsAscii(manufacturer.BlockCipherKey))
            {
                BlockCipherKeyAsciiCb.Checked = true;
                BlockCipherKeyTB.Text         = ASCIIEncoding.ASCII.GetString(manufacturer.BlockCipherKey);
            }
            else
            {
                BlockCipherKeyTB.Text = GXCommon.ToHex(manufacturer.BlockCipherKey, true);
            }
            if (DevicePropertiesForm.IsAscii(manufacturer.AuthenticationKey))
            {
                AuthenticationKeyAsciiCb.Checked = true;
                AuthenticationKeyTB.Text         = ASCIIEncoding.ASCII.GetString(manufacturer.AuthenticationKey);
            }
            else
            {
                AuthenticationKeyTB.Text = GXCommon.ToHex(manufacturer.AuthenticationKey, true);
            }
        }
Exemplo n.º 7
0
        public ManufacturerForm(GXManufacturerCollection manufacturers, GXManufacturer manufacturer)
        {
            InitializeComponent();
#if !GURUX_LPWAN
            LpWanCb.Visible = WiSunCb.Visible = false;
#endif //GURUX_LPWAN
            foreach (object it in Enum.GetValues(typeof(Standard)))
            {
                StandardCb.Items.Add(it);
            }
            StandardCb.SelectedItem = manufacturer.Standard;

            SecurityCB.Items.AddRange(new object[] { Security.None, Security.Authentication,
                                                     Security.Encryption, Security.AuthenticationEncryption });
            Manufacturers = manufacturers;
            Manufacturer  = manufacturer;
            if (manufacturer.Settings.Count == 0)
            {
                manufacturer.Settings.Add(new GXAuthentication(Authentication.None, (byte)0x10));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.Low, (byte)0x11));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.High, (byte)0x12));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighMD5, (byte)0x13));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighSHA1, (byte)0x14));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighGMAC, (byte)0x14));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighSHA256, (byte)0x14));
                manufacturer.Settings.Add(new GXAuthentication(Authentication.HighECDSA, (byte)0x14));
                GXAuthentication gmac = new GXAuthentication(Authentication.HighGMAC, (byte)0x15);
            }
            GXAuthentication authentication = manufacturer.GetActiveAuthentication();
            foreach (GXAuthentication it in manufacturer.Settings)
            {
                AuthenticationCB.Items.Add(it);
            }
            AuthenticationCB.SelectedItem = authentication;
            this.AuthenticationCB.SelectedIndexChanged += new System.EventHandler(this.AuthenticationCB_SelectedIndexChanged);
            if (manufacturer.ServerSettings.Count == 0)
            {
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.Default, (byte)1, true));
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.SerialNumber, (byte)1, false));
                manufacturer.ServerSettings.Add(new GXServerAddress(HDLCAddressType.Custom, (byte)1, false));
            }
            foreach (GXServerAddress it in manufacturer.ServerSettings)
            {
                ServerAddressTypeCB.Items.Add(it);
            }

            GXServerAddress server = manufacturer.GetActiveServer();
            ServerAddressTypeCB.SelectedItem = server;
            RefreshServer(server);
            this.ServerAddressTypeCB.SelectedIndexChanged += new System.EventHandler(this.ServerAddressTypeCB_SelectedIndexChanged);

            ServerAddressTypeCB.DrawMode = AuthenticationCB.DrawMode = DrawMode.OwnerDrawFixed;
            ClientAddTB.Value            = authentication.ClientAddress;
            NameTB.Text           = manufacturer.Name;
            ManufacturerIdTB.Text = manufacturer.Identification;
            UseLNCB.Checked       = manufacturer.UseLogicalNameReferencing;
            //Manufacturer ID can not change after creation.
            ManufacturerIdTB.Enabled = string.IsNullOrEmpty(manufacturer.Identification);
            WebAddressTB.Text        = Manufacturer.WebAddress;
            if (!string.IsNullOrEmpty(Manufacturer.Info))
            {
                try
                {
                    InfoTB.Text = ASCIIEncoding.UTF8.GetString(Convert.FromBase64String(Manufacturer.Info));
                }
                catch (Exception)
                {
                    InfoTB.Text = "";
                }
            }
            SecurityCB.SelectedItem = manufacturer.Security;
            if (DevicePropertiesForm.IsAscii(manufacturer.SystemTitle))
            {
                SystemTitleAsciiCb.Checked = true;
                SystemTitleTB.Text         = ASCIIEncoding.ASCII.GetString((manufacturer.SystemTitle));
            }
            else
            {
                SystemTitleTB.Text = GXCommon.ToHex(manufacturer.SystemTitle, true);
            }
            if (DevicePropertiesForm.IsAscii(manufacturer.BlockCipherKey))
            {
                BlockCipherKeyAsciiCb.Checked = true;
                BlockCipherKeyTB.Text         = ASCIIEncoding.ASCII.GetString(manufacturer.BlockCipherKey);
            }
            else
            {
                BlockCipherKeyTB.Text = GXCommon.ToHex(manufacturer.BlockCipherKey, true);
            }
            if (DevicePropertiesForm.IsAscii(manufacturer.AuthenticationKey))
            {
                AuthenticationKeyAsciiCb.Checked = true;
                AuthenticationKeyTB.Text         = ASCIIEncoding.ASCII.GetString(manufacturer.AuthenticationKey);
            }
            else
            {
                AuthenticationKeyTB.Text = GXCommon.ToHex(manufacturer.AuthenticationKey, true);
            }
            UseUtcTimeZone.Checked = manufacturer.UtcTimeZone;
            if (manufacturer.SupporterdInterfaces != 0)
            {
                HdlcCb.Checked          = (manufacturer.SupporterdInterfaces & (1 << (int)InterfaceType.HDLC)) != 0;
                HdlcWithModeECb.Checked = (manufacturer.SupporterdInterfaces & (1 << (int)InterfaceType.HdlcWithModeE)) != 0;
                WrapperCb.Checked       = (manufacturer.SupporterdInterfaces & (1 << (int)InterfaceType.WRAPPER)) != 0;
                WirelessMBusCb.Checked  = (manufacturer.SupporterdInterfaces & (1 << (int)InterfaceType.WirelessMBus)) != 0;
                PlcCb.Checked           = (manufacturer.SupporterdInterfaces & (1 << (int)InterfaceType.Plc)) != 0;
                PlcHdlcCb.Checked       = (manufacturer.SupporterdInterfaces & (1 << (int)InterfaceType.PlcHdlc)) != 0;
                LpWanCb.Checked         = (manufacturer.SupporterdInterfaces & (1 << (int)InterfaceType.LPWAN)) != 0;
                WiSunCb.Checked         = (manufacturer.SupporterdInterfaces & (1 << (int)InterfaceType.WiSUN)) != 0;
            }
            else
            {
                //Select default interfaces.
                HdlcCb.Checked = HdlcWithModeECb.Checked = WrapperCb.Checked = true;
            }
        }