AForge.Robotics.Lego.NXTBrick.SetBrickName C# (CSharp) Метод

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

Set name of NXT device.
public SetBrickName ( string deviceName ) : bool
deviceName string Device name to set for the brick.
Результат bool
        public bool SetBrickName( string deviceName )
        {
            byte[] command = new byte[18];

            // prepare message
            command[0] = (byte) NXTCommandType.SystemCommand;
            command[1] = (byte) NXTSystemCommand.SetBrickName;
            // convert string to bytes
            System.Text.ASCIIEncoding.ASCII.GetBytes( deviceName, 0, Math.Min( deviceName.Length, 14 ), command, 2 );

            return SendCommand( command, new byte[3] );
        }