When using observables within BluetoothLE, you should always use .Timeout(TimeSpan.FromSeconds(X)) to kill tasks that take too long. Android tends to hang on certain calls if a connection is broken during certain operations.
While this library tries to deal with all of the known Android issues to the best of its ability. You likely will encounter issues if you don’t follow the below:
- DO NOT hold a reference to an IPeripheral across scans UNLESS it is connected
- Don’t scan or do anything with the adapter while connected to the GATT
- Don’t overwhelm the radio. The library now has an internal queue to force operations to finish.
- GATT 133 will happen on Connect on occasion. Catch exceptions in the observable subscriptions.
- Bluetooth LE IS NOT GOOD for large payloads or things like JSON - keep it small and simple
- Scan for devices YOU work with. In most apps, you will almost always be scanning with a Service UUID
- Do NOT discover all services & characteristics. There is a performance cost with doing this. You are always best to work with the service/characteristics known to you