Description of changes:
disconnect() method in AmazonFreeRTOSDevice unregisters the broadcast receiver, which gets registered only on a valid connection. It throws an exception if the disconnect() is invoked before a valid connection is made.
Fix: Catch not registered exception while unregistering broadcast receiver.
Also moved gattclient.close() to first method being invoked.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: Fixes #13
Description of changes: disconnect() method in AmazonFreeRTOSDevice unregisters the broadcast receiver, which gets registered only on a valid connection. It throws an exception if the disconnect() is invoked before a valid connection is made.
Fix: Catch not registered exception while unregistering broadcast receiver. Also moved gattclient.close() to first method being invoked.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.