|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.alarexgroup.m2mplf.adapters.io.PulseAdapter
public class PulseAdapter
Adapter works as reader of GPIO 10 pulses.
It's restrictions are described in device documentation.
Warning, it's not possible to use this at the same time with active PinAdapter and PortAdapter!!!
import com.alarexgroup.m2mplf.M2Mlet;
|
| Field Summary | |
|---|---|
static int |
MODE_LIMIT_COUNTER
Reader's mode - limited counter |
static int |
MODE_START_STOP_COUNTER
Reader's mode - start/stop counter |
| Constructor Summary | |
|---|---|
PulseAdapter()
|
|
| Method Summary | |
|---|---|
void |
callReadCurrentPulseCount()
Read current status of the reader. |
void |
createLimitPulseCounter(long limit)
Initializes reader in the mode of counting the impulses until given value. |
void |
createStartStopPulseCounter()
Initializes the reader in start/stop mode. |
void |
destroyCounter()
Terminates the reader's work, releases module's resources. |
static PulseAdapter |
getPulseAdapter(PulseAdapterListener listener)
Method initializes this adapter and returns refferece to it's instance |
void |
onURCEvent(java.lang.String urc)
Internal method, please don't use |
void |
restartPulseCounter(long restartFromCount)
Restart - continues reading from given value |
void |
startOrResetPulseCounter()
Reset the reader's status. |
void |
stopPulseCounter()
Stops the counting of the pulses. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MODE_LIMIT_COUNTER
public static final int MODE_START_STOP_COUNTER
| Constructor Detail |
|---|
public PulseAdapter()
| Method Detail |
|---|
public static PulseAdapter getPulseAdapter(PulseAdapterListener listener)
listener - Class implementing listener
public void createStartStopPulseCounter()
PulseAdapterListener.onPulseCounterReached(long, int)
public void createLimitPulseCounter(long limit)
PulseAdapterListener.onPulseCounterReached(long, int) is called. Returned value is time in which the limit was reached.
limit - - Number of impulses needed for calling the PulseAdapterListener.onPulseCounterReached(long, int) methodpublic void destroyCounter()
createStartStopPulseCounter(), createLimitPulseCounter(long)
public void startOrResetPulseCounter()
createStartStopPulseCounter()
public void restartPulseCounter(long restartFromCount)
restartFromCount - New status of new countingpublic void callReadCurrentPulseCount()
PulseAdapterListener.onPulseCounterReached(long, int) will be called automatically
public void stopPulseCounter()
PulseAdapterListener.onPulseCounterReached(long, int) is called along with information about current pulse count.startOrResetPulseCounter() from 0 value or from last read value using restartPulseCounter(long)
public void onURCEvent(java.lang.String urc)
onURCEvent in interface ATCommanderListenerurc - - URC string
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||