You are here: Forum Home → ANT Developers Forums → ANT General Questions → Thread
13 June 2016 05:40 PM
Dynastream Developer
15 June 2016 06:49 PM #1
15 June 2016 08:08 PM #2
For standard Windows UWP (Development Only!! because there are no signed UWP drivers):
16 June 2016 03:11 PM #3
Dynastream Developer
16 June 2016 03:15 PM #4
16 June 2016 04:21 PM #5
Dynastream Developer
16 June 2016 04:34 PM #6
22 June 2016 01:56 PM #7
22 June 2016 02:02 PM #8
Dynastream Developer
24 July 2016 05:42 AM #9
24 July 2016 02:24 PM #10
<!-- ANT USB-m Stick-->
<DeviceCapability Name="usb">
<Device Id="vidpid:0FCF 1009">
<Function Type="name:vendorSpecific" />
</Device>
</DeviceCapability>
25 July 2016 03:50 PM #11
I have a plan to develop the headless mode app. So that maybe the next test. Maybe I will try to connect 2 ANT dongle too 1 RPi at a time. But I didn't have a real use case for multi-dongle now.
ANT_Device ant1 = new ANT_Device()
ANT_Device ant2 = new ANT_Device()
static int opennedDevicesNum = 0;
antDevice = new ANT_Device((byte)opennedDevicesNum++, (uint)57600);
27 July 2016 08:58 AM #12
hisoft - 25 July 2016 03:50 PMI short update about those 2 test I post before.
I have a plan to develop the headless mode app. So that maybe the next test. Maybe I will try to connect 2 ANT dongle too 1 RPi at a time. But I didn't have a real use case for multi-dongle now.
I create all new UWP ANT+ headless app and it work fine. It also support multi-dongle too but there some problem. With the first dongle you can just use this code.
ANT_Device ant1 = new ANT_Device()
but it will crash when you call this one after the first.
ANT_Device ant2 = new ANT_Device()
I didn't remember if I ever use multi-dongle in one app on my old .net code. But it work with multi-app for sure.
There was some workaround about this problem for now. Maybe you can use try-catch to fix it. But I chose this code.
static int opennedDevicesNum = 0;
antDevice = new ANT_Device((byte)opennedDevicesNum++, (uint)57600);
With this code you can just create any number of ANT_Device. But you have to make sure there is none other headless app (and, if you app was headless app, the running headed app) using ANT dongle run in the same time. With that maybe the try-catch will be the last solution.
27 July 2016 09:34 AM #13
michael.ong - 27 July 2016 08:58 AMHi, could you give me some info about this crash when it happens? For instance, there should be some message string embedded in the ANT_Exception class that tells us what failed during the creation of an ANT_Device object. Can you also share with me any exceptions/warnings/errors thrown by your IDE when the multi-dongle code is run? This will be very helpful in resolving the issue/error.
try
{
b1> ANT_Device antDevice1 = new ANT_Device();
b2> ANT_Device antDevice2 = new ANT_Device();
}
catch (Exception e)
{
b3> send(e);
}
catch (Exception e)
{
b4> send(e);
}
The program '[2492] backgroundTaskHost.exe' has exited with code -1073740791 (0xc0000409).
ANT_Device antDevice1 = new ANT_Device((byte)1, (uint)57600);
ANT_Device antDevice2 = new ANT_Device((byte)2, (uint)57600);
ANT_Managed_Library.ANT_Exception: ANTLibrary Exception: Unable to initialize USB:2 at Baud:57600, probably device not present or already in use, or drivers not installed\r\n at ANT_Managed_Library.ANT_Device.startUp(Byte USBDeviceNum, UInt32 baudRate, FramerType frameType, PortType portType, Boolean calledByAutoInit)\r\n at ANT_Managed_Library.ANT_Device..ctor(PortType portType, Byte USBDeviceNum, UInt32 baudRate, FramerType frameType)\r\n at ANT_Managed_Library.ANT_Device..ctor(Byte USBDeviceNum, UInt32 baudRate)\r\n at NetworkANT.Ant..ctor()
27 July 2016 09:58 AM #14
hisoft - 27 July 2016 09:34 AMmichael.ong - 27 July 2016 08:58 AMHi, could you give me some info about this crash when it happens? For instance, there should be some message string embedded in the ANT_Exception class that tells us what failed during the creation of an ANT_Device object. Can you also share with me any exceptions/warnings/errors thrown by your IDE when the multi-dongle code is run? This will be very helpful in resolving the issue/error.
I recreate a crash with this code
try
{
b1> ANT_Device antDevice1 = new ANT_Device();
b2> ANT_Device antDevice2 = new ANT_Device();
}
catch (Exception e)
{
b3> send(e);
}
catch (Exception e)
{
b4> send(e);
}
The app was pause at breakpoint b1 and b2 then it crash with this output in VS.
The program '[2492] backgroundTaskHost.exe' has exited with code -1073740791 (0xc0000409).
It didn't break at b3 or even b4. It just close itself. And it work fine when I change a code to this.
ANT_Device antDevice1 = new ANT_Device((byte)1, (uint)57600);
ANT_Device antDevice2 = new ANT_Device((byte)2, (uint)57600);
01 August 2016 03:39 AM #15