protected override void AdsResponseIsChanged()
 {
     adsDeviceInfo = new AdsDeviceInfo();
     adsDeviceInfo.MajorVersion = this.AdsResponse[4];
     adsDeviceInfo.MinorVersion = this.AdsResponse[5];
     adsDeviceInfo.VersionBuild = BitConverter.ToUInt16(this.AdsResponse, 6);
     var deviceNameArray = new byte[16];
     Array.Copy(this.AdsResponse, 8, deviceNameArray, 0, 16);
     adsDeviceInfo.DeviceName = ByteArrayHelper.ByteArrayToString(deviceNameArray);
 }
Exemple #2
0
        /// <summary>
        /// Get some information of the ADS device (version, name)
        /// </summary>
        /// <returns></returns>
        public new AdsDeviceInfo ReadDeviceInfo()
        {
            AdsDeviceInfo result = new AdsDeviceInfo();

            deviceInfo = client.ReadDeviceInfo();

            result.DeviceName = deviceInfo.Name;
            result.MajorVersion = deviceInfo.Version.Version;
            result.MinorVersion = deviceInfo.Version.Revision;
            result.VersionBuild = (ushort)deviceInfo.Version.Build;

            return result;
        }