最終更新:2013-01-22 (火) 13:08:05 (4109d)  

ioio.lib.util.BaseIOIOLooper
Top / ioio.lib.util.BaseIOIOLooper

public class BaseIOIOLooper implements IOIOLooper

A convenience implementation of IOIOLooper.

This base class provides no-op implementations for all methods and provides the ioio_? field for subclasses.

プロパティ

  • ioio_

ソースコード

public class BaseIOIOLooper implements IOIOLooper {
	protected IOIO ioio_;

	@Override
	public final void setup(IOIO ioio) throws ConnectionLostException,
			InterruptedException {
		ioio_ = ioio;
		setup();
	}

	/**
	 * This method will be called as soon as connection to the IOIO has been
	 * established. Typically, this will include opening pins and modules using
	 * the openXXX() methods of the {@link #ioio_} field.
	 * 
	 * @throws ConnectionLostException
	 *             The connection to the IOIO has been lost.
	 * @throws InterruptedException
	 *             The thread has been interrupted.
	 */
	protected void setup() throws ConnectionLostException, InterruptedException {
	}

	@Override
	public void loop() throws ConnectionLostException, InterruptedException {
		Thread.sleep(20);
	}

	@Override
	public void disconnected() {
	}

	@Override
	public void incompatible() {
	}
}