Package com.dsi.ant.channel.ipc.aidl
Class AntChannelProviderCommunicatorAidl
java.lang.Object
com.dsi.ant.channel.ipc.aidl.AntChannelProviderCommunicatorAidl
- All Implemented Interfaces:
IAntChannelProviderCommunicator
public class AntChannelProviderCommunicatorAidl
extends Object
implements IAntChannelProviderCommunicator
An implementation of an ANT Channel Pool Communicator which uses AIDL as the communication
method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey needed to extract continuous scan mode supported from the data bundle of an IPC message.static final StringKey needed to extract desiredAdapterInfofrom the data bundle of an IPC message.static final StringKey needed to extract desiredCapabilitiesfrom the data bundle of an IPC message.static final StringKey needed to extract the library version code of this library.static final StringKey needed to extract aNetworkKeyfrom the data bundle of an IPC message.static final StringKey needed to extract thePredefinedNetworkfrom the data bundle of an IPC message.static final StringKey needed to extract requiredCapabilitiesfrom the data bundle of an IPC message. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacquireAllChannelsForContinuousScan(android.content.Context context, AdapterInfo adapterInfo, int predefinedNetwork, android.os.Bundle error) Acquires channels to use for continuous scan from the ANT Radio ServiceacquireAllChannelsForContinuousScan(android.content.Context context, AdapterInfo adapterInfo, NetworkKey networkKey, android.os.Bundle error) Acquires channels to use for continuous scan from the ANT Radio ServiceacquireChannel(android.content.Context context, int whichNetwork, Capabilities requiredCapabilities, Capabilities desiredCapabilities, android.os.Bundle error) Request a new ANT channel from the ANT Radio Service.acquireChannelFromAdapter(android.content.Context context, AdapterInfo desiredAdapter, int whichNetwork, android.os.Bundle error) Request a new ANT channel on the specified adapter from the ANT Radio Service.acquireChannelOnPrivateNetwork(android.content.Context context, NetworkKey privateNetwork, Capabilities requiredCapabilities, Capabilities desiredCapabilities, android.os.Bundle error) Request a new ANT channel on the specified private network from the ANT Radio Service.acquireChannelOnPrivateNetworkFromAdapter(android.content.Context context, AdapterInfo desiredAdapter, NetworkKey privateNetwork, android.os.Bundle error) Request a new ANT channel on the specified adapter from the ANT Radio Service.intgetNumChannelsAvailable(Capabilities requiredCapabilities) Query the availability of channels with the specified capabilities.booleanQueries if the legacy interface is in use.
-
Field Details
-
KEY_LIBRARY_VERSION_CODE
Key needed to extract the library version code of this library.- See Also:
-
KEY_NETWORK_KEY
Key needed to extract aNetworkKeyfrom the data bundle of an IPC message.- See Also:
-
KEY_PREDEFINED_NETWORK
Key needed to extract thePredefinedNetworkfrom the data bundle of an IPC message.- See Also:
-
KEY_REQUIRED_CAPABILITIES
Key needed to extract requiredCapabilitiesfrom the data bundle of an IPC message.- See Also:
-
KEY_DESIRED_CAPABILITIES
Key needed to extract desiredCapabilitiesfrom the data bundle of an IPC message.- See Also:
-
KEY_DESIRED_ADAPTER
Key needed to extract desiredAdapterInfofrom the data bundle of an IPC message.- See Also:
-
KEY_CONTINUOUS_SCAN_MODE_SUPPORTED
Key needed to extract continuous scan mode supported from the data bundle of an IPC message.- See Also:
-
-
Constructor Details
-
AntChannelProviderCommunicatorAidl
public AntChannelProviderCommunicatorAidl(android.os.IBinder binder)
-
-
Method Details
-
acquireChannel
public IAntChannelCommunicator acquireChannel(android.content.Context context, int whichNetwork, Capabilities requiredCapabilities, Capabilities desiredCapabilities, android.os.Bundle error) throws android.os.RemoteException Description copied from interface:IAntChannelProviderCommunicatorRequest a new ANT channel from the ANT Radio Service.- Specified by:
acquireChannelin interfaceIAntChannelProviderCommunicator- Returns:
- The acquired ANT channel, or null. If the returned channel is null the Bundle
"error" will contain a
ChannelNotAvailableExceptionunder the key "error" - Throws:
android.os.RemoteException
-
acquireChannelOnPrivateNetwork
public IAntChannelCommunicator acquireChannelOnPrivateNetwork(android.content.Context context, NetworkKey privateNetwork, Capabilities requiredCapabilities, Capabilities desiredCapabilities, android.os.Bundle error) throws android.os.RemoteException, UnsupportedFeatureException Description copied from interface:IAntChannelProviderCommunicatorRequest a new ANT channel on the specified private network from the ANT Radio Service. This replaces the acquire channel method that receives a byte array, which still must exist in the aidl file to ensure backwards compatibility and is still required to be implemented by ANT Radio Service.- Specified by:
acquireChannelOnPrivateNetworkin interfaceIAntChannelProviderCommunicator- Returns:
- The acquired ANT channel, or null. If the returned channel is null
the Bundle "error" will contain a
ChannelNotAvailableExceptionunder the key "error" - Throws:
android.os.RemoteExceptionUnsupportedFeatureException
-
acquireChannelFromAdapter
public IAntChannelCommunicator acquireChannelFromAdapter(android.content.Context context, AdapterInfo desiredAdapter, int whichNetwork, android.os.Bundle error) throws android.os.RemoteException, UnsupportedFeatureException Description copied from interface:IAntChannelProviderCommunicatorRequest a new ANT channel on the specified adapter from the ANT Radio Service.- Specified by:
acquireChannelFromAdapterin interfaceIAntChannelProviderCommunicator- Returns:
- The acquired ANT channel, or null. If the returned channel is null
the Bundle "error" will contain a
ChannelNotAvailableExceptionunder the key "error" - Throws:
android.os.RemoteExceptionUnsupportedFeatureException
-
acquireChannelOnPrivateNetworkFromAdapter
public IAntChannelCommunicator acquireChannelOnPrivateNetworkFromAdapter(android.content.Context context, AdapterInfo desiredAdapter, NetworkKey privateNetwork, android.os.Bundle error) throws android.os.RemoteException, UnsupportedFeatureException Description copied from interface:IAntChannelProviderCommunicatorRequest a new ANT channel on the specified adapter from the ANT Radio Service.- Specified by:
acquireChannelOnPrivateNetworkFromAdapterin interfaceIAntChannelProviderCommunicator- Returns:
- The acquired ANT channel, or null. If the returned channel is null
the Bundle "error" will contain a
ChannelNotAvailableExceptionunder the key "error" - Throws:
android.os.RemoteExceptionUnsupportedFeatureException
-
getNumChannelsAvailable
public int getNumChannelsAvailable(Capabilities requiredCapabilities) throws android.os.RemoteException Description copied from interface:IAntChannelProviderCommunicatorQuery the availability of channels with the specified capabilities.- Specified by:
getNumChannelsAvailablein interfaceIAntChannelProviderCommunicator- Returns:
- the number of channels with the requested capabilities available at the time of the query
- Throws:
android.os.RemoteException
-
isLegacyInterfaceInUse
public boolean isLegacyInterfaceInUse() throws android.os.RemoteExceptionDescription copied from interface:IAntChannelProviderCommunicatorQueries if the legacy interface is in use. If there are no channels available, applications can use this check to determine if the legacy interface is using all the channels. In this case, applications can attempt to acquire a channel to force claim the adapter.- Specified by:
isLegacyInterfaceInUsein interfaceIAntChannelProviderCommunicator- Returns:
- true if the legacy interface is in use. If true, applications can attempt to acquire channels anyway and force claim the adapter.
- Throws:
android.os.RemoteException
-
acquireAllChannelsForContinuousScan
public IAntChannelCommunicator[] acquireAllChannelsForContinuousScan(android.content.Context context, AdapterInfo adapterInfo, NetworkKey networkKey, android.os.Bundle error) throws android.os.RemoteException, UnsupportedFeatureException Description copied from interface:IAntChannelProviderCommunicatorAcquires channels to use for continuous scan from the ANT Radio Service- Specified by:
acquireAllChannelsForContinuousScanin interfaceIAntChannelProviderCommunicator- Returns:
- All ANT channels pertaining to adapterInfo, or null. If the
returned channel is null the Bundle "error" will contain a
ChannelNotAvailableExceptionunder the key "error" - Throws:
android.os.RemoteExceptionUnsupportedFeatureException
-
acquireAllChannelsForContinuousScan
public IAntChannelCommunicator[] acquireAllChannelsForContinuousScan(android.content.Context context, AdapterInfo adapterInfo, int predefinedNetwork, android.os.Bundle error) throws android.os.RemoteException, UnsupportedFeatureException Description copied from interface:IAntChannelProviderCommunicatorAcquires channels to use for continuous scan from the ANT Radio Service- Specified by:
acquireAllChannelsForContinuousScanin interfaceIAntChannelProviderCommunicator- Returns:
- All ANT channels pertaining to adapterInfo, or null. If the
returned channel is null the Bundle "error" will contain a
ChannelNotAvailableExceptionunder the key "error" - Throws:
android.os.RemoteExceptionUnsupportedFeatureException
-