public final class AntContinuousScanController
extends java.lang.Object
setScanChannelEventHandler(IAntChannelEventHandler)
and
clearScanChannelEventHandler()
are used properly.Modifier and Type | Class and Description |
---|---|
class |
AntContinuousScanController.ChannelEventDispatcher |
Modifier and Type | Field and Description |
---|---|
static |
CREATOR
Creates an AntContinuousScanController from a Parcel
|
Modifier and Type | Method and Description |
---|---|
void |
clearAdapterEventHandler()
Clears the handler registered to this callback through
setAdapterEventHandler(IAntAdapterEventHandler) and closes its associated resources. |
void |
clearScanChannelEventHandler()
Clears the handler registered to this callback through
setScanChannelEventHandler(IAntChannelEventHandler) and closes its
associated resources. |
void |
close()
Closes the controller.
|
int |
describeContents() |
Capabilities |
getCapabilities()
Gets the
Capabilities of this controller. |
void |
open()
Opens continuous scan.
|
void |
readFromParcel(Parcel source)
Set values to those in the provided Parcel
|
void |
release()
Does the opposite of
AntChannelProvider acquireContinuousScanController(),
tearing down this controller instance. |
ChannelStatusMessage |
requestChannelStatus()
Asks the controller for its status information.
|
void |
setAdapterEventHandler(IAntAdapterEventHandler eventHandler)
Sets up the handler to be used for event callbacks from the adapter this controller is on.
|
void |
setChannelId(ChannelId channelId)
Configures the channel ID for this channel.
|
void |
setEventBuffer(EventBufferSettings eventBufferSettings)
Enables event buffering to buffer messages and deliver them when the
buffer time expires, or the buffer is full.
|
void |
setRfFrequency(int radioFrequencyOffset)
Sets the RF frequency for this channel by a frequency offset, e.g.
|
void |
setScanChannelEventHandler(IAntChannelEventHandler eventHandler)
Sets up the handler to be used for event callbacks from this controller.
|
void |
writeToParcel(Parcel dest,
int flags)
Writes value into the provided parcel
|
public static finalCREATOR
public void setChannelId(ChannelId channelId) throws RemoteException, AntCommandFailedException
See the ANT Message Protocol and Usage document for more details.
channelId
- The device number, device type and transmission type to identify this channel.RemoteException
- If you receive this exception then the channel should be considered dead.
In this circumstance you can attempt to acquire a replacement channel.AntCommandFailedException
- If the service reported a failure.public void open() throws RemoteException, AntCommandFailedException
See the ANT Message Protocol and Usage document for more details.
RemoteException
- If you receive this exception then the channel should be considered dead.
In this circumstance you can attempt to acquire a replacement channel.AntCommandFailedException
- If the service reported a failure.public void release()
AntChannelProvider
acquireContinuousScanController(),
tearing down this controller instance. It cannot be used after calling this
method. This signals the ANT Radio service to reclaim the channel resources for
other applications to use.public void setRfFrequency(int radioFrequencyOffset) throws RemoteException, AntCommandFailedException
getCapabilities()
) and calling Capabilities.getRfFrequencyMin()
and
Capabilities.getRfFrequencyMax()
. A frequency offset of 57 MHz (2457 MHz) is not
allowed and is reserved for use by the ANT+ Plugin API, which must be used to connect to
ANT+ devices. An attempt to set a frequency outside of these allowed values will fail with
a AntCommandFailureReason.INVALID_REQUEST
.
See the ANT
Message Protocol and Usage document for more details.radioFrequencyOffset
- The radio frequency to use for this channel's communication
as an offset in MHz from 2400MHz (2.4GHz).RemoteException
- If you receive this exception then the channel should be considered dead.
In this circumstance you can attempt to acquire a replacement channel.AntCommandFailedException
- If the service reported a failure.public Capabilities getCapabilities() throws RemoteException
Capabilities
of this controller. These are based on the adapter (hardware)
the controller is running on.RemoteException
- If you receive this exception then the controller should be considered dead.
In this circumstance you can attempt to acquire a replacement controller.public void close() throws RemoteException, AntCommandFailedException
Note: This method returns when the close command itself is successful, but not the actual
event of the controller completing the close routines. To synchronize on the actual closing
of the channel wait for the response event EventCode.CHANNEL_CLOSED
in a
MessageFromAntType.CHANNEL_EVENT
through
IAntChannelEventHandler.onReceiveMessage(MessageFromAntType, AntMessageParcel)
.
See the ANT Message Protocol and Usage document for more details.
RemoteException
- If you receive this exception then the channel should be considered dead.
In this circumstance you can attempt to acquire a replacement channel.AntCommandFailedException
- If the service reported a failure.public void setEventBuffer(EventBufferSettings eventBufferSettings) throws RemoteException, AntCommandFailedException
EventBufferSettings.DEFAULT_BUFFER_TIME_MILLISECONDS
can
substantially increase power savings in cases where that is required.
See the ANT
Message Protocol and Usage document for details.
eventBufferSettings
- Indicates the specific event buffer values to
be requestedRemoteException
- If you receive this exception then the channel
should be considered dead. In this circumstance you can
attempt to acquire a replacement channel.AntCommandFailedException
- If the service reported a failure.public ChannelStatusMessage requestChannelStatus() throws RemoteException, AntCommandFailedException
RemoteException
- If you receive this exception then the controller should
be considered dead. In this circumstance you can attempt to acquire a
replacement controller.AntCommandFailedException
- If the service reported a failure.public void clearScanChannelEventHandler() throws RemoteException
setScanChannelEventHandler(IAntChannelEventHandler)
and closes its
associated resources.RemoteException
- If you receive this exception then the controller
should be considered dead. In this circumstance you can
attempt to acquire a replacement controller.public void setScanChannelEventHandler(IAntChannelEventHandler eventHandler) throws RemoteException
clearScanChannelEventHandler()
.eventHandler
- The handler to receive the channel events.RemoteException
- If you receive this exception then the controller
should be considered dead. In this circumstance you can
attempt to acquire a replacement controller.clearScanChannelEventHandler()
public void setAdapterEventHandler(IAntAdapterEventHandler eventHandler) throws RemoteException
clearAdapterEventHandler()
.eventHandler
- The handler to receive the adapter events.RemoteException
- If you receive this exception then the controller should be considered dead.
In this circumstance you can attempt to acquire a replacement controller.clearAdapterEventHandler()
public void clearAdapterEventHandler() throws RemoteException
setAdapterEventHandler(IAntAdapterEventHandler)
and closes its associated resources.RemoteException
- If you receive this exception then the controller should be considered dead.
In this circumstance you can attempt to acquire a replacement controller.public int describeContents()
public void writeToParcel(Parcel dest, int flags)
public void readFromParcel(Parcel source)
source
- Parceled version of an ServiceResultParcel.Copyright © 2015 Dynastream Innovations Inc. All Rights Reserved.