Class AntPlusCommonPcc
java.lang.Object
com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc
com.dsi.ant.plugins.antplus.pccbase.AntPlusCommonPcc
- Direct Known Subclasses:
AntPlusBaseRemoteControlPcc,AntPlusBikePowerPcc,AntPlusEnvironmentPcc,AntPlusFitnessEquipmentPcc,AntPlusStrideSdmPcc,AntPlusWeightScalePcc
Adds common pages support to a PCC
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumANT+ Common Data Pagesstatic interfaceReceiver for the BatteryStatus event, which is: Information about the battery status and operating time.static interfaceReceiver for the ManufacturerIdentification event, which is: Information about the manufacturer and hardware.static interfaceReceiver for the ManufacturerSpecificData event, which is: Manufacturer specific data.classDefines the keys and values used to communicate between the PCC and plugin.static interfaceReceiver for the ProductInformation event, which is: Information about the product and software.static interfaceReceiver for the RequestFinished event, which is: Final result of the command requested.static interfaceReceiver for the rssi event, which is: Rssi of received messages.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
FieldsFields 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 voidhandlePluginEvent(android.os.Message eventMsg) booleanrequestCommonDataPage(AntPlusCommonPcc.CommonDataPage commonDataPage, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver) Send a request to the device to send the requestedAntPlusCommonPcc.CommonDataPage.booleanrequestManufacturerSpecificDataPage(int manufacturerSpecificDataPage, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver) Send a request to the device to send the requested data page.booleansendManufacturerSpecificDataPage(int manufacturerSpecificDataPage, byte[] manufacturerSpecificDataPagePayload, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver) Send a manufacturer specific data page to the device.protected booleansendRequestCommand(String cmdName, int whatCmd, android.os.Bundle params, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver) protected booleansendRequestCommand(String cmdName, int whatCmd, android.os.Bundle params, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver, Integer requiredServiceVersion) protected booleansendRequestCommand(String cmdName, int whatCmd, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver) protected booleansendRequestCommand(String cmdName, int whatCmd, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver, Integer requiredServiceVersion) voidsubscribeBatteryStatusEvent(AntPlusCommonPcc.IBatteryStatusReceiver BatteryStatusReceiver) Subscribe to receive BatteryStatus events, which contain: Information about the battery status and operating time.voidsubscribeManufacturerIdentificationEvent(AntPlusCommonPcc.IManufacturerIdentificationReceiver ManufacturerIdentificationReceiver) Subscribe to receive ManufacturerIdentification events, which contain: Information about the manufacturer and hardware.booleansubscribeManufacturerSpecificDataEvent(AntPlusCommonPcc.IManufacturerSpecificDataReceiver ManufacturerSpecificDataReceiver) Subscribe to receive ManufacturerSpecificData events, which contain: Manufacturer specific data.voidsubscribeProductInformationEvent(AntPlusCommonPcc.IProductInformationReceiver ProductInformationReceiver) Subscribe to receive ProductInformation events, which contain: Information about the product and software.booleansubscribeRssiEvent(AntPlusCommonPcc.IRssiReceiver RssiReceiver) Subscribe to receive Rssi events, which contain rssi signal strength data.booleanMethods inherited from class com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc
bindAndRequest, closePluginConnection, createCmdMsg, getAntDeviceNumber, getCurrentDeviceState, getDeviceName, getInstalledPluginsVersionNumber, getInstalledPluginsVersionString, getMissingDependencyName, getMissingDependencyPackageName, getPluginPrintableName, getRequiredServiceVersionForBind, getServiceBindIntent, 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
-
Field Details
-
mRequestFinishedReceiver
-
mCommandLock
-
-
Constructor Details
-
AntPlusCommonPcc
public AntPlusCommonPcc()
-
-
Method Details
-
handlePluginEvent
protected void handlePluginEvent(android.os.Message eventMsg) - Specified by:
handlePluginEventin classAntPluginPcc
-
subscribeManufacturerIdentificationEvent
public void subscribeManufacturerIdentificationEvent(AntPlusCommonPcc.IManufacturerIdentificationReceiver ManufacturerIdentificationReceiver) Subscribe to receive ManufacturerIdentification events, which contain: Information about the manufacturer and hardware. This function can also be used to unsubscribe from an event, by passing null as the receiver.- Parameters:
ManufacturerIdentificationReceiver- receiver to receive events (or null to unsubscribe from this event).
-
subscribeProductInformationEvent
public void subscribeProductInformationEvent(AntPlusCommonPcc.IProductInformationReceiver ProductInformationReceiver) Subscribe to receive ProductInformation events, which contain: Information about the product and software. This function can also be used to unsubscribe from an event, by passing null as the receiver.- Parameters:
ProductInformationReceiver- receiver to receive events (or null to unsubscribe from this event).
-
subscribeBatteryStatusEvent
public void subscribeBatteryStatusEvent(AntPlusCommonPcc.IBatteryStatusReceiver BatteryStatusReceiver) Subscribe to receive BatteryStatus events, which contain: Information about the battery status and operating time. This function can also be used to unsubscribe from an event, by passing null as the receiver.- Parameters:
BatteryStatusReceiver- receiver to receive events (or null to unsubscribe from this event).
-
subscribeManufacturerSpecificDataEvent
public boolean subscribeManufacturerSpecificDataEvent(AntPlusCommonPcc.IManufacturerSpecificDataReceiver ManufacturerSpecificDataReceiver) Subscribe to receive ManufacturerSpecificData events, which contain: Manufacturer specific data. This function can also be used to unsubscribe from an event, by passing null as the receiver.- Parameters:
ManufacturerSpecificDataReceiver- receiver to receive events (or null to unsubscribe from this event).- Returns:
- true if successful
- Since:
- 2.1.5; requires Plugin Service 2.2.6+
-
subscribeRssiEvent
Subscribe to receive Rssi events, which contain rssi signal strength data. This function can also be used to unsubscribe from an event, by passing null as the receiver.- Parameters:
RssiReceiver- receiver to receive events (or null to unsubscribe from this event).- Returns:
- true if successful
- Since:
- 3.2.3; requires Plugin Service 3.2.3+
-
requestCommonDataPage
public boolean requestCommonDataPage(AntPlusCommonPcc.CommonDataPage commonDataPage, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver) Send a request to the device to send the requestedAntPlusCommonPcc.CommonDataPage. This command is optional and may not be supported by all devices. If it is unsupported the device will not respond.- Parameters:
commonDataPage- TheAntPlusCommonPcc.CommonDataPageto be requested from the device.requestFinishedReceiver- Receiver for the results of the command request.- Returns:
- True if request was submitted successfully and you are guaranteed a result on the result receiver.
-
requestManufacturerSpecificDataPage
public boolean requestManufacturerSpecificDataPage(int manufacturerSpecificDataPage, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver) Send a request to the device to send the requested data page. This command is optional and may not be supported by all devices. If it is unsupported the device will not respond.- Parameters:
manufacturerSpecificDataPage- The manufacturer specific data page to be requested from the device. The manufacturer specific data page numbers range from 240-255.requestFinishedReceiver- Receiver for the results of the command request.- Returns:
- True if request was submitted successfully and you are guaranteed a result on the result receiver.
-
supportsRssi
public boolean supportsRssi() -
sendManufacturerSpecificDataPage
public boolean sendManufacturerSpecificDataPage(int manufacturerSpecificDataPage, byte[] manufacturerSpecificDataPagePayload, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver) Send a manufacturer specific data page to the device. This command is optional and is specific to the manufacturer of the device. Please contact the manufacturer for more information.- Parameters:
manufacturerSpecificDataPage- The manufacturer specific data page to be sent to the device. The manufacturer specific data page numbers range from 240-255.manufacturerSpecificDataPagePayload- The 7-byte minimum data payload to be sent to the device.requestFinishedReceiver- Receiver for the results of the command request.- Returns:
- True if request was submitted successfully and you are guaranteed a result on the result receiver.
-
sendRequestCommand
protected boolean sendRequestCommand(String cmdName, int whatCmd, android.os.Bundle params, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver, Integer requiredServiceVersion) -
sendRequestCommand
protected boolean sendRequestCommand(String cmdName, int whatCmd, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver) -
sendRequestCommand
protected boolean sendRequestCommand(String cmdName, int whatCmd, android.os.Bundle params, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver) -
sendRequestCommand
protected boolean sendRequestCommand(String cmdName, int whatCmd, AntPlusCommonPcc.IRequestFinishedReceiver requestFinishedReceiver, Integer requiredServiceVersion)
-