/// <summary>
 /// <para>Constructor.</para>
 /// </summary>
 /// <remarks>
 /// <para>Introduced with v2.0 of the framework.</para>
 /// </remarks>
 /// <param name="commLinkType">Indicates whether Bluetooth or USB should be used for the communication with the NXT brick.</param>
 /// <param name="serialPortNo">The COM port used. Only relevant for Bluetooth links.</param>
 public NxtBrick(NxtCommLinkType commLinkType, byte serialPortNo)
     : this()
 {
     switch (commLinkType)
     {
         case NxtCommLinkType.Bluetooth:
             CommLink = new NxtBluetoothConnection(serialPortNo);
             break;
         case NxtCommLinkType.USB:
             CommLink = new NxtUsbConnection();
             break;
         default:
             throw new ArgumentException("Unknown commLinkType.");
     }
 }
Example #2
0
        /// <summary>
        /// <para>Constructor.</para>
        /// </summary>
        /// <remarks>
        /// <para>Introduced with v2.0 of the framework.</para>
        /// </remarks>
        /// <param name="commLinkType">Indicates whether Bluetooth or USB should be used for the communication with the NXT brick.</param>
        /// <param name="serialPortNo">The COM port used. Only relevant for Bluetooth links.</param>
        public NxtBrick(NxtCommLinkType commLinkType, byte serialPortNo)
            : this()
        {
            switch (commLinkType)
            {
            case NxtCommLinkType.Bluetooth:
                CommLink = new NxtBluetoothConnection(serialPortNo);
                break;

            case NxtCommLinkType.USB:
                CommLink = new NxtUsbConnection();
                break;

            default:
                throw new ArgumentException("Unknown commLinkType.");
            }
        }
Example #3
0
 public NxtBrick(string serialPortName)
     : this()
 {
     CommLink = new NxtBluetoothConnection(serialPortName);
 }
Example #4
0
 public NxtBrick(byte serialPortNo)
     : this()
 {
     CommLink = new NxtBluetoothConnection(serialPortNo);
 }
 public NxtBrick(string serialPortName)
     : this()
 {
     CommLink = new NxtBluetoothConnection(serialPortName);
 }
 public NxtBrick(byte serialPortNo)
     : this()
 {
     CommLink = new NxtBluetoothConnection(serialPortNo);
 }