Class AntPlusBaseRemoteControlPcc
java.lang.Object
com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc
com.dsi.ant.plugins.antplus.pccbase.AntPlusCommonPcc
com.dsi.ant.plugins.antplus.pcc.controls.pccbase.AntPlusBaseRemoteControlPcc
- Direct Known Subclasses:
AntPlusAudioRemoteControlPcc
,AntPlusGenericRemoteControlPcc
,AntPlusVideoRemoteControlPcc
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
Receiver for the ControlDeviceAvailability event, which is: Indicates which features are supported by a specific controllable device.class
Defines the keys and values used to communicate between the PCC and plugin.static interface
Receives results and failures of an async scan.static class
static class
Nested classes/interfaces inherited from class com.dsi.ant.plugins.antplus.pccbase.AntPlusCommonPcc
AntPlusCommonPcc.CommonDataPage, AntPlusCommonPcc.IBatteryStatusReceiver, AntPlusCommonPcc.IManufacturerIdentificationReceiver, AntPlusCommonPcc.IManufacturerSpecificDataReceiver, AntPlusCommonPcc.IProductInformationReceiver, AntPlusCommonPcc.IRequestFinishedReceiver, AntPlusCommonPcc.IRssiReceiver
Nested classes/interfaces inherited from class com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc
AntPluginPcc.IDeviceStateChangeReceiver, AntPluginPcc.IPluginAccessResultReceiver<T extends AntPluginPcc>, AntPluginPcc.RequestAccessResultHandler<T extends AntPluginPcc>, AntPluginPcc.RequestAccessResultHandler_AsyncSearchByDevNumber<T extends AntPluginPcc>, AntPluginPcc.RequestAccessResultHandler_UI<T extends AntPluginPcc>, AntPluginPcc.StandardReleaseHandle<T extends AntPluginPcc>
-
Field Summary
Fields inherited from class com.dsi.ant.plugins.antplus.pccbase.AntPlusCommonPcc
mCommandLock, mRequestFinishedReceiver
Fields inherited from class com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc
mReleaseHandle, mStateChangeReceiver, PATH_ANTPLUS_PLUGINS_PKG, reportedServiceVersion, supportsRssiEvent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
protected android.content.Intent
protected void
handlePluginEvent
(android.os.Message eventMsg) protected static <T extends AntPlusBaseRemoteControlPcc>
PccReleaseHandle<T>requestAccessRemoteControl_Helper
(EnumSet<ControlsMode> requestModes, ControlsMode pccMode, android.content.Context bindToContext, int antDeviceNumber, int searchProximityThreshold, AntPluginPcc.IPluginAccessResultReceiver<T> resultReceiver, AntPluginPcc.IDeviceStateChangeReceiver stateReceiver, T potentialRetObj) Sends a request to the plugin to access a device and receive a live PCC instance.protected static <T extends AntPlusBaseRemoteControlPcc>
AntPlusBaseRemoteControlPcc.RemoteControlAsyncScanController<T>requestAccessRemoteControl_Helper
(EnumSet<ControlsMode> requestModes, ControlsMode pccMode, android.content.Context bindingContext, int searchProximityThreshold, T retPccObject, AntPlusBaseRemoteControlPcc.IRemoteControlAsyncScanResultReceiver scanResultReceiver) Sends a request to the plugin to access a device and receive a live PCC instance.void
subscribeControlDeviceAvailabilityEvent
(AntPlusBaseRemoteControlPcc.IControlDeviceAvailabilityReceiver ControlDeviceAvailabilityReceiver) Subscribe to receive ControlDeviceAvailability events, which contain: Indicates which features are supported by a specific controllable device.Methods inherited from class com.dsi.ant.plugins.antplus.pccbase.AntPlusCommonPcc
requestCommonDataPage, requestManufacturerSpecificDataPage, sendManufacturerSpecificDataPage, sendRequestCommand, sendRequestCommand, sendRequestCommand, sendRequestCommand, subscribeBatteryStatusEvent, subscribeManufacturerIdentificationEvent, subscribeManufacturerSpecificDataEvent, subscribeProductInformationEvent, subscribeRssiEvent, supportsRssi
Methods inherited from class com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc
bindAndRequest, closePluginConnection, createCmdMsg, getAntDeviceNumber, getCurrentDeviceState, getDeviceName, getInstalledPluginsVersionNumber, getInstalledPluginsVersionString, getMissingDependencyName, getMissingDependencyPackageName, getPluginPrintableName, handleNonCmdPluginMessage, isUserPreferredDeviceForPlugin, isUserRecognizedDevice, releaseAccess, requestAccess_Helper_AsyncScanController, requestAccess_Helper_AsyncSearchByDevNumber, requestAccess_Helper_Main, requestAccess_Helper_SearchActivity, requestAccess_Helper_SubMain, requestAsyncScan_Helper_SubMain, sendPluginCommand, sendPluginCommand, startPluginManagerActivity, subscribeToEvent, unsubscribeFromEvent
-
Constructor Details
-
AntPlusBaseRemoteControlPcc
public AntPlusBaseRemoteControlPcc()
-
-
Method Details
-
requestAccessRemoteControl_Helper
protected static <T extends AntPlusBaseRemoteControlPcc> AntPlusBaseRemoteControlPcc.RemoteControlAsyncScanController<T> requestAccessRemoteControl_Helper(EnumSet<ControlsMode> requestModes, ControlsMode pccMode, android.content.Context bindingContext, int searchProximityThreshold, T retPccObject, AntPlusBaseRemoteControlPcc.IRemoteControlAsyncScanResultReceiver scanResultReceiver) Sends a request to the plugin to access a device and receive a live PCC instance. If the minimum version of the desired plugin is installed, this will start an asynchronous search for a device to connect to and return the result on the provided result receiver.
The plugin will attempt to connect to a device with the provided deviceNumber and return a result when the device is connected or the search fails. The search will timeout after 10s, if you wish to keep searching you can call this method again.
Note: If you set deviceNumber to 0 it will connect to the first available/found device.- Parameters:
requestModes
- A set containing the desiredControlsMode
that must match the capabilities of found devices in order to connect.bindingContext
- The context to which the plugin will be bound. Used for plugin lifecycle management.searchProximityThreshold
- This value represents the signal strength 'proximity' requirement on finding matches during searching, if a device does not meet the requirements it will not show up in the search at all. The value is a generic signal strength threshold from 1-10 where 1 is the strongest (ie: closest) and 10 is the lowest(ie: farthest away). 0 = don't use proximity search.retPccObject
- The PCC object that is to receive access to the plugin.scanResultReceiver
- The receiver to receive the results of the asynchronous device scan.
-
requestAccessRemoteControl_Helper
protected static <T extends AntPlusBaseRemoteControlPcc> PccReleaseHandle<T> requestAccessRemoteControl_Helper(EnumSet<ControlsMode> requestModes, ControlsMode pccMode, android.content.Context bindToContext, int antDeviceNumber, int searchProximityThreshold, AntPluginPcc.IPluginAccessResultReceiver<T> resultReceiver, AntPluginPcc.IDeviceStateChangeReceiver stateReceiver, T potentialRetObj) Sends a request to the plugin to access a device and receive a live PCC instance. If the minimum version of the desired plugin is installed, this will start an asynchronous search for a device to connect to and return the result on the provided result receiver.
The plugin will attempt to connect to a device with the provided deviceNumber and return a result when the device is connected or the search fails. The search will timeout after 10s, if you wish to keep searching you can call this method again.
Note: If you set deviceNumber to 0 it will connect to the first available/found device.- Parameters:
requestModes
- A set containing the desiredControlsMode
that must match the capabilities of found devices in order to connect.bindToContext
- The context to which the plugin will be bound. Used for plugin lifecycle management.antDeviceNumber
- DeviceNumber to attempt to connect to. A deviceNumber of 0 indicates a desire to connect to first available device.searchProximityThreshold
- This value represents the signal strength 'proximity' requirement on finding matches during searching, if a device does not meet the requirements it will not show up in the search at all. The value is a generic signal strength threshold from 1-10 where 1 is the strongest (ie: closest) and 10 is the lowest(ie: farthest away). 0 = don't use proximity search.resultReceiver
- The receiver to receive the results of the request. Possible returns include:stateReceiver
- The receiver to receive the state updates of the accessed device, assuming the request is successful. This receiver will receive notifications of all state changes to the device that occur subsequent to the initial state returned in the result receiver.potentialRetObj
- The PCC object that is to receive access to the plugin.
-
getServiceBindIntent
protected android.content.Intent getServiceBindIntent()- Specified by:
getServiceBindIntent
in classAntPluginPcc
-
getRequiredServiceVersionForBind
protected int getRequiredServiceVersionForBind()- Specified by:
getRequiredServiceVersionForBind
in classAntPluginPcc
-
subscribeControlDeviceAvailabilityEvent
public void subscribeControlDeviceAvailabilityEvent(AntPlusBaseRemoteControlPcc.IControlDeviceAvailabilityReceiver ControlDeviceAvailabilityReceiver) Subscribe to receive ControlDeviceAvailability events, which contain: Indicates which features are supported by a specific controllable device. This function can also be used to unsubscribe from an event, by passing null as the receiver.- Parameters:
ControlDeviceAvailabilityReceiver
- receiver to receive events (or null to unsubscribe from this event).
-
handlePluginEvent
protected void handlePluginEvent(android.os.Message eventMsg) - Overrides:
handlePluginEvent
in classAntPlusCommonPcc
-