Android ble를 사용하여 응용 프로그램을 개발하고 있습니다. 응용 프로그램은 ble를 사용하여 외부 장치와 연결합니다. 외부 장치에는 데이터를 기록하는 센서가 있으며 안드로이드 장치가 범위에 들어 오면 데이터 전송이 시작됩니다. 두 장치가 연결되어있는 경우에 특정 특성을 변경하고, 데이터는 이제이 5-10 분 이내에 센서에 의해 수집 된 데이터에 대해 잘 작동BluetoothServiceJni : 콜백 'btgattc_notify_cb'에 의해 예외가 발생했습니다.
setCharacteristicNoification() --> onCharactericticChanged()
통해 전송된다면 안드로이드 앱 통지를 등록한다. 그러나 장치가 15 분 넘게 범위를 벗어나이 모든 데이터를 전송해야하는 경우 앱이 종료됩니다.
여러 포럼에 대한 책을 읽은에, 나는 시스템 로그를 확인하고이 오류를 발견
BluetoothServiceJni: An exception was thrown by callback 'btgattc_notify_cb'.
BluetoothServiceJni: android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:496)
at android.bluetooth.IBluetoothGattCallback$Stub$Proxy.onNotify(IBluetoothGattCallback.java:840)
at com.android.bluetooth.gatt.GattService.onNotify(GattService.java:838)
을이 예외 메시지는 내가이 메시지를 수 차례 반복 한 후
BtGatt.AdvertiseManager: stop advertise for client 5
BtGatt.GattService: onAdvertiseInstanceDisabled() - clientIf=5, status=0
BtGatt.GattService: Client app is not null!
BtGatt.AdvertiseManager: failed onAdvertiseInstanceDisabled
android.os.DeadObjectException at
android.os.BinderProxy.transactNative(Native Method) at
android.os.BinderProxy.transact(Binder.java:496) at android.bluetooth.IBluetoothGattCallback$Stub$Proxy.onMultiAdvertiseCallback(IBluetoothGattCallback.java:874)at com.android.bluetooth.gatt.GattService.onAdvertiseInstanceDisabled(GattService.java:1242) at com.android.bluetooth.gatt.AdvertiseManager$AdvertiseNative.stopAdvertising(AdvertiseManager.java:318)at com.android.bluetooth.gatt.AdvertiseManager$ClientHandler.handleStopAdvertising(AdvertiseManager.java:212) at com.android.bluetooth.gatt.AdvertiseManager$ClientHandler.handleMessage(AdvertiseManager.java:175) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.os.HandlerThread.run(HandlerThread.java:61)
BtGatt.AdvertiseManager: app died - unregistering client : 5
그리고 마지막으로 이 메시지 :
BtGatt.ContextMap: Context not found for ID 5
내 코드의 문제점 및 코드의 어떤 부분이이 문제의 원인인지 잘 모르겠습니다. 누구든지이 문제가 어떤 것인지 밝힐 수 있습니까?
권. 어떤 안드로이드 버전과 전화가 있습니까? – Emil
여러 장치에서 Lollipop 및 Marshmellow를 사용하고있었습니다. – Saurabh
콜백에서 얼마나 많은 일을하십니까? – Emil