turning off bluetooth

Hi all,

I was monkey testing my app and tried to turn off bluetooth while the app was running. I noticed a bug that is probably caused by my side but the error stack is all about MetaWearBleService:

06-08 20:15:45.231    4335-4335/ E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothGattDescriptor.setValue(byte[])' on a null object reference
            at com.mbientlab.metawear.api.MetaWearBleService$MetaWearControllerImpl$1.execAction(MetaWearBleService.java:528)
            at com.mbientlab.metawear.api.MetaWearBleService.execGattAction(MetaWearBleService.java:397)
            at com.mbientlab.metawear.api.MetaWearBleService.access$700(MetaWearBleService.java:80)
            at com.mbientlab.metawear.api.MetaWearBleService$1.run(MetaWearBleService.java:288)
            at android.os.Handler.handleCallback(Handler.java:739)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5312)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)


Firmware v. 1.0.3
Android MetaWear api v 1.8.0

Any suggestion would be greatly appreciated.

Cheers.

Bio



Comments

  • That line of code corresponds to code that is setting up the Bluetooth gatt descriptors.  It would appear that turning off the BT radio will return a null for getDescriptor method.
This discussion has been closed.