Пример #1
0
 /// <summary>
 /// AdsClient Constructor
 /// This can be used if you wan't to use your own IAmsSocket implementation.
 /// </summary>
 /// <param name="amsSocket">Your own IAmsSocket implementation</param>
 /// <param name="amsNetIdSource">
 /// The AmsNetId of this device. You can choose something in the form of x.x.x.x.x.x
 /// You have to define this ID in combination with the IP as a route on the target Ads device
 /// </param>
 /// <param name="amsNetIdTarget">The AmsNetId of the target Ads device</param>
 /// <param name="amsPortTarget">Ams port. Default 801</param>
 public AdsClient(string amsNetIdSource, IAmsSocket amsSocket, string amsNetIdTarget, ushort amsPortTarget = 801)
 {
     ams = new Ams(amsSocket);
     ams.AmsNetIdSource = new AmsNetId(amsNetIdSource);
     ams.AmsNetIdTarget = new AmsNetId(amsNetIdTarget);
     ams.AmsPortTarget  = amsPortTarget;
 }
Пример #2
0
 /// <summary>
 /// AdsClient Constructor
 /// </summary>
 /// <param name="settings">The connection settings</param>
 public AdsClient(IAdsConnectionSettings settings)
 {
     ams = new Ams(settings.AmsSocket);
     ams.AmsNetIdSource = new AmsNetId(settings.AmsNetIdSource);
     ams.AmsNetIdTarget = new AmsNetId(settings.AmsNetIdTarget);
     ams.AmsPortTarget  = settings.AmsPortTarget;
     this.Name          = settings.Name;
 }