What does Toybox.Communications do when the paired device is not in range?

Former Member
Former Member

It looks like you call .transmit() to send the data, but what happens if there is no paired device within range? Does the message just fail and call ConnectionListener.onError(), or does it go into a mailbox, from where it is automatically sent the next time the paired device is within range? What about when receiving messages?

I'm just trying to send data from a Garmin app to an iPhone app, automatically, and only once per dataset. (The datasets are created by the user, so the user might have zero or multiple datasets waiting to transfer.) I hope I can just call the function and have it automatically send the data the next time the phone and watch are near each other. If not, I imagine I'll have to listen for the device to come in range, call the function, and listen for success or failure.

I'm a newbie developer, so maybe this is a basic question, but I don't see the answer in the docs, and I can't test it myself until I get ahold of physical devices, since I apparently can't simulate Bluetooth connections.

Thanks.