IPConnection.Connect C# (CSharp) Method

Connect() public method

public Connect ( ) : void
return void
    public void Connect()
    {
        if (NaviMobileManager.Instance.Connect (this.ip))
            UIManager.Instance.LoadGameScene ();
        //TODO: else case to warn user that they cannot connect
    }

Usage Example

    static void Main()
    {
        IPConnection ipcon = new IPConnection(); // Create IP connection
        BrickletCAN can = new BrickletCAN(UID, ipcon); // Create device object

        ipcon.Connect(HOST, PORT); // Connect to brickd
        // Don't use device before ipcon is connected

        // Configure transceiver for loopback mode
        can.SetConfiguration(BrickletCAN.BAUD_RATE_1000KBPS,
                             BrickletCAN.TRANSCEIVER_MODE_LOOPBACK, 0);

        // Register frame read callback to function FrameReadCB
        can.FrameRead += FrameReadCB;

        // Enable frame read callback
        can.EnableFrameReadCallback();

        // Write standard data frame with identifier 1742 and 3 bytes of data
        byte[] data = new byte[8]{42, 23, 17, 0, 0, 0, 0, 0};
        can.WriteFrame(BrickletCAN.FRAME_TYPE_STANDARD_DATA, 1742, data, 3);

        Console.WriteLine("Press enter to exit");
        Console.ReadLine();
        can.DisableFrameReadCallback();
        ipcon.Disconnect();
    }
All Usage Examples Of IPConnection::Connect
IPConnection