iothub_registrymanager.h

Includes

#include "azure_macro_utils/macro_utils.h"
#include "umock_c/umock_c_prod.h"
#include "azure_c_shared_utility/crt_abstractions.h"
#include "azure_c_shared_utility/singlylinkedlist.h"
#include "azure_c_shared_utility/map.h"
#include "iothub_service_client_auth.h"

Detailed Description

Functions

Function Name Description
IOTHUB_REGISTRYMANAGER_RESULTStrings
IOTHUB_REGISTRYMANAGER_RESULT_FromString
IOTHUB_REGISTRYMANAGER_AUTH_METHODStrings
IOTHUB_REGISTRYMANAGER_AUTH_METHOD_FromString
IoTHubRegistryManager_FreeDeviceExMembers Free members of the IOTHUB_DEVICE_EX structure (NOT the structure itself)
IoTHubRegistryManager_FreeModuleMembers Free members of the IOTHUB_MODULE structure (NOT the structure itself)
IoTHubRegistryManager_Create Creates a IoT Hub Registry Manager handle for use it in consequent APIs.
IoTHubRegistryManager_Destroy Disposes of resources allocated by the IoT Hub Registry Manager.
IoTHubRegistryManager_CreateDevice_Ex Creates a device on IoT Hub.
IoTHubRegistryManager_GetDevice_Ex Gets device info for a given device.
IoTHubRegistryManager_UpdateDevice_Ex Updates a device on IoT Hub.
IoTHubRegistryManager_DeleteDevice Deletes a given device.
IoTHubRegistryManager_GetStatistics Gets the registry statistic info.
IoTHubRegistryManager_CreateModule Creates a module on IoT Hub.
IoTHubRegistryManager_GetModule Gets module info for a given module.
IoTHubRegistryManager_UpdateModule Updates a module on IoT Hub.
IoTHubRegistryManager_DeleteModule Deletes a given module.
IoTHubRegistryManager_GetModuleList Gets a list of modules registered on the specified device.
IoTHubRegistryManager_CreateDevice Creates a device on IoT Hub.
IoTHubRegistryManager_GetDevice Gets device info for a given device.
IoTHubRegistryManager_UpdateDevice Updates a device on IoT Hub.
IoTHubRegistryManager_GetDeviceList

Structures

IOTHUB_DEVICE_EX

struct IOTHUB_DEVICE_EX {
  int                                 version,
  const char *                        deviceId,
  const char *                        primaryKey,
  const char *                        secondaryKey,
  const char *                        generationId,
  const char *                        eTag,
  IOTHUB_DEVICE_CONNECTION_STATE      connectionState,
  const char *                        connectionStateUpdatedTime,
  IOTHUB_DEVICE_STATUS                status,
  const char *                        statusReason,
  const char *                        statusUpdatedTime,
  const char *                        lastActivityTime,
  size_t                              cloudToDeviceMessageCount,
  bool                                isManaged,
  const char *                        configuration,
  const char *                        deviceProperties,
  const char *                        serviceProperties,
  IOTHUB_REGISTRYMANAGER_AUTH_METHOD  authMethod,
  bool                                iotEdge_capable
};
Member name Description
version
deviceId
primaryKey
secondaryKey
generationId
eTag
connectionState
connectionStateUpdatedTime
status
statusReason
statusUpdatedTime
lastActivityTime
cloudToDeviceMessageCount
isManaged
configuration
deviceProperties
serviceProperties
authMethod
iotEdge_capable

IOTHUB_REGISTRY_DEVICE_CREATE_EX

struct IOTHUB_REGISTRY_DEVICE_CREATE_EX {
  int                                 version,
  const char *                        deviceId,
  const char *                        primaryKey,
  const char *                        secondaryKey,
  IOTHUB_REGISTRYMANAGER_AUTH_METHOD  authMethod,
  bool                                iotEdge_capable
};
Member name Description
version
deviceId
primaryKey
secondaryKey
authMethod
iotEdge_capable

IOTHUB_REGISTRY_DEVICE_UPDATE_EX

struct IOTHUB_REGISTRY_DEVICE_UPDATE_EX {
  int                                 version,
  const char *                        deviceId,
  const char *                        primaryKey,
  const char *                        secondaryKey,
  IOTHUB_DEVICE_STATUS                status,
  IOTHUB_REGISTRYMANAGER_AUTH_METHOD  authMethod,
  bool                                iotEdge_capable
};
Member name Description
version
deviceId
primaryKey
secondaryKey
status
authMethod
iotEdge_capable

IOTHUB_REGISTRY_STATISTICS

struct IOTHUB_REGISTRY_STATISTICS {
  size_t  totalDeviceCount,
  size_t  enabledDeviceCount,
  size_t  disabledDeviceCount
};
Member name Description
totalDeviceCount
enabledDeviceCount
disabledDeviceCount

IOTHUB_MODULE

struct IOTHUB_MODULE {
  int                                 version,
  const char *                        deviceId,
  const char *                        primaryKey,
  const char *                        secondaryKey,
  const char *                        generationId,
  const char *                        eTag,
  IOTHUB_DEVICE_CONNECTION_STATE      connectionState,
  const char *                        connectionStateUpdatedTime,
  IOTHUB_DEVICE_STATUS                status,
  const char *                        statusReason,
  const char *                        statusUpdatedTime,
  const char *                        lastActivityTime,
  size_t                              cloudToDeviceMessageCount,
  bool                                isManaged,
  const char *                        configuration,
  const char *                        deviceProperties,
  const char *                        serviceProperties,
  IOTHUB_REGISTRYMANAGER_AUTH_METHOD  authMethod,
  const char *                        moduleId,
  const char *                        managedBy
};
Member name Description
version
deviceId
primaryKey
secondaryKey
generationId
eTag
connectionState
connectionStateUpdatedTime
status
statusReason
statusUpdatedTime
lastActivityTime
cloudToDeviceMessageCount
isManaged
configuration
deviceProperties
serviceProperties
authMethod
moduleId
managedBy

IOTHUB_REGISTRY_MODULE_CREATE

struct IOTHUB_REGISTRY_MODULE_CREATE {
  int                                 version,
  const char *                        deviceId,
  const char *                        primaryKey,
  const char *                        secondaryKey,
  IOTHUB_REGISTRYMANAGER_AUTH_METHOD  authMethod,
  const char *                        moduleId,
  const char *                        managedBy
};
Member name Description
version
deviceId
primaryKey
secondaryKey
authMethod
moduleId
managedBy

IOTHUB_REGISTRY_MODULE_UPDATE

struct IOTHUB_REGISTRY_MODULE_UPDATE {
  int                                 version,
  const char *                        deviceId,
  const char *                        primaryKey,
  const char *                        secondaryKey,
  IOTHUB_DEVICE_STATUS                status,
  IOTHUB_REGISTRYMANAGER_AUTH_METHOD  authMethod,
  const char *                        moduleId,
  const char *                        managedBy
};
Member name Description
version
deviceId
primaryKey
secondaryKey
status
authMethod
moduleId
managedBy

IOTHUB_REGISTRYMANAGER

Structure to store IoTHub authentication information.

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

IOTHUB_DEVICE

struct IOTHUB_DEVICE {
  const char *                        deviceId,
  const char *                        primaryKey,
  const char *                        secondaryKey,
  const char *                        generationId,
  const char *                        eTag,
  IOTHUB_DEVICE_CONNECTION_STATE      connectionState,
  const char *                        connectionStateUpdatedTime,
  IOTHUB_DEVICE_STATUS                status,
  const char *                        statusReason,
  const char *                        statusUpdatedTime,
  const char *                        lastActivityTime,
  size_t                              cloudToDeviceMessageCount,
  bool                                isManaged,
  const char *                        configuration,
  const char *                        deviceProperties,
  const char *                        serviceProperties,
  IOTHUB_REGISTRYMANAGER_AUTH_METHOD  authMethod
};
Member name Description
deviceId
primaryKey
secondaryKey
generationId
eTag
connectionState
connectionStateUpdatedTime
status
statusReason
statusUpdatedTime
lastActivityTime
cloudToDeviceMessageCount
isManaged
configuration
deviceProperties
serviceProperties
authMethod

IOTHUB_REGISTRY_DEVICE_CREATE

struct IOTHUB_REGISTRY_DEVICE_CREATE {
  const char *                        deviceId,
  const char *                        primaryKey,
  const char *                        secondaryKey,
  IOTHUB_REGISTRYMANAGER_AUTH_METHOD  authMethod
};
Member name Description
deviceId
primaryKey
secondaryKey
authMethod

IOTHUB_REGISTRY_DEVICE_UPDATE

struct IOTHUB_REGISTRY_DEVICE_UPDATE {
  const char *                        deviceId,
  const char *                        primaryKey,
  const char *                        secondaryKey,
  IOTHUB_DEVICE_STATUS                status,
  IOTHUB_REGISTRYMANAGER_AUTH_METHOD  authMethod
};
Member name Description
deviceId
primaryKey
secondaryKey
status
authMethod

Macro definitions

IOTHUB_REGISTRYMANAGER_RESULT_VALUES

#define IOTHUB_REGISTRYMANAGER_RESULT_VALUES \
        IOTHUB_REGISTRYMANAGER_OK, \
        IOTHUB_REGISTRYMANAGER_INVALID_ARG, \
        IOTHUB_REGISTRYMANAGER_ERROR, \
        IOTHUB_REGISTRYMANAGER_JSON_ERROR, \
        IOTHUB_REGISTRYMANAGER_HTTPAPI_ERROR, \
        IOTHUB_REGISTRYMANAGER_HTTP_STATUS_ERROR, \
        IOTHUB_REGISTRYMANAGER_DEVICE_EXIST, \
        IOTHUB_REGISTRYMANAGER_DEVICE_NOT_EXIST, \
        IOTHUB_REGISTRYMANAGER_CALLBACK_NOT_SET, \
        IOTHUB_REGISTRYMANAGER_INVALID_VERSION 

IOTHUB_REGISTRYMANAGER_AUTH_METHOD_VALUES

#define IOTHUB_REGISTRYMANAGER_AUTH_METHOD_VALUES \
        IOTHUB_REGISTRYMANAGER_AUTH_SPK, \
        IOTHUB_REGISTRYMANAGER_AUTH_X509_THUMBPRINT, \
        IOTHUB_REGISTRYMANAGER_AUTH_X509_CERTIFICATE_AUTHORITY, \
        IOTHUB_REGISTRYMANAGER_AUTH_NONE, \
        IOTHUB_REGISTRYMANAGER_AUTH_UNKNOWN 

IOTHUB_DEVICE_EX_VERSION_1

#define IOTHUB_DEVICE_EX_VERSION_1  1 

IOTHUB_REGISTRY_DEVICE_CREATE_EX_VERSION_1

#define IOTHUB_REGISTRY_DEVICE_CREATE_EX_VERSION_1  1 

IOTHUB_REGISTRY_DEVICE_UPDATE_EX_VERSION_1

#define IOTHUB_REGISTRY_DEVICE_UPDATE_EX_VERSION_1  1 

IOTHUB_MODULE_VERSION_1

#define IOTHUB_MODULE_VERSION_1  1 

IOTHUB_REGISTRY_MODULE_CREATE_VERSION_1

#define IOTHUB_REGISTRY_MODULE_CREATE_VERSION_1  1 

IOTHUB_REGISTRY_MODULE_UPDATE_VERSION_1

#define IOTHUB_REGISTRY_MODULE_UPDATE_VERSION_1  1 

Enumeration types

IOTHUB_REGISTRYMANAGER_RESULT

enum IOTHUB_REGISTRYMANAGER_RESULT {
  IOTHUB_REGISTRYMANAGER_OK,
  IOTHUB_REGISTRYMANAGER_INVALID_ARG,
  IOTHUB_REGISTRYMANAGER_ERROR,
  IOTHUB_REGISTRYMANAGER_JSON_ERROR,
  IOTHUB_REGISTRYMANAGER_HTTPAPI_ERROR,
  IOTHUB_REGISTRYMANAGER_HTTP_STATUS_ERROR,
  IOTHUB_REGISTRYMANAGER_DEVICE_EXIST,
  IOTHUB_REGISTRYMANAGER_DEVICE_NOT_EXIST,
  IOTHUB_REGISTRYMANAGER_CALLBACK_NOT_SET,
  IOTHUB_REGISTRYMANAGER_INVALID_VERSION
}

IOTHUB_REGISTRYMANAGER_AUTH_METHOD

enum IOTHUB_REGISTRYMANAGER_AUTH_METHOD {
  IOTHUB_REGISTRYMANAGER_AUTH_SPK,
  IOTHUB_REGISTRYMANAGER_AUTH_X509_THUMBPRINT,
  IOTHUB_REGISTRYMANAGER_AUTH_X509_CERTIFICATE_AUTHORITY,
  IOTHUB_REGISTRYMANAGER_AUTH_NONE,
  IOTHUB_REGISTRYMANAGER_AUTH_UNKNOWN
}

Type definitions

IOTHUB_REGISTRYMANAGER_HANDLE

Handle to hide struct and use it in consequent APIs.

typedef struct IOTHUB_REGISTRYMANAGER_TAG* IOTHUB_REGISTRYMANAGER_HANDLE;