Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
Telemetry iot hub (#590)
Browse files Browse the repository at this point in the history
* [Telemetry] Add telemetry data in SDK for Iot Hub connection status

* Revert "[Telemetry] Add telemetry data in SDK for Iot Hub connection status"

This reverts commit 7a8aa6a.

* [Telemetry] [Temp] Add telemetry for iot hub creation in sdk

* [Telemetry] Fix parameter name

* [Telemetry][Temp] Remove unnecessary telemetry entries

* [Telemetry][Temp] Add telemetry.h
  • Loading branch information
helenlivsc authored and Sneezry committed Sep 27, 2017
1 parent 762219d commit dbc771c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "iothub_client_options.h"
#include "iothub_client_version.h"
#include <stdint.h>
#include "Telemetry.h"

#ifndef DONT_USE_UPLOADTOBLOB
#include "iothub_client_ll_uploadtoblob.h"
Expand Down Expand Up @@ -1403,6 +1404,39 @@ void IoTHubClient_LL_ConnectionStatusCallBack(IOTHUB_CLIENT_LL_HANDLE handle, IO
}
else
{
// Microsoft collects data to operate effectively and provide you the best experiences with our products.
// We collect data about the features you use, how often you use them, and how you use them.
switch(reason)
{
case IOTHUB_CLIENT_CONNECTION_EXPIRED_SAS_TOKEN:
if (status == IOTHUB_CLIENT_CONNECTION_UNAUTHENTICATED)
{
LogInfo(">>>Connection status: timeout");
}
break;
case IOTHUB_CLIENT_CONNECTION_DEVICE_DISABLED:
break;
case IOTHUB_CLIENT_CONNECTION_BAD_CREDENTIAL:
break;
case IOTHUB_CLIENT_CONNECTION_RETRY_EXPIRED:
break;
case IOTHUB_CLIENT_CONNECTION_NO_NETWORK:
if (status == IOTHUB_CLIENT_CONNECTION_UNAUTHENTICATED)
{
LogInfo(">>>Connection status: disconnected");
}
break;
case IOTHUB_CLIENT_CONNECTION_COMMUNICATION_ERROR:
break;
case IOTHUB_CLIENT_CONNECTION_OK:
if (status == IOTHUB_CLIENT_CONNECTION_AUTHENTICATED)
{
LogInfo(">>>Connection status: connected");
send_telemetry_data_async("", "Create", "IoT hub established");
}
break;
}

IOTHUB_CLIENT_LL_HANDLE_DATA* handleData = (IOTHUB_CLIENT_LL_HANDLE_DATA*)handle;

/*Codes_SRS_IOTHUBCLIENT_LL_25_114: [IoTHubClient_LL_ConnectionStatusCallBack shall call non-callback set by the user from IoTHubClient_LL_SetConnectionStatusCallback passing the status, reason and the passed userContextCallback.]*/
Expand Down
2 changes: 1 addition & 1 deletion AZ3166/src/cores/arduino/system/SystemVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#define DEVKIT_MAJOR_VERSION 1
#define DEVKIT_MINOR_VERSION 1
#define DEVKIT_PATCH_VERSION 0
#define DEVKIT_PATCH_VERSION 1


#ifdef __cplusplus
Expand Down

0 comments on commit dbc771c

Please sign in to comment.