package com.uxxu.konashi.lib.stores;

import com.uxxu.konashi.lib.Konashi;
import com.uxxu.konashi.lib.dispatcher.CharacteristicDispatcher;
import com.uxxu.konashi.lib.dispatcher.I2cStoreUpdater;

/**
 * Created by izumin on 9/20/15.
 */
public class I2cStore implements Store {
    private byte mMode = 0;
    private byte[] mReadData = new byte[Konashi.I2C_DATA_MAX_LENGTH];
    private int mReadDataLength = 0;
    private byte mReadAddress = 0;

    public I2cStore(CharacteristicDispatcher<I2cStore, I2cStoreUpdater> dispatcher) {
        for (int i = 0; i < mReadData.length; i++) { mReadData[i] = 0; }
        dispatcher.setStore(this);
    }

    public byte getMode() {
        return mMode;
    }

    public void setMode(byte mode) {
        mMode = mode;
    }

    public byte[] getReadData() {
        return mReadData;
    }

    public void setReadData(byte[] readData) {
        mReadData = readData;
    }

    public int getReadDataLength() {
        return mReadDataLength;
    }

    public void setReadDataLength(int readDataLength) {
        mReadDataLength = readDataLength;
    }

    public byte getReadAddress() {
        return mReadAddress;
    }

    public void setReadAddress(byte readAddress) {
        mReadAddress = readAddress;
    }
}

@@ -1262,11 +1262,189 @@
 s;%0A    %7D
+%0A%0A    public boolean isEnabled() %7B%0A        return (mMode == Konashi.I2C_ENABLE)%0A                %7C%7C (mMode == Konashi.I2C_ENABLE_100K) %7C%7C (mMode == Konashi.I2C_ENABLE_400K);%0A    %7D
 %0A%7D%0A

Add I2cStore#isEnabled()