// Path: konashi-android-sdk/src/main/java/com/uxxu/konashi/lib/KonashiErrorType.java
// public enum KonashiErrorType implements BletiaErrorType{
//     INVALID_PARAMETER,
//     NOT_ENABLED_UART,
//     NOT_ENABLED_I2C,
//     INVALID_PIN_NUMBER,
//     INVALID_MODE,
//     INVALID_PULLUP_PARAM,
//     INVALID_OUTPUT_PARAM,
//     INVALID_DUTY_RATIO,
//     DATA_SIZE_TOO_LONG,
//     DATA_SIZE_TOO_SHORT,
//     INVALID_BAUDRATE,
//     INVALID_CONDITION,
//     INVALID_ENDIANNESS,
//     INVALID_SPEED,
//     UNSUPPORTED_OPERATION,
//     NO_ERROR;
// 
//     @Override
//     public int getCode() {
//         return -1;
//     }
// 
//     @Override
//     public String getName() {
//         return name();
//     }
// }


import android.bluetooth.BluetoothGattService;
import android.util.Log;
import com.uxxu.konashi.lib.KonashiErrorType;
import java.util.UUID;
import info.izumin.android.bletia.BletiaErrorType;
import info.izumin.android.bletia.BletiaException;
import info.izumin.android.bletia.action.WriteCharacteristicAction;
import info.izumin.android.bletia.wrapper.BluetoothGattWrapper;
package com.uxxu.konashi.lib.action;





/**
 * Created by izumin on 9/17/15.
 */
public abstract class KonashiWriteCharacteristicAction extends WriteCharacteristicAction {

    protected KonashiWriteCharacteristicAction(BluetoothGattService service, UUID uuid) {
        super(service, uuid);
    }

    @Override
    public boolean execute(BluetoothGattWrapper gattWrapper) {
        if (getCharacteristic() == null) {
            rejectIfParamsAreInvalid(KonashiErrorType.UNSUPPORTED_OPERATION);
            return false;
        }
        BletiaErrorType errorType = validate();
// Path: konashi-android-sdk/src/main/java/com/uxxu/konashi/lib/KonashiErrorType.java
// public enum KonashiErrorType implements BletiaErrorType{
//     INVALID_PARAMETER,
//     NOT_ENABLED_UART,
//     NOT_ENABLED_I2C,
//     INVALID_PIN_NUMBER,
//     INVALID_MODE,
//     INVALID_PULLUP_PARAM,
//     INVALID_OUTPUT_PARAM,
//     INVALID_DUTY_RATIO,
//     DATA_SIZE_TOO_LONG,
//     DATA_SIZE_TOO_SHORT,
//     INVALID_BAUDRATE,
//     INVALID_CONDITION,
//     INVALID_ENDIANNESS,
//     INVALID_SPEED,
//     UNSUPPORTED_OPERATION,
//     NO_ERROR;
// 
//     @Override
//     public int getCode() {
//         return -1;
//     }
// 
//     @Override
//     public String getName() {
//         return name();
//     }
// }


// Path: konashi-android-sdk/src/main/java/com/uxxu/konashi/lib/action/KonashiWriteCharacteristicAction.java
import android.bluetooth.BluetoothGattService;
import android.util.Log;
import com.uxxu.konashi.lib.KonashiErrorType;
import java.util.UUID;
import info.izumin.android.bletia.BletiaErrorType;
import info.izumin.android.bletia.BletiaException;
import info.izumin.android.bletia.action.WriteCharacteristicAction;
import info.izumin.android.bletia.wrapper.BluetoothGattWrapper;

package com.uxxu.konashi.lib.action;





/**
 * Created by izumin on 9/17/15.
 */
public abstract class KonashiWriteCharacteristicAction extends WriteCharacteristicAction {

    protected KonashiWriteCharacteristicAction(BluetoothGattService service, UUID uuid) {
        super(service, uuid);
    }

    @Override
    public boolean execute(BluetoothGattWrapper gattWrapper) {
        if (getCharacteristic() == null) {
            rejectIfParamsAreInvalid(KonashiErrorType.UNSUPPORTED_OPERATION);
            return false;
        }
        BletiaErrorType errorType = validate();
        if (errorType == KonashiErrorType.NO_ERROR) {