• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help How to deal with AWS IoT

Hi,

I'm developing an app which deals with a hardware over the cloud and I am using Amazon website for this purpose. I have seen Ring and Nest apps and I am trying to do like them. When I send new setting to the hardware by the app I don't want to block the app until the response comes from the hardware, so to achieve that I make the hardware to responses in a way which makes me know what this response for, to be more clear when the app sends a request to update the volume, the app will send a JSON string to a specific topic "****/settings", like this:
{ "volume": "10"}
Then the hardware after it achieves the request it responses to another topic "****/settings/reply", like this:
{ "volume": "10", "error":200}
The error attribute helps me to know if the process was successful, if it is 200 means it updated the volume successfully.
My question is, can I trust the network and the cloud so the request won't be missed and all the requests' replies will be received in order, I can make sure the app will send them in order and the hardware won't take much time to deal with each request so it's supposed it won't miss anyone and it will respond them in order.
I am worried about facing a problem which the user sends many requests of updating the volume like make it 10 then 7 then 5, and because of the routing in the network and the task schedules in the CPU of the cloud their responds will received in the app in this order 5, 10, 7, so this will make conflict between the app and the hardware.
As I mentioned before I try to do like Ring and Nest and what I notice when you update your thermostat in the Nest app you don't feel any latency between the app and the hardware the same thing goes for Ring app.
One more thing, I don't update the UI until I receive the response for the request, for example I don't change the switch of allow notifications until I receive the response from the hardware telling me that the process was successful, so if there is any latency the user will feel that he didn't press the switch enough so he will press it again, how can I avoid any latency so this case won't happen?

Thanks in advance.
 
Back
Top Bottom