Skip to content

Instantly share code, notes, and snippets.

@Morozov-5F
Created August 18, 2017 15:11
Show Gist options
  • Save Morozov-5F/fffd9c750d9ba070798293435a6fcc96 to your computer and use it in GitHub Desktop.
Save Morozov-5F/fffd9c750d9ba070798293435a6fcc96 to your computer and use it in GitHub Desktop.
Azure connection status management
static void
s_azure_client_connection_status_cb(
IOTHUB_CLIENT_CONNECTION_STATUS result,
IOTHUB_CLIENT_CONNECTION_STATUS_REASON reason,
void * ctx)
{
const char * connection_results[] =
{
"ONLINE",
"OFFLINE"
};
const char * connection_reasons[] =
{
"EXPIRED SAS TOKEN",
"DEVICE DISABLED",
"BAD CREDENTIAL",
"RETRY EXPIRED",
"NO NETWORK",
"COMMUNICATION ERROR",
"OK"
};
UNUSED(ctx);
TRACE("Azure connection status: %s; reason: %s",
connection_results[result], connection_reasons[reason]);
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment