// vim: et sw=4 sts=4 tabstop=4
package com.issc.impl;

import com.issc.Bluebit;
import com.issc.util.Log;
import com.issc.util.TransactionQueue;
import com.issc.util.TransactionQueue.Transaction;

import com.samsung.android.sdk.bt.gatt.BluetoothGatt;
import com.samsung.android.sdk.bt.gatt.BluetoothGattCharacteristic;
import com.samsung.android.sdk.bt.gatt.BluetoothGattDescriptor;

public class GattTransaction implements Transaction {

    public BluetoothGattCharacteristic chr;
    public byte[] value;
    public boolean isWrite;
    public long timeout;

    public GattTransaction(BluetoothGattCharacteristic c, byte[] v) {
        this(c, v, true);
    }

    public GattTransaction(BluetoothGattCharacteristic c, byte[] v, long t) {
        this(c, v, true, t);
    }

    public GattTransaction(BluetoothGattCharacteristic c, byte[] v, boolean w) {
        this(c, v, w, Transaction.TIMEOUT_NONE);
    }

    public GattTransaction(BluetoothGattCharacteristic c,
            byte[] v,
            boolean w,
            long t) {
        chr = c;
        value = v;
        isWrite = w;
        timeout = t;
    }

    @Override
    public long getTimeout() {
        return timeout;
    }
}


@@ -477,16 +477,61 @@
 ic chr;%0A
+    public BluetoothGattDescriptor     desc;%0A
     publ
@@ -1161,24 +1161,730 @@
 = t;%0A    %7D%0A%0A
+    public boolean isForCharacteristic() %7B%0A        return (chr != null);%0A    %7D%0A%0A    public GattTransaction(BluetoothGattDescriptor d, byte%5B%5D v) %7B%0A        this(d, v, true);%0A    %7D%0A%0A    public GattTransaction(BluetoothGattDescriptor d, byte%5B%5D v, long t) %7B%0A        this(d, v, true, t);%0A    %7D%0A%0A    public GattTransaction(BluetoothGattDescriptor d, byte%5B%5D v, boolean w) %7B%0A        this(d, v, w, Transaction.TIMEOUT_NONE);%0A    %7D%0A%0A    public GattTransaction(BluetoothGattDescriptor d,%0A            byte%5B%5D v,%0A            boolean w,%0A            long t) %7B%0A        desc = d;%0A        value = v;%0A        isWrite = w;%0A        timeout = t;%0A    %7D%0A%0A    public boolean isForDescriptor() %7B%0A        return (desc != null);%0A    %7D%0A%0A
     @Overrid

support description