|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.motorola.oem.hapi.A2dChannel
public final class A2dChannel
The A2dChannel class contains methods for configuration, and receiving notifications from the A2d channels.
A2dAutoPeriodConfig
A2dAutoThresholdConfig
startNotification(com.motorola.oem.hapi.A2dAutoPeriodConfig)
methods and may be re-defined at any time.
Field Summary | |
---|---|
static int |
AUTO_NOTIFICATION_OFF
Constant specifying AUTO_NOTIFICATION_OFF mode. |
static int |
AUTO_NOTIFICATION_PERIOD
Constant specifying AUTO_NOTIFICATION_PERIOD mode. |
static int |
AUTO_NOTIFICATION_THRESHOLD
constant specifying AUTO_NOTIFICATION_THRESHOLD mode. |
Method Summary | |
---|---|
int |
getChannelNotificationMode()
Gets notification mode for this channel. |
int |
getConverterNum()
Gets a converter number mapped to this channel. |
A2dEventListener |
getListener()
Gets listener of this channel. |
A2dAutoPeriodConfig |
getPeriodModeData()
Gets A2dAutoPeriodConfig instance related to this channel. |
A2dAutoThresholdConfig |
getThresholdModeData()
Gets A2dAutoThresholdConfig instance related to this channel. |
int |
getValue()
Gets value from a channel. |
void |
setListener(A2dEventListener listener)
Sets listener for this channel. |
void |
startNotification(A2dAutoPeriodConfig period_config_data)
Sets channel to auto notification by period. |
void |
startNotification(A2dAutoThresholdConfig threshold_config_data)
Sets channel to auto notification by threshold. |
void |
stopNotification()
Sets a channel to auto notification off. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int AUTO_NOTIFICATION_OFF
public static final int AUTO_NOTIFICATION_PERIOD
public static final int AUTO_NOTIFICATION_THRESHOLD
Method Detail |
---|
public void startNotification(A2dAutoPeriodConfig period_config_data) throws A2dException
A2d value will be returned as a parameter toA2dEventListener.onNotification(int, int, int)
method of A2dEventlistener instance related to this channel, therefore, setting a listener for this channel is a preliminary condition. Call startNotification on channel which already configures to work in auto notification mode will reconfigure the channel.
period_config_data
- A2dAutoPeriodConfig
instance holds period of time between cyclically report.
A2dException
- If A2d java API is not enable. Error code - A2dException.UNIT_DISABLED_ERROR
A2dException.SET_CHANNEL_ERROR
A2dException.SET_CHANNEL_ERROR
public void startNotification(A2dAutoThresholdConfig threshold_config_data) throws A2dException
A2d value will be returned as parameter toA2dEventListener.onNotification(int, int, int)
method of A2dEventlistener instance related to this channel. Therefore set listener of this channel is a preliminary condition. Call startNotification on channel which already configures to work in auto notification mode will reconfigure the channel.
threshold_config_data
- A2dAutoThersholdConfig instance that hold threshold definition.A2dException
- If A2d java API is not enable. Error code - A2dException.UNIT_DISABLED_ERROR
A2dException.SET_CHANNEL_ERROR
A2dException.SET_CHANNEL_ERROR
public void stopNotification() throws A2dException
A2dException
- If platform failed to set channel to auto notification off. Error code - A2dException.SET_CHANNEL_ERROR
public int getValue() throws A2dException, java.lang.InterruptedException
getValue is a synchronized method. At any time only one thread can execute it. This method will be blocked until receiving a notification.
A2dException
- If A2d java API is not enabled. Error code - A2dException.UNIT_DISABLED_ERROR
A2dException.QUERY_CHANNEL_ERROR
java.lang.InterruptedException
- Failed to get value.
public int getConverterNum()
Possible values are: 1 => ADC1, 2=> ADC2, 3 => ADC3.
public int getChannelNotificationMode()
Possible values are: 0 => AUTO_NOTIFICATION_OFF, 1 => AUTO_NOTIFICATION_PERIOD, 2 => AUTO_NOTIFICATION_THRESHOLD.
public A2dAutoThresholdConfig getThresholdModeData()
A2dAutoThresholdConfig
instance related to this channel.
public A2dAutoPeriodConfig getPeriodModeData()
A2dAutoPeriodConfig
instance related to this channel.
public void setListener(A2dEventListener listener) throws A2dException
listener
- External listener object to receive events.
A2dException
- If attempt to set null listener. Error code - OEMException.GENERAL_ERROR
public A2dEventListener getListener()
A2dEventListener
instance related to this channel.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |