@@ -0,0 +1,1019 @@
+package com.uxxu.konashi.lib.action;%0A%0Aimport android.bluetooth.BluetoothGattService;%0A%0Aimport com.uxxu.konashi.lib.KonashiUUID;%0Aimport com.uxxu.konashi.lib.util.I2cUtils;%0A%0Aimport java.util.UUID;%0A%0A/**%0A * Created by izumin on 9/21/15.%0A */%0Apublic class I2cWriteAction extends KonashiWriteCharacteristicAction %7B%0A%0A    private static final UUID UUID = KonashiUUID.I2C_WRITE_UUID;%0A%0A    private final byte mAddress;%0A    private final byte%5B%5D mData;%0A%0A    public I2cWriteAction(BluetoothGattService service, byte address, byte%5B%5D data) %7B%0A        super(service, UUID);%0A        mAddress = address;%0A        mData = data;%0A    %7D%0A%0A    @Override%0A    protected void setValue() %7B%0A        byte%5B%5D value = new byte%5B20%5D;%0A        value%5B0%5D = (byte) mData.length;%0A        value%5B1%5D = (byte) ((mAddress %3C%3C 1) & 0xfe);%0A        System.arraycopy(mData, 0, value, 2, mData.length);%0A        getCharacteristic().setValue(value);%0A    %7D%0A%0A    @Override%0A    protected boolean hasValidParams() %7B%0A        return I2cUtils.isValidDataLength(mData.length);%0A    %7D%0A%7D%0A

Implement I2cWriteAction