最終更新:2013-01-22 (火) 13:22:34 (4111d)  

IOIO/開発
Top / IOIO / 開発

メモ

Application V3.22 (App-IOIO0322)でAPIが変更

  • Added buffered reading to AnalogInput?. Allows reading acquired samples one by one.
  • Added batch operations to the IOIO interface. This allows the client to group several write operations together, thus reducing latency and jitter.
  • ioio.lib.util.AbstractIOIOActivity? is now deprecated. Clients should move to ioio.lib.util.android.IOIOActivity. The latter is similar, but not identical.
    • Notably, IOIOThread? has been replaced by IOIOLooper?, which is an interface. Likewise, createIOIOThread?() is now createIOIOLooper?().
    • The implementation of this interface is encouraged to use ioio.lib.util.BaseIOIOLooper as a base class. Converting from the old style to the new style should be trivial. See the example projects as reference.
  • Added ioio.lib.util.android.IOIOService?, which serves as a base class for creating Android services using IOIO.
  • Added ioio.lib.util.IOIOApplicationHelper?, which can be used by clients that need a different model than the Activity or Service above.
  • Added IOIO.getState() for querying the connection state.

クラスとか

ioio.lib.util.android.IOIOActivity

ioio.lib.util.BaseIOIOLooper

  • ioio.lib.util.BaseIOIOLooperでioio_ = ioio;している
  • This is the thread on which all the IOIO activity happens. It will be run every time the application is resumed and aborted when it is paused.
  • The method setup() will be called right after a connection with the IOIO has been established (which might happen several times!).
  • Then, loop() will be called repetitively until the IOIO gets disconnected.
    class Looper extends BaseIOIOLooper {
    	@Override
    	protected void setup() throws ConnectionLostException {
    	}
    	@Override
    	public void loop() throws ConnectionLostException {
    		try {
    			Thread.sleep(100);
    		} catch (InterruptedException e) {
    		}
    	}
    }

サンプル

  • HelloIOIOとIOIOLibをEclipseでインポートしてビルド。

サンプル