- 最新
- 最多得票
- 最多評論
Hi Frank. Please be aware that FreeRTOS BLE Android SDK (and indeed the iOS one too) is deprecated as of July 31. Please check out the updated README.
We don't have any direct access to BLE functions. We don't know how to query for the services and characteristics as we would if we were writing our own code.
This would seem to be a case of starting with this SDK and iterating it to suit your needs. The following file is where the SDK is reading and writing to BLE characteristics (and calling the Android BLE APIs): https://github.com/aws/amazon-freertos-ble-android-sdk/blob/1f61f341682a2b5736d246f4aab25dc488cad2f3/amazonfreertossdk/src/main/java/software/amazon/freertos/amazonfreertossdk/AmazonFreeRTOSDevice.java.
Service discovery is triggered here: https://github.com/aws/amazon-freertos-ble-android-sdk/blob/1f61f341682a2b5736d246f4aab25dc488cad2f3/amazonfreertossdk/src/main/java/software/amazon/freertos/amazonfreertossdk/AmazonFreeRTOSDevice.java#L1015.
Discovered services are processed here: https://github.com/aws/amazon-freertos-ble-android-sdk/blob/1f61f341682a2b5736d246f4aab25dc488cad2f3/amazonfreertossdk/src/main/java/software/amazon/freertos/amazonfreertossdk/AmazonFreeRTOSDevice.java#L494.
相關內容
- 已提問 1 年前
- AWS 官方已更新 2 年前
Thank you for the response. We ended up simply reconnecting to the device via our own code once we were finished with the RTOS functions.
I'm a little concerned that these libraries are now deprecated. We are just finishing up a yearlong project. Is it just the app SDKs that are being deprecated, or will the firmware on the device also need to be updated? Is there a replacement? Do you know why it's being deprecated?
Since our iOS app doesn't use the actual RTOS SDK, is it safe to leave that as-is? I guess what I'm asking is whether the protocols themselves are deprecated.
Frank
Nothing will stop working. It just means the repos are no longer maintained.
To add some context to Greg's excellent answer (since I was the one who pushed the deprecation notice) - the amazon-freertos-ble-ios-sdk and amazon-freertos-ble-android-sdk repositories were deprecated for several key reasons. The first being lack of maintenance and funding. The library was adopted by very few people/teams and because of the packages were a bit neglected since feature requests came in for other libraries much faster. For example the AFR BLE SDKs were several versions behind on dependencies and iOS/Android version support. Additionally the overall demos for this project show a way of handling BLE for IoT Devices that we no longer recommend. These demos implement a custom way of doing a sort of MQTT message relay from a BLE IoT device to a phone which then passes the message through to AWS IoT Core (not the most secure). For these reasons we decided to deprecate the AmazonFreeRTOS BLE SDKs.
Now - with all this said, the AWS mobile SDKs (https://docs.amplify.aws/start/q/integration/android/, https://docs.amplify.aws/start/q/integration/ios/) are available and fully supported. Each OS also has a slew of resources for their BLE APIs. I would HIGHLY recommend you get started with those when building your application. Not only will you have newer and better features but the Amplify team does a great job supporting users.
The IoT device I'm working with was not developed by my company. My understanding is that the people who wrote the firmware on the device used an RTOS framework provided by Amazon. When we asked them how to access the device, they referred us to the FreeRTOS SDKs and said this was what we needed to use. Is it just the mobile SDKs that are being deprecated, or is the firmware on the device also deprecated?
I'd also like to say - as a developer I prefer not to use third-party libraries in my code at all. I have written many iOS apps that act as BLE clients without having to resort to using third-party code. I tried to do the same in this case. While I did manage to avoid installing the AmazonFreeRTOS SDKs in my iOS app, I had to do a lot of work to figure out the protocol on my own by reading the source code. And, whoever wrote this chose to use something called CBORCoding to exchange data with the device, which I had to end up using because I didn't have time to rewrite it myself.