@@ -0,0 +1,2953 @@
+// vim: et sw=4 sts=4 tabstop=4%0Apackage com.issc.gatt;%0A%0Aimport com.issc.Bluebit;%0Aimport com.issc.util.Log;%0A%0Aimport java.util.List;%0Aimport java.util.UUID;%0A%0Aimport android.bluetooth.BluetoothDevice;%0A%0Aimport com.samsung.android.sdk.bt.gatt.BluetoothGatt;%0Aimport com.samsung.android.sdk.bt.gatt.BluetoothGattCallback;%0Aimport com.samsung.android.sdk.bt.gatt.BluetoothGattCharacteristic;%0Aimport com.samsung.android.sdk.bt.gatt.BluetoothGattDescriptor;%0Aimport com.samsung.android.sdk.bt.gatt.BluetoothGattService;%0A%0A/**%0A * This is a wrapper.%0A *%0A * It will be an interface to help us to avoid depending on any specific%0A * platform.%0A **/%0Apublic class Gatt %7B%0A%0A    public final static int GATT_SUCCESS = BluetoothGatt.GATT_SUCCESS;%0A%0A    private BluetoothGatt mGatt;%0A%0A    public Gatt(BluetoothGatt gatt) %7B%0A        mGatt = gatt;%0A    %7D%0A%0A    public BluetoothGatt getGatt() %7B%0A        return mGatt;%0A    %7D%0A%0A    public void cancelConnection(BluetoothDevice device) %7B%0A        mGatt.cancelConnection(device);%0A    %7D%0A%0A    public boolean connect(BluetoothDevice device, boolean auto) %7B%0A        return mGatt.connect(device, auto);%0A    %7D%0A%0A    public List%3CBluetoothDevice%3E getConnectedDevices() %7B%0A        return mGatt.getConnectedDevices();%0A    %7D%0A%0A    public boolean discoverServices(BluetoothDevice device) %7B%0A        return mGatt.discoverServices(device);%0A    %7D%0A%0A    public int getConnectionState(BluetoothDevice device) %7B%0A        return mGatt.getConnectionState(device);%0A    %7D%0A%0A    public BluetoothGattService getService(BluetoothDevice device, UUID uuid) %7B%0A        return mGatt.getService(device, uuid);%0A    %7D%0A%0A    public List%3CBluetoothGattService%3E getServices(BluetoothDevice device) %7B%0A        return mGatt.getServices(device);%0A    %7D%0A%0A    public boolean isBLEDevice(BluetoothDevice device) %7B%0A        return mGatt.isBLEDevice(device);%0A    %7D%0A%0A    public boolean readCharacteristic(BluetoothGattCharacteristic characteristic) %7B%0A        return mGatt.readCharacteristic(characteristic);%0A    %7D%0A%0A    public boolean readDescriptor(BluetoothGattDescriptor descriptor) %7B%0A        return mGatt.readDescriptor(descriptor);%0A    %7D%0A%0A    public boolean registerApp(BluetoothGattCallback callback) %7B%0A        return mGatt.registerApp(callback);%0A    %7D%0A%0A    public boolean removeBond(BluetoothDevice device) %7B%0A        return mGatt.removeBond(device);%0A    %7D%0A%0A    public boolean setCharacteristicNotification(BluetoothGattCharacteristic chr, boolean enable) %7B%0A        return mGatt.setCharacteristicNotification(chr, enable);%0A    %7D%0A%0A    public boolean startScan() %7B%0A        return mGatt.startScan();%0A    %7D%0A%0A    public void stopScan() %7B%0A        mGatt.stopScan();%0A    %7D%0A%0A    public void unregisterApp() %7B%0A        mGatt.unregisterApp();%0A    %7D%0A%0A    public boolean writeCharacteristic(BluetoothGattCharacteristic chr) %7B%0A        return mGatt.writeCharacteristic(chr);%0A    %7D%0A%0A    public boolean writeDescriptor(BluetoothGattDescriptor descriptor) %7B%0A        return mGatt.writeDescriptor(descriptor);%0A    %7D%0A%7D%0A%0A

Add Gatt