iothub_service_client_auth.h

APIs that allow a user (usually a device) to create and destroy a handle for use in Service client APIs.

Includes

#include "azure_macro_utils/macro_utils.h"
#include "umock_c/umock_c_prod.h"

Detailed Description

APIs that allow a user (usually a device) to create a handle for use in Service client APIs. The create API parses the given connection string and saves the IoTHub specific authentication info in the handle. The destory API deallocate all the resources allocated in the handle.

User will store the handle and use it as input parameter in consequent APIs. When the handle is not needed anymore user responsbility to call destory to free all the resources.

Functions

Function Name Description
IOTHUB_DEVICE_STATUSStrings
IOTHUB_DEVICE_STATUS_FromString
IOTHUB_DEVICE_CONNECTION_STATEStrings
IOTHUB_DEVICE_CONNECTION_STATE_FromString
IoTHubServiceClientAuth_CreateFromConnectionString Creates a IoT Hub service client handle for use it in consequent APIs.
IoTHubServiceClientAuth_CreateFromSharedAccessSignature Creates a IoT Hub service client handle for use it in consequent APIs.
IoTHubServiceClientAuth_Destroy Disposes of resources allocated by the IoT Hub Service Client.

Structures

IOTHUB_SERVICE_CLIENT_AUTH

Structure to store IoTHub authentication information.

struct IOTHUB_SERVICE_CLIENT_AUTH {
  char *  hostname,
  char *  iothubName,
  char *  iothubSuffix,
  char *  sharedAccessKey,
  char *  keyName,
  char *  deviceId
};
Member name Description
hostname
iothubName
iothubSuffix
sharedAccessKey
keyName
deviceId

Macro definitions

IOTHUB_DEVICE_STATUS_VALUES

#define IOTHUB_DEVICE_STATUS_VALUES \
        IOTHUB_DEVICE_STATUS_ENABLED, \
        IOTHUB_DEVICE_STATUS_DISABLED 

IOTHUB_DEVICE_CONNECTION_STATE_VALUES

#define IOTHUB_DEVICE_CONNECTION_STATE_VALUES \
        IOTHUB_DEVICE_CONNECTION_STATE_CONNECTED, \
        IOTHUB_DEVICE_CONNECTION_STATE_DISCONNECTED 

Enumeration types

IOTHUB_DEVICE_STATUS

enum IOTHUB_DEVICE_STATUS {
  IOTHUB_DEVICE_STATUS_ENABLED,
  IOTHUB_DEVICE_STATUS_DISABLED
}

IOTHUB_DEVICE_CONNECTION_STATE

enum IOTHUB_DEVICE_CONNECTION_STATE {
  IOTHUB_DEVICE_CONNECTION_STATE_CONNECTED,
  IOTHUB_DEVICE_CONNECTION_STATE_DISCONNECTED
}

Type definitions

IOTHUB_SERVICE_CLIENT_AUTH_HANDLE

Handle to hide struct and use it in consequent APIs.

typedef struct IOTHUB_SERVICE_CLIENT_AUTH_TAG* IOTHUB_SERVICE_CLIENT_AUTH_HANDLE;