|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.alarexgroup.m2mplf.adapters.io.PinAdapter
public class PinAdapter
This adapter lets you work with GPIO pins, setup their mode, value or monitor changes in their signals.
Example of monitoring pin's status. If the status of GPI01 is changed, this change will be copied to GPIO2.
import com.alarexgroup.m2mplf.M2Mlet;
|
| Constructor Summary | |
|---|---|
PinAdapter()
|
|
| Method Summary | |
|---|---|
void |
closeDriver()
Ends current work od the adapter and releases HW resources of module |
static PinAdapter |
getPinAdapter(PinAdapterListener listener)
Creates an instance of this adapter and returns referrence |
PinConfiguration |
getPinConfiguration()
Returns current pin configuration profile |
int |
getPinDirection(int pinIndex)
Returns pin mode |
int |
getPinMode(int pinIndex)
Returns working state of the specified pin, whether it is opened or closed. |
void |
onURCEvent(java.lang.String urc)
This method is for internal use to listen for PIN pooling notifications |
void |
openDriver()
Method initializes the adapter |
boolean |
readPinValue(int pinIndex)
Returns current value of the specified pin. |
void |
startPoolingPin(int pinIndex)
Start pin monitoring. |
void |
stopPoolingPin(int pinIndex)
Stops specified pin monitoring. |
void |
submitPinConfiguration(PinConfiguration newPinConfiguration)
Setup each pin according to the created profile PinConfiguration. |
void |
writePinValue(int pinIndex,
boolean value)
Sets the value of the sĂșecified OUTPUT pin |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PinAdapter()
| Method Detail |
|---|
public static PinAdapter getPinAdapter(PinAdapterListener listener)
listener - Interface for hanling events from PINs
public void openDriver()
public void closeDriver()
public void submitPinConfiguration(PinConfiguration newPinConfiguration)
PinConfiguration.
newPinConfiguration - Pin configurationpublic PinConfiguration getPinConfiguration()
public int getPinDirection(int pinIndex)
pinIndex - pin id
PinConfiguration.PIN_DIRECTION_OUTPUT - output pinPinConfiguration.PIN_DIRECTION_OUTPUT - input pinpublic int getPinMode(int pinIndex)
pinIndex - pin id
PinConfiguration.PIN_MODE_OPEN - pin is opened and is activePinConfiguration.PIN_MODE_CLOSE _ pin is closed, not usable
public boolean readPinValue(int pinIndex)
throws PinIOException
pinIndex - pin id
PinIOException - in case there was a problem with pin
public void writePinValue(int pinIndex,
boolean value)
throws PinIOException
value - True or FalsepinIndex - pin id
PinIOException - in case there was a problem with pin
public void startPoolingPin(int pinIndex)
throws PinIOException
PinAdapterListener.onPinValueChanged(int, boolean) is called
pinIndex - pin id
PinIOException - in case there was a problem with pin
public void stopPoolingPin(int pinIndex)
throws PinIOException
pinIndex - pin id
PinIOException - in case there was a problem with pinpublic void onURCEvent(java.lang.String urc)
onURCEvent in interface ATCommanderListenerurc -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||