Skip to content

Commit 3491510

Browse files
committed
# Conflicts: # src/S7CommPlusDriver/S7CommPlusConnection.cs # src/S7CommPlusDriver/S7CommPlusDriver.csproj # src/S7CommPlusGUIBrowser/Form1.Designer.cs # src/S7CommPlusGUIBrowser/Form1.cs # src/S7CommPlusGUIBrowser/Form1.resx
2 parents b0fad13 + 7cf0a6a commit 3491510

File tree

14 files changed

+2905
-2570
lines changed

14 files changed

+2905
-2570
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 = "10.0.98.100";
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
@@ -41,6 +41,7 @@ public static class Ids
4141
public const int ServerSessionRequest = 303;
4242
public const int ServerSessionResponse = 304;
4343
public const int ServerSessionVersion = 306;
44+
public const int LID_SessionVersionSystemPAOMString = 319;
4445
public const int ClassTypeInfo = 511;
4546
public const int ClassOMSTypeInfoContainer = 534;
4647
public const int ObjectOMSTypeInfoContainer = 537;
@@ -54,6 +55,7 @@ public static class Ids
5455
public const int SystemLimits = 1037;
5556
public const int SubscriptionRouteMode = 1040;
5657
public const int SubscriptionActive = 1041;
58+
public const int Legitimate = 1846;
5759
public const int SubscriptionReferenceList = 1048;
5860
public const int SubscriptionCycleTime = 1049;
5961
public const int SubscriptionDelayTime = 1050;
@@ -148,6 +150,10 @@ public static class Ids
148150
public const int AlarmSubscriptionRef_AlarmTextLanguages_Rid = 8181;
149151
public const int AlarmSubscriptionRef_SendAlarmTexts_Rid = 8173;
150152
public const int ReturnValue = 40305;
153+
public const int LID_LegitimationPayloadStruct = 40400;
154+
public const int LID_LegitimationPayloadType = 40401;
155+
public const int LID_LegitimationPayloadUsername = 40402;
156+
public const int LID_LegitimationPayloadPassword = 40403;
151157

152158
public const uint ReleaseMngmtRoot_Rid = 2303328256;
153159

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)