Esempio n. 1
0
        /// <summary>
        /// Gets the version.
        /// </summary>
        /// <returns>The version.</returns>
        public DVRPTRVersion GetVersion()
        {
            DVRPTRVersion version = null;

            GetVersionAnswerPacket versionAnswerPacket = SendCommandAndWaitForAnswer <GetVersionAnswerPacket>(new GetVersionPacket());

            version = DVRPTRVersion.FromPacket(versionAnswerPacket);

            return(version);
        }
Esempio n. 2
0
        /// <summary>
        /// Open this instance.
        /// </summary>
        /// <exception cref="DVRPTRException">Failed to communicate with board</exception>
        /// <exception cref="DVRPTRVersionException">Unsuported FW version</exception>
        public void Open()
        {
            _dvrptrIO.Open();
            if (IsOpen)
            {
                DVRPTRVersion boardVersion = this.GetVersion();

                if (boardVersion < _minSupportedVersion)
                {
                    throw new DVRPTRVersionException(_minSupportedVersion, boardVersion);
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OpenCC.DVRPTRLib.DVRPTRVersionException"/> class.
 /// </summary>
 /// <param name="expected">Expected.</param>
 /// <param name="actual">Actual.</param>
 public DVRPTRVersionException(DVRPTRVersion expected, DVRPTRVersion actual)
     : this(string.Format("This version of the library supports version {0} of the firmware. Board has version {1}", expected, actual))
 {
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes the <see cref="OpenCC.DVRPTRLib.DVRPTR"/> class.
 /// </summary>
 static DVRPTR()
 {
     _minSupportedVersion = new DVRPTRVersion(1, 6, 9, 'b', "DV-RPTR R.2012-08-08");//1.69b DV-RPTR R.2012-08-08
 }