@@ -0,0 +1,2668 @@
+// vim: et sw=4 sts=4 tabstop=4%0A/*%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *%0A */%0A%0Apackage com.issc.gatt;%0A%0Aimport com.issc.Bluebit;%0Aimport com.issc.gatt.GattCharacteristic;%0Aimport com.issc.gatt.GattDescriptor;%0Aimport com.issc.gatt.GattService;%0Aimport com.issc.util.Log;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.UUID;%0A%0Aimport android.bluetooth.BluetoothDevice;%0Aimport android.bluetooth.BluetoothProfile;%0Aimport android.content.Context;%0A%0Apublic interface GattServer %7B%0A%0A    /**%0A     * Close this Bluetooth Gatt server.%0A     */%0A    public void close();%0A%0A    /**%0A     * Connect to a remote device.%0A     */%0A    public boolean connect(BluetoothDevice dev, boolean auto);%0A%0A    /**%0A     * Disconnects an established connection, or cancels a connection attempt currently in progress.%0A     */%0A    public void cancelConnection(BluetoothDevice dev);%0A    public void clearServices();%0A%0A    public GattService getService(UUID uuid);%0A    public List%3CGattService%3E getServices();%0A%0A    public boolean notifyCharacteristicChanged(BluetoothDevice dev, GattCharacteristic chr, boolean confirm);%0A    public boolean removeService(GattService srv);%0A    public boolean sendResponse(BluetoothDevice dev, int id, int status,int offset, byte%5B%5D value);%0A%0A    public interface Callback %7B%0A        public void onCharacteristicReadRequest(BluetoothDevice dev, int reqId, int offset, GattCharacteristic chrc);%0A        public void onCharacteristicWriteRequest(BluetoothDevice dev, int reqId, GattCharacteristic chrc, boolean preparedWrite,%0A                boolean responseNeeded, int offset, byte%5B%5D value);%0A%0A        public void onConnectionStateChange(BluetoothDevice dev, int status, int newState);%0A%0A        public void onDescriptorReadRequest(BluetoothDevice dev, int reqId, int offset,  GattDescriptor desc);%0A        public void onDescriptorWriteRequest(BluetoothDevice dev, int reqId, GattDescriptor desc, boolean prepareWrite,%0A                boolean responseNeeded, int offset, byte%5B%5D value);%0A%0A        public void onExecuteWrite(BluetoothDevice dev, int reqId, boolean execute);%0A        public void onServiceAdded(int status, GattService service);%0A    %7D%0A%7D%0A%0A

add GattServer interface