Loading android/app/jni/com_android_bluetooth_gatt.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -454,7 +454,7 @@ void btgatts_register_app_cb(int status, int server_if, bt_uuid_t *uuid) checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__); } void btgatts_connection_cb(int conn_id, int connected, bt_bdaddr_t *bda) void btgatts_connection_cb(int conn_id, int server_if, int connected, bt_bdaddr_t *bda) { CHECK_CALLBACK_ENV Loading @@ -465,7 +465,7 @@ void btgatts_connection_cb(int conn_id, int connected, bt_bdaddr_t *bda) jstring address = sCallbackEnv->NewStringUTF(c_address); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onClientConnected, address, connected, conn_id); address, connected, conn_id, server_if); sCallbackEnv->DeleteLocalRef(address); checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__); } Loading Loading @@ -657,7 +657,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) { // Server callbacks method_onServerRegistered = env->GetMethodID(clazz, "onServerRegistered", "(IIJJ)V"); method_onClientConnected = env->GetMethodID(clazz, "onClientConnected", "(Ljava/lang/String;ZI)V"); method_onClientConnected = env->GetMethodID(clazz, "onClientConnected", "(Ljava/lang/String;ZII)V"); method_onServiceAdded = env->GetMethodID(clazz, "onServiceAdded", "(IIIIJJI)V"); method_onIncludedServiceAdded = env->GetMethodID(clazz, "onIncludedServiceAdded", "(IIII)V"); method_onCharacteristicAdded = env->GetMethodID(clazz, "onCharacteristicAdded", "(IIJJII)V"); Loading android/app/src/com/android/bluetooth/gatt/GattService.java +10 −10 Original line number Diff line number Diff line Loading @@ -1141,22 +1141,22 @@ public class GattService extends ProfileService { mHandleMap.deleteService(serverIf, srvcHandle); } void onClientConnected(String address, boolean connected, int connId) void onClientConnected(String address, boolean connected, int connId, int serverIf) throws RemoteException { if (DBG) Log.d(TAG, "onConnected() connId=" + connId + ", address=" + address + ", connected=" + connected); Iterator<ServerMap.App> i = mServerMap.mApps.iterator(); while(i.hasNext()) { ServerMap.App entry = i.next(); ServerMap.App app = mServerMap.getById(serverIf); if (app == null) return; if (connected) { mServerMap.addConnection(entry.id, connId, address); mServerMap.addConnection(serverIf, connId, address); } else { mServerMap.removeConnection(entry.id, connId); } entry.callback.onServerConnectionState((byte)0, entry.id, connected, address); mServerMap.removeConnection(serverIf, connId); } app.callback.onServerConnectionState((byte)0, serverIf, connected, address); } void onAttributeRead(String address, int connId, int transId, Loading Loading
android/app/jni/com_android_bluetooth_gatt.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -454,7 +454,7 @@ void btgatts_register_app_cb(int status, int server_if, bt_uuid_t *uuid) checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__); } void btgatts_connection_cb(int conn_id, int connected, bt_bdaddr_t *bda) void btgatts_connection_cb(int conn_id, int server_if, int connected, bt_bdaddr_t *bda) { CHECK_CALLBACK_ENV Loading @@ -465,7 +465,7 @@ void btgatts_connection_cb(int conn_id, int connected, bt_bdaddr_t *bda) jstring address = sCallbackEnv->NewStringUTF(c_address); sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onClientConnected, address, connected, conn_id); address, connected, conn_id, server_if); sCallbackEnv->DeleteLocalRef(address); checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__); } Loading Loading @@ -657,7 +657,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) { // Server callbacks method_onServerRegistered = env->GetMethodID(clazz, "onServerRegistered", "(IIJJ)V"); method_onClientConnected = env->GetMethodID(clazz, "onClientConnected", "(Ljava/lang/String;ZI)V"); method_onClientConnected = env->GetMethodID(clazz, "onClientConnected", "(Ljava/lang/String;ZII)V"); method_onServiceAdded = env->GetMethodID(clazz, "onServiceAdded", "(IIIIJJI)V"); method_onIncludedServiceAdded = env->GetMethodID(clazz, "onIncludedServiceAdded", "(IIII)V"); method_onCharacteristicAdded = env->GetMethodID(clazz, "onCharacteristicAdded", "(IIJJII)V"); Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +10 −10 Original line number Diff line number Diff line Loading @@ -1141,22 +1141,22 @@ public class GattService extends ProfileService { mHandleMap.deleteService(serverIf, srvcHandle); } void onClientConnected(String address, boolean connected, int connId) void onClientConnected(String address, boolean connected, int connId, int serverIf) throws RemoteException { if (DBG) Log.d(TAG, "onConnected() connId=" + connId + ", address=" + address + ", connected=" + connected); Iterator<ServerMap.App> i = mServerMap.mApps.iterator(); while(i.hasNext()) { ServerMap.App entry = i.next(); ServerMap.App app = mServerMap.getById(serverIf); if (app == null) return; if (connected) { mServerMap.addConnection(entry.id, connId, address); mServerMap.addConnection(serverIf, connId, address); } else { mServerMap.removeConnection(entry.id, connId); } entry.callback.onServerConnectionState((byte)0, entry.id, connected, address); mServerMap.removeConnection(serverIf, connId); } app.callback.onServerConnectionState((byte)0, serverIf, connected, address); } void onAttributeRead(String address, int connId, int transId, Loading