Package com.dsi.ant.channel
Class AntAdapterProvider
java.lang.Object
com.dsi.ant.channel.AntAdapterProvider
The adapter provider provides
AdapterInfo
to allow apps to retrieve information about
the underlying hardware. In turn, the AdapterInfo
objects can be used to acquire
channels from its associated adapter.- Since:
- 4.7.2
-
Constructor Summary
ConstructorsConstructorDescriptionAntAdapterProvider
(android.os.IBinder binder) Apps should useAntService.getAdapterProvider()
to obtain a reference to this object. -
Method Summary
Modifier and TypeMethodDescriptiongetAdaptersInfo
(android.content.Context context) Retrieves a collection of adapter related information stored asAdapterInfo
.
-
Constructor Details
-
AntAdapterProvider
public AntAdapterProvider(android.os.IBinder binder) Apps should useAntService.getAdapterProvider()
to obtain a reference to this object. This method should only be used internally by the lib to create a newAntAdapterProvider
using the binding obtained fromAntService.bindService(android.content.Context, android.content.ServiceConnection)
to communicate with the ANT Radio service. This binding should be acquired by usingAntService.ACTION_BIND_ANT_RADIO_SERVICE
.- Parameters:
binder
- The service binding used to talk to the ANT Radio service.- Since:
- 4.7.2
-
-
Method Details
-
getAdaptersInfo
public Collection<AdapterInfo> getAdaptersInfo(android.content.Context context) throws android.os.RemoteException, ChannelNotAvailableException Retrieves a collection of adapter related information stored asAdapterInfo
. An empty list indicates that no adapter exists, whereas aChannelNotAvailableException
with reasonChannelNotAvailableReason.SERVICE_INITIALIZING
is thrown if service is still initializing to inform the app that it should wait for theAntChannelProvider.ACTION_CHANNEL_PROVIDER_STATE_CHANGED
broadcast before attempting to call this method. Note: on ANT Radio Service versions less than 4.12.10, this method will return a blank list while the service is initializing.- Parameters:
context
- The context of the app.- Returns:
- list of all adapters connected to the ANT Radio service.
- Throws:
android.os.RemoteException
- if a remote exception occurs.ChannelNotAvailableException
- with reasonChannelNotAvailableReason.SERVICE_INITIALIZING
if the service is still initializing.- Since:
- 4.7.2
-