Unfortunately, right now, there is no way to know if an ASR-1 is connected to the cloud or not from the MCU.
Because the ASR-1 is a bluetooth device, it does not maintain a persistent connection to the cloud - it broadcasts an advertising packet that indicates it has data to send to the cloud, and a hub (usually the mobile app acting as a hub) will connect to the ASR-1, pick up the data that needs to be sent, and then disconnect. There would not be a stable “connected/not connected” status that the MCU would be able to read to know if there was a connection.
However, one of the pieces of information that the ASR-1 knows is whether an outgoing update is “pending” (un-sent) or not. This way, we could check the “pending” status of an attribute update and if we see that status go away, we’d know that the ASR-1 MUST have connected to the cloud in order to clear that status. It’s not a perfect “connection” flag, but it will tell you if the ASR-1 has connected to the cloud recently or not.
This pending status is not currently provided to the MCU through afLib, but we intend to provide that status in a future update to afLib. For now, I’m sorry, but I don’t have a workaround for you, but when we release the next version of afLib (hopefully not too long from now) you should be able to query this pending status to see if the ASR-1 is connecting to the cloud or not.