Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

One USB Receiver - Multiple Applications

Rank

Total Posts: 1

Joined 2018-11-04

PM

Hello,
I am new to ant development. So far I have been able to successfully create a simple application (lets call this Application1) to read data from a ant+ heart rate monitor.

The HRM data is being received by a ant+ USB receiver that is plugged into my machine.

However, I have a second application (lets call this Application2) which also needs to read the HRM data at the same time as Application1.

It is possible for Application1 and Application2 to share the same USB receiver?

I have tested this but whatever Application connects to the USB receiver first, appears to lock the USB receiver and prevents the other Application from accessing the USB receiver at the same time.

I am writing this in C# using ANT_NET.dll. I am detecting the USB receiver the new ANT_Device() constructor which I believe connects to the first available device.

Any help would be greatly appreciated.

Thanks      
Rank

Total Posts: 2

Joined 2015-09-28

PM

It seems this forum as is dead and no one replies to anything.

In any case I can't give you the official answer, but from my experience, no you can't share the device unless you can close the device and reopen it in each application and ensure there are no collisions. I suppose you could create a client/server model and have both applications connect to the server that handles the ANT+ communication, but that is making things fairly complex just to save on getting a second ANT+ dongle.      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi,

The application will take full control of the single USB endpoint, which will prevent other applications from accessing the device.

ANT on Android does allow for multiple userspace applications to access the same USB stick, but it exposes a wholly different interface based upon a ChannelProvider to address contentions with applications being able to configure whole-chip settings.

Cheers