Skip to content

Commit 7cf0a6a

Browse files
authored
Merge pull request thomas-v2#58 from Ich-Eben/legitimation
New Legitimation
2 parents 76ca5e7 + cdaad8a commit 7cf0a6a

File tree

15 files changed

+565
-182
lines changed

15 files changed

+565
-182
lines changed

src/DriverTest/Program.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ static void Main(string[] args)
1616
{
1717
string HostIp = "192.168.1.30";
1818
string Password = "";
19+
string Username = "";
1920
int res;
2021
List<ItemAddress> readlist = new List<ItemAddress>();
2122
Console.WriteLine("Main - START");
@@ -29,10 +30,15 @@ static void Main(string[] args)
2930
{
3031
Password = args[1];
3132
}
33+
// Als Parameter lässt sich der Username übergeben, sonst Default-Wert von oben (kein Username)
34+
if (args.Length >= 3)
35+
{
36+
Username = args[2];
37+
}
3238
Console.WriteLine("Main - Versuche Verbindungsaufbau zu: " + HostIp);
3339

3440
S7CommPlusConnection conn = new S7CommPlusConnection();
35-
res = conn.Connect(HostIp, Password);
41+
res = conn.Connect(HostIp, Password, Username);
3642
if (res == 0)
3743
{
3844
Console.WriteLine("Main - Connect fertig");

src/S7CommPlusDriver/Core/Ids.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static class Ids
3838
public const int ServerSessionRequest = 303;
3939
public const int ServerSessionResponse = 304;
4040
public const int ServerSessionVersion = 306;
41+
public const int LID_SessionVersionSystemPAOMString = 319;
4142
public const int ClassTypeInfo = 511;
4243
public const int ClassOMSTypeInfoContainer = 534;
4344
public const int ObjectOMSTypeInfoContainer = 537;
@@ -51,6 +52,7 @@ public static class Ids
5152
public const int SystemLimits = 1037;
5253
public const int SubscriptionRouteMode = 1040;
5354
public const int SubscriptionActive = 1041;
55+
public const int Legitimate = 1846;
5456
public const int SubscriptionReferenceList = 1048;
5557
public const int SubscriptionCycleTime = 1049;
5658
public const int SubscriptionDelayTime = 1050;
@@ -107,6 +109,10 @@ public static class Ids
107109
public const int AlarmSubscriptionRef_AlarmTextLanguages_Rid = 8181;
108110
public const int AlarmSubscriptionRef_SendAlarmTexts_Rid = 8173;
109111
public const int ReturnValue = 40305;
112+
public const int LID_LegitimationPayloadStruct = 40400;
113+
public const int LID_LegitimationPayloadType = 40401;
114+
public const int LID_LegitimationPayloadUsername = 40402;
115+
public const int LID_LegitimationPayloadPassword = 40403;
110116

111117
public const int TI_BOOL = 0x02000000 + 1;
112118
public const int TI_BYTE = 0x02000000 + 2;

src/S7CommPlusDriver/Core/AccessLevel.cs renamed to src/S7CommPlusDriver/Legitimation/AccessLevel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
using System.Text;
55
using System.Threading.Tasks;
66

7-
namespace S7CommPlusDriver.Core {
8-
public static class AccessLevel {
7+
namespace S7CommPlusDriver.Legitimation
8+
{
9+
public static class AccessLevel
10+
{
911
public const UInt32 FullAccess = 1;
1012
public const UInt32 ReadAccess = 2;
1113
public const UInt32 HMIAccess = 3;

0 commit comments

Comments
 (0)