Example code for automatically reconnecting

Hi.

Is there any full example code for Android on how to reconnect automatically to the device and resume operation, with full serialization/deserialization?
For example, if the device goes out of range, disconnects and then comes close again it should connect. Or even better in the mwBoard class add a reconnect automatically option.

I tried some basic reconnecting every minute on a device not in range but after a while I then get:

java.lang.NullPointerException
10-15 14:05:23.066 28761-32343/? E/AndroidRuntime:     at com.mbientlab.metawear.MetaWearBleService$DefaultMetaWearBoardAndroidImpl.close(MetaWearBleService.java:659)
10-15 14:05:23.066 28761-32343/? E/AndroidRuntime:     at com.mbientlab.metawear.MetaWearBleService$DefaultMetaWearBoardAndroidImpl.connect(MetaWearBleService.java:673)

Comments

This discussion has been closed.