MxLabs / Anviz

.NET library to access and control Anviz devices.
MIT License
33 stars 17 forks source link

Connect to t5\w2 pro #57

Closed AKotoff closed 3 years ago

AKotoff commented 3 years ago

Hi, Please help me figure it out. I trying to connect to two devices (t5 PRO and W2 PRO), as in example. In case t5 pro, visual studio throws me an exception - "Device connection lost", and in case w2 pro, visual studio throws me an exception - "Device timeout waiting response.". I trying connect with code:

    private const string DEVICE_HOST = "10.10.3.3";
    private const int DEVICE_PORT = 5010;
    static async Task Main(string[] args)
    {
        var manager = new AnvizManager();

if true //authenticate with device password

        manager.ConnectionUser = "admin";
        manager.ConnectionPassword = "12345";
        manager.AuthenticateConnection = true;

endif

if false //false for client mode

        manager.Listen();
        Console.WriteLine($"Listening on port 5010");
        using (var device = await manager.Accept())

else

        using (var device = await manager.Connect(DEVICE_HOST))

endif

        {
            device.DevicePing += (s, e) => Console.WriteLine("Device Ping Received");
        }

Sorry if my question seems stupid.

AKotoff commented 3 years ago

Hi, question is not actual. I was solved the task with original SDK