Home/Support/Support Forum/Why is my ConnectionStatus works but the Connect and Disconnect not?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Why is my ConnectionStatus works but the Connect and Disconnect not?

0 votes
Greatings! I have a problem with using the AwUsbApi. I tried to create a c# windows form app where i can control the AnywhereUsb/14. I use the v3.99.350 dll provided by the driver. I was able to use the ConnectionStatus function, which works perfectly, but the Connect and Disconnect doesn't. I implemented all three the same way. Could you help me what is the problem with my solution? I attach my relevant part of my code. First the three DLL function import, after that the three call. Thank you for the help!

[DllImport("AwUsbApi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern AWUSB_STATUS AwUsbConnect(string hub, out uint status, int timeout, IntPtr handler);

[DllImport("AwUsbApi.dll", CharSet = CharSet.Unicode)]
private static extern AWUSB_STATUS AwUsbDisconnect(string hub);

[DllImport("AwUsbApi.dll", CharSet = CharSet.Unicode)]
private static extern AWUSB_STATUS AwUsbGetConnectionStatus(string hub, out int ipAddress, out int status, int timeout, IntPtr handler);

var c_return = AwUsbConnect(IP, out uint result, 10000, IntPtr.Zero);
var dc_return = AwUsbDisconnect(IP);
var cs_return = AwUsbGetConnectionStatus(IP, out int ipadress, out int status, 10000,
IntPtr.Zero);
asked Feb 3 in USB Serial by tamadi New to the Community (0 points)

Please log in or register to answer this question.

...