nxtlib/src/Connect/USB.cs
/// <summary>
/// <para>Search for bricks connected via USB.</para>
/// </summary>
/// <returns>A list of brick information (returns max 1 brick!).</returns>
Search for bricks connected via USB.
Search for bricks connected via USB .
public override List<Brick> Search()
        {
            List<Brick> list = new List<Brick>();
            if (IsConnected)
            {
                BrickInfo _brick = new BrickInfo();
                _brick.address = new byte[6] { 0, 0, 0, 0, 0, 0 };
                _brick.name = "NXT";
                GetDeviceInfoReply reply = GetDeviceInfo();
                _brick.address = reply.Address;
                _brick.name = reply.Name;
                Brick brick = new Brick(this, _brick);
                list.Add(brick);
            }
            else { throw new NXTNoBricksFound(); }
            return list;
        }
public override List < Brick > Search ( ) { List < Brick > list = new List < Brick > ( ) ; if ( IsConnected ) { BrickInfo _brick = new BrickInfo ( ) ; _brick . address = new byte [ 6 ] { 0 , 0 , 0 , 0 , 0 , 0 } ; _brick . name = " " ; GetDeviceInfoReply reply = GetDeviceInfo ( ) ; _brick . address = reply . Address ; _brick . name = reply . Name ; Brick brick = new Brick ( this , _brick ) ; list . Add ( brick ) ; } else { throw new NXTNoBricksFound ( ) ; } return list ; }
Search for bricks connected via USB.
Search for bricks connected via USB .
A list of brick information (returns max 1 brick!).
A list of brick information ( returns max 1 brick! ) .