Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #16 from nanosonde/devel
Browse files Browse the repository at this point in the history
Merge KNX-RF support in devel branch and add secure support
  • Loading branch information
thelsing authored Jul 7, 2020
2 parents 802fbd2 + 3ac7140 commit ec975ee
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1 deletion.
10 changes: 10 additions & 0 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Margin="3" Text="{lex:Loc Name}" Grid.Column="1" Grid.Row="0"/>
Expand All @@ -75,9 +78,16 @@
<ComboBox Margin="3" SelectedValuePath="Tag" SelectedValue="{Binding MediumType, UpdateSourceTrigger=PropertyChanged}" Grid.Column="2" Grid.Row="8" Width="200">
<ComboBoxItem Content="{lex:Loc IP}" Tag="MT-5"/>
<ComboBoxItem Content="{lex:Loc TP}" Tag="MT-0"/>
<ComboBoxItem Content="{lex:Loc RF}" Tag="MT-2"/>
</ComboBox>
<TextBlock Margin="3" Text="{lex:Loc ReplacedVersion}" Grid.Column="1" Grid.Row="9"/>
<TextBox Margin="3" Grid.Column="2" Grid.Row="9" Text="{Binding ReplacedVersions}" />
<TextBlock Margin="3" Text="{lex:Loc IsSecureEnabled}" Grid.Column="1" Grid.Row="10"/>
<CheckBox Margin="3" Grid.Column="2" Grid.Row="10" IsChecked="{Binding IsSecureEnabled}"/>
<TextBlock Margin="3" Text="{lex:Loc MaxSecurityIndividualAddressEntries}" Grid.Column="1" Grid.Row="11"/>
<TextBox Margin="3" Text="{Binding MaxSecurityIndividualAddressEntries, UpdateSourceTrigger=PropertyChanged}" Grid.Column="2" Grid.Row="11" Width="200"/>
<TextBlock Margin="3" Text="{lex:Loc MaxSecurityGroupKeyTableEntries}" Grid.Column="1" Grid.Row="12"/>
<TextBox Margin="3" Text="{Binding MaxSecurityGroupKeyTableEntries, UpdateSourceTrigger=PropertyChanged}" Grid.Column="2" Grid.Row="12" Width="200"/>
</Grid>
</TabItem>
<TabItem Header="{lex:Loc ParameterTypes}">
Expand Down
65 changes: 64 additions & 1 deletion MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ private void UpdateMediumInfo()
_hardware.IsIPEnabled = true;
_hardware.BusCurrent = null;
}
else if (_hardware2Program.MediumTypes[0] == "MT-2")
{
_applicationProgram.MaskVersion = "MV-27B0";
_hardware.IsIPEnabled = false;
_hardware.BusCurrent = null;
}
else
{
_applicationProgram.MaskVersion = "MV-07B0";
Expand Down Expand Up @@ -442,7 +448,9 @@ private void CreateNew(object param)
_applicationProgram.DefaultLanguage = lang;
_applicationProgram.DynamicTableManagement = false;
_applicationProgram.Linkable = false;
_applicationProgram.MinEtsVersion = "4.0";
_applicationProgram.MinEtsVersion = "5.0";
_applicationProgram.MaxSecurityIndividualAddressEntries = 32;
_applicationProgram.MaxSecurityGroupKeyTableEntries = 50;

var appStatic = new ApplicationProgramStatic_T();
_applicationProgram.Static = appStatic;
Expand Down Expand Up @@ -477,6 +485,7 @@ private void CreateNew(object param)
OrderNumber = "0";

_hardware2Program.MediumTypes.Add("MT-5");
_hardware2Program.MediumTypes.Add("MT-2");

_catalogSection.Name = Ressources.Devices;
_catalogSection.Number = "1";
Expand Down Expand Up @@ -699,6 +708,9 @@ private void RaiseChanged()
RaisePropertyChanged(nameof(ComObjects));
RaisePropertyChanged(nameof(MediumType));
RaisePropertyChanged(nameof(ReplacedVersions));
RaisePropertyChanged(nameof(IsSecureEnabled));
RaisePropertyChanged(nameof(MaxSecurityIndividualAddressEntries));
RaisePropertyChanged(nameof(MaxSecurityGroupKeyTableEntries));
}

#region Properties
Expand Down Expand Up @@ -837,6 +849,57 @@ public string ReplacedVersions
}
}

public bool IsSecureEnabled
{
get
{
if (_applicationProgram == null)
return false;

return _applicationProgram.IsSecureEnabled;
}
set
{
_applicationProgram.IsSecureEnabled = value;

RaisePropertyChanged(nameof(IsSecureEnabled));
}
}

public ushort MaxSecurityIndividualAddressEntries
{
get
{
if (_applicationProgram == null)
return 0;

return _applicationProgram.MaxSecurityIndividualAddressEntries;
}
set
{
_applicationProgram.MaxSecurityIndividualAddressEntries = value;

RaisePropertyChanged(nameof(MaxSecurityIndividualAddressEntries));
}
}

public ushort MaxSecurityGroupKeyTableEntries
{
get
{
if (_applicationProgram == null)
return 0;

return _applicationProgram.MaxSecurityGroupKeyTableEntries;
}
set
{
_applicationProgram.MaxSecurityIndividualAddressEntries = value;

RaisePropertyChanged(nameof(MaxSecurityGroupKeyTableEntries));
}
}

public ObservableCollection<ParameterType_T> ParameterTypes
{
get => _applicationProgram?.Static?.ParameterTypes;
Expand Down
12 changes: 12 additions & 0 deletions Properties/Ressources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,16 @@
<data name="ReplacedVersion" xml:space="preserve">
<value>ReplacedVersion</value>
</data>
<data name="RF" xml:space="preserve">
<value>RF</value>
</data>
<data name="IsSecureEnabled" xml:space="preserve">
<value>Enable data security</value>
</data>
<data name="MaxSecurityGroupKeyTableEntries" xml:space="preserve">
<value>Max SecurityGroupKeyTable Entries</value>
</data>
<data name="MaxSecurityIndividualAddressEntries" xml:space="preserve">
<value>Max SecurityIndividualAddress Entries</value>
</data>
</root>

0 comments on commit ec975ee

Please sign in to comment.