Skip to content

Instantly share code, notes, and snippets.

@kiryuxxu
Created July 7, 2016 08:04
Show Gist options
  • Save kiryuxxu/71eb3864f66340fda2b0324aa27f2b35 to your computer and use it in GitHub Desktop.
Save kiryuxxu/71eb3864f66340fda2b0324aa27f2b35 to your computer and use it in GitHub Desktop.
mKonashiManager.i2cStartCondition()
.then(mKonashiManager.<BluetoothGattCharacteristic>i2cReadPipe(1, (byte) 0x01))
.then(new DonePipe<byte[], byte[], BletiaException, Void>() {
@Override
public Promise<byte[], BletiaException, Void> pipeDone(byte[] result) {
// 0x01 の値を処理
return mKonashiManager.i2cRead(1, (byte)0x02);
}
})
.then(new DonePipe<byte[], byte[], BletiaException, Void>() {
@Override
public Promise<byte[], BletiaException, Void> pipeDone(byte[] result) {
// 0x02 の値を処理
return mKonashiManager.i2cRead(1, (byte) 0x03);
}
})
.then(new DoneCallback<byte[]>() {
@Override
public void onDone(final byte[] result) {
// 0x03 の値を処理
}
})
.then(mKonashiManager.<byte[]>i2cStopConditionPipe());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment