AForge.Robotics.Lego.RCXBrick.GetVersion C# (CSharp) Метод

GetVersion() публичный Метод

Get version information of RCX brick.
public GetVersion ( string &romVersion, string &firmwareVersion ) : bool
romVersion string ROM version number.
firmwareVersion string Firmware version number.
Результат bool
        public bool GetVersion( out string romVersion, out string firmwareVersion )
        {
            byte[] reply = new byte[9];

            if ( SendCommand( new byte[] { (byte) RCXCommand.GetVersions, 1, 3, 5, 7, 11 }, reply, 9 ) )
            {
                romVersion = string.Format( "{0}.{1}",
                    reply[2] | ( reply[1] << 8 ),
                    reply[4] | ( reply[3] << 8 ) );
                firmwareVersion = string.Format( "{0}.{1}",
                    reply[6] | ( reply[5] << 8 ),
                    reply[8] | ( reply[7] << 8 ) );
                return true;
            }

            romVersion = null;
            firmwareVersion = null;

            return false;
        }