golioth / golioth-zephyr-sdk

Golioth SDK For Zephyr
https://www.golioth.io
Apache License 2.0
68 stars 19 forks source link

FR: Method to query state of Golioth cloud connection #159

Closed ramb0t closed 2 years ago

ramb0t commented 2 years ago

It would be handy to have a way to query the state of the Golioth cloud connection, connected/disconnected etc. This would helo with usability for the end-user. Then for example we could have status LEDs on a device to show network connectivity and cloud connectivity status and help with debugging troublesome devices by showing potential network issues at a glance.

https://discord.com/channels/819247807662915605/819251195940044800/938741598559305769

vitprajzler commented 2 years ago

Good point, added to our backlog.

ncmiller commented 2 years ago

This was added in https://github.com/golioth/golioth-zephyr-sdk/pull/226.

https://github.com/golioth/golioth-zephyr-sdk/blob/main/include/net/golioth.h#L162-L172

/**
 * @brief Check if client is connected to Golioth
 *
 * Check if client instance is connected to Golioth.
 *
 * @param client Client instance.
 *
 * @retval true When client is connected to Golioth.
 * @retval false When client is not connected to Golioth.
 */
bool golioth_is_connected(struct golioth_client *client);

Closing.