Azure IoT C SDK
Macros | Typedefs | Enumerations | Functions
prov_device_ll_client.h File Reference

Low level provisioning client. More...

#include "umock_c/umock_c_prod.h"
#include "azure_macro_utils/macro_utils.h"
#include "azure_c_shared_utility/const_defines.h"
#include "azure_prov_client/prov_transport.h"

Go to the source code of this file.

Typedefs

typedef struct PROV_INSTANCE_INFO_TAG * PROV_DEVICE_LL_HANDLE
 
typedef void(* PROV_DEVICE_CLIENT_REGISTER_DEVICE_CALLBACK) (PROV_DEVICE_RESULT register_result, const char *iothub_uri, const char *device_id, void *user_context)
 
typedef void(* PROV_DEVICE_CLIENT_REGISTER_STATUS_CALLBACK) (PROV_DEVICE_REG_STATUS reg_status, void *user_context)
 
typedef const PROV_DEVICE_TRANSPORT_PROVIDER *(* PROV_DEVICE_TRANSPORT_PROVIDER_FUNCTION) (void)
 

Enumerations

enum  PROV_DEVICE_RESULT {
  PROV_DEVICE_RESULT_OK , PROV_DEVICE_RESULT_INVALID_ARG , PROV_DEVICE_RESULT_SUCCESS , PROV_DEVICE_RESULT_MEMORY ,
  PROV_DEVICE_RESULT_PARSING , PROV_DEVICE_RESULT_TRANSPORT , PROV_DEVICE_RESULT_INVALID_STATE , PROV_DEVICE_RESULT_DEV_AUTH_ERROR ,
  PROV_DEVICE_RESULT_TIMEOUT , PROV_DEVICE_RESULT_KEY_ERROR , PROV_DEVICE_RESULT_ERROR , PROV_DEVICE_RESULT_HUB_NOT_SPECIFIED ,
  PROV_DEVICE_RESULT_UNAUTHORIZED , PROV_DEVICE_RESULT_DISABLED
}
 
enum  PROV_DEVICE_REG_STATUS {
  PROV_DEVICE_REG_STATUS_CONNECTED , PROV_DEVICE_REG_STATUS_REGISTERING , PROV_DEVICE_REG_STATUS_ASSIGNING , PROV_DEVICE_REG_STATUS_ASSIGNED ,
  PROV_DEVICE_REG_STATUS_ERROR , PROV_DEVICE_REG_HUB_NOT_SPECIFIED
}
 

Functions

PROV_DEVICE_LL_HANDLE Prov_Device_LL_Create (const char *uri, const char *scope_id, PROV_DEVICE_TRANSPORT_PROVIDER_FUNCTION protocol)
 Creates a Provisioning Client for communications with the Device Provisioning Client Service. More...
 
void Prov_Device_LL_Destroy (PROV_DEVICE_LL_HANDLE handle)
 Disposes of resources allocated by the provisioning Client. More...
 
PROV_DEVICE_RESULT Prov_Device_LL_Register_Device (PROV_DEVICE_LL_HANDLE handle, PROV_DEVICE_CLIENT_REGISTER_DEVICE_CALLBACK register_callback, void *user_context, PROV_DEVICE_CLIENT_REGISTER_STATUS_CALLBACK reg_status_cb, void *status_user_ctext)
 Asynchronous call initiates the registration of a device. More...
 
void Prov_Device_LL_DoWork (PROV_DEVICE_LL_HANDLE handle)
 Api to be called by user when work (registering device) can be done. More...
 
PROV_DEVICE_RESULT Prov_Device_LL_SetOption (PROV_DEVICE_LL_HANDLE handle, const char *optionName, const void *value)
 API sets a runtime option identified by parameter optionName to a value pointed to by value. More...
 
const char * Prov_Device_LL_GetVersionString ()
 API to get the version of the provisioning client. More...
 
PROV_DEVICE_RESULT Prov_Device_LL_Set_Provisioning_Payload (PROV_DEVICE_LL_HANDLE handle, const char *json)
 Sets the Provisioning Data that is sent to the Provisioning service. More...
 
const char * Prov_Device_LL_Get_Provisioning_Payload (PROV_DEVICE_LL_HANDLE handle)
 Retrieves the Provisioning Data that is sent from the Provisioning service. More...
 

Detailed Description

Low level provisioning client.

Function Documentation

◆ Prov_Device_LL_Create()

PROV_DEVICE_LL_HANDLE Prov_Device_LL_Create ( const char *  uri,
const char *  scope_id,
PROV_DEVICE_TRANSPORT_PROVIDER_FUNCTION  protocol 
)

Creates a Provisioning Client for communications with the Device Provisioning Client Service.

Parameters
uriThe URI of the Device Provisioning Service
scope_idThe customer specific Id Scope
protocolFunction pointer for protocol implementation
Returns
A non-NULL PROV_DEVICE_LL_HANDLE value that is used when invoking other functions and NULL on Failure

◆ Prov_Device_LL_Destroy()

void Prov_Device_LL_Destroy ( PROV_DEVICE_LL_HANDLE  handle)

Disposes of resources allocated by the provisioning Client.

Parameters
handleThe handle created by a call to the create function

◆ Prov_Device_LL_DoWork()

void Prov_Device_LL_DoWork ( PROV_DEVICE_LL_HANDLE  handle)

Api to be called by user when work (registering device) can be done.

Parameters
handleThe handle created by a call to the create function.

◆ Prov_Device_LL_Get_Provisioning_Payload()

const char* Prov_Device_LL_Get_Provisioning_Payload ( PROV_DEVICE_LL_HANDLE  handle)

Retrieves the Provisioning Data that is sent from the Provisioning service.

Parameters
handleThe handle created by a call to the create function.
Returns
The data that was specified by the service

◆ Prov_Device_LL_GetVersionString()

const char* Prov_Device_LL_GetVersionString ( )

API to get the version of the provisioning client.

Returns
The version number of the provisioning client

◆ Prov_Device_LL_Register_Device()

PROV_DEVICE_RESULT Prov_Device_LL_Register_Device ( PROV_DEVICE_LL_HANDLE  handle,
PROV_DEVICE_CLIENT_REGISTER_DEVICE_CALLBACK  register_callback,
void *  user_context,
PROV_DEVICE_CLIENT_REGISTER_STATUS_CALLBACK  reg_status_cb,
void *  status_user_ctext 
)

Asynchronous call initiates the registration of a device.

Parameters
handleThe handle created by a call to the create function.
register_callbackThe callback that gets called on registration or if an error is encountered
user_contextUser specified context that will be provided to the callback
reg_status_cbAn optional registration status callback used to inform the caller of registration status
status_user_ctextUser specified context that will be provided to the registration status callback
Returns
PROV_DEVICE_RESULT_OK upon success or an error code upon failure

◆ Prov_Device_LL_Set_Provisioning_Payload()

PROV_DEVICE_RESULT Prov_Device_LL_Set_Provisioning_Payload ( PROV_DEVICE_LL_HANDLE  handle,
const char *  json 
)

Sets the Provisioning Data that is sent to the Provisioning service.

Parameters
handleThe handle created by a call to the create function.
jsonThe data field that is sent to the service. Setting json to NULL will unset the value previously set
Returns
PROV_DEVICE_RESULT_OK upon success or an error code upon failure

◆ Prov_Device_LL_SetOption()

PROV_DEVICE_RESULT Prov_Device_LL_SetOption ( PROV_DEVICE_LL_HANDLE  handle,
const char *  optionName,
const void *  value 
)

API sets a runtime option identified by parameter optionName to a value pointed to by value.

Parameters
handleThe handle created by a call to the create function.
optionNameThe name of the option to be set
valueA pointer to the value of the option to be set
Returns
PROV_DEVICE_RESULT_OK upon success or an error code upon failure