|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IOIOLooper
A handler implementing interaction with a single IOIO over a single
connection period. The interface utilizes a basic workflow for working with a
IOIO instance: as soon as a connection is established, setup(IOIO)
will be called. Then, the loop()
method will be called repeatedly as
long as the connection is alive. Last, the disconnected()
method
will be called upon losing the connection (as result of physical
disconnection, closing the application, etc). In case a IOIO with an
incompatible firmware is encountered, incompatible()
will be called
instead of setup(IOIO)
, and the IOIO instance is entirely useless,
until eventually disconnected()
gets called.
Method Summary | |
---|---|
void |
disconnected()
Subclasses should override this method for performing operations to be done once as soon as IOIO communication is lost or closed. |
void |
incompatible()
Subclasses should override this method for performing operations to be done if an incompatible IOIO firmware is detected. |
void |
loop()
Subclasses should override this method for performing operations to be done repetitively as long as IOIO communication persists. |
void |
setup(IOIO ioio)
Subclasses should override this method for performing operations to be done once as soon as IOIO communication is established. |
Method Detail |
---|
void setup(IOIO ioio) throws ConnectionLostException, java.lang.InterruptedException
ConnectionLostException
java.lang.InterruptedException
void loop() throws ConnectionLostException, java.lang.InterruptedException
ConnectionLostException
java.lang.InterruptedException
void disconnected()
setup(IOIO)
must not be used from within this method - it is
invalid. This method should not block for long, since it may cause an
ANR.
void incompatible()
setup(IOIO)
must not be used from within this method -
it is invalid. This method will only be called once, until a compatible
IOIO is connected (i.e. setup(IOIO)
gets called).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |