Azure IoT C SDK
iothub_client.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 
4 //**********************************************************************
5 // NOTE: THIS HEADER IS DEPRECATED
6 //
7 // Functions in this header will be maintained for backward compatability.
8 // New applications should use iothub_device_client.h.
9 //
10 //**********************************************************************
11 
24 #ifndef IOTHUB_CLIENT_H
25 #define IOTHUB_CLIENT_H
26 
27 #include <stddef.h>
28 #include <stdint.h>
29 
30 #include "umock_c/umock_c_prod.h"
31 #include "iothub_transport_ll.h"
32 #include "iothub_client_core_ll.h"
33 #include "iothub_client_core.h"
34 #include "iothub_client_ll.h"
35 
36 #ifndef IOTHUB_CLIENT_INSTANCE_TYPE
40 typedef IOTHUB_CLIENT_CORE_HANDLE IOTHUB_CLIENT_HANDLE;
41 #define IOTHUB_CLIENT_INSTANCE_TYPE
42 #endif // IOTHUB_CLIENT_INSTANCE
43 
44 
45 #ifdef __cplusplus
46 extern "C"
47 {
48 #endif
49 
53  IOTHUB_CLIENT_HANDLE IoTHubClient_CreateFromConnectionString( const char* connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol);
61  IOTHUB_CLIENT_HANDLE IoTHubClient_CreateWithTransport( TRANSPORT_HANDLE transportHandle, const IOTHUB_CLIENT_CONFIG* config);
65  IOTHUB_CLIENT_HANDLE IoTHubClient_CreateFromDeviceAuth( const char* iothub_uri, const char* device_id, IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol);
69  void IoTHubClient_Destroy( IOTHUB_CLIENT_HANDLE iotHubClientHandle);
73  IOTHUB_CLIENT_RESULT IoTHubClient_SendEventAsync( IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_MESSAGE_HANDLE eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK eventConfirmationCallback, void* userContextCallback);
89  IOTHUB_CLIENT_RESULT IoTHubClient_SetRetryPolicy( IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY retryPolicy, size_t retryTimeoutLimitInSeconds);
93  IOTHUB_CLIENT_RESULT IoTHubClient_GetRetryPolicy( IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY* retryPolicy, size_t* retryTimeoutLimitInSeconds);
97  IOTHUB_CLIENT_RESULT IoTHubClient_GetLastMessageReceiveTime( IOTHUB_CLIENT_HANDLE iotHubClientHandle, time_t* lastMessageReceiveTime);
101  IOTHUB_CLIENT_RESULT IoTHubClient_SetOption( IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char* optionName, const void* value);
105  IOTHUB_CLIENT_RESULT IoTHubClient_SetDeviceTwinCallback( IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK deviceTwinCallback, void* userContextCallback);
109  IOTHUB_CLIENT_RESULT IoTHubClient_SendReportedState( IOTHUB_CLIENT_HANDLE iotHubClientHandle, const unsigned char* reportedState, size_t size, IOTHUB_CLIENT_REPORTED_STATE_CALLBACK reportedStateCallback, void* userContextCallback);
117  IOTHUB_CLIENT_RESULT IoTHubClient_SetDeviceMethodCallback_Ex( IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_INBOUND_DEVICE_METHOD_CALLBACK inboundDeviceMethodCallback, void* userContextCallback);
121  IOTHUB_CLIENT_RESULT IoTHubClient_DeviceMethodResponse( IOTHUB_CLIENT_HANDLE iotHubClientHandle, METHOD_HANDLE methodId, const unsigned char* response, size_t response_size, int statusCode);
122 #ifndef DONT_USE_UPLOADTOBLOB
126  IOTHUB_CLIENT_RESULT IoTHubClient_UploadToBlobAsync( IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char* destinationFileName, const unsigned char* source, size_t size, IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK iotHubClientFileUploadCallback, void* context);
130  IOTHUB_CLIENT_RESULT IoTHubClient_UploadMultipleBlocksToBlobAsync( IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char* destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK getDataCallback, void* context);
134  IOTHUB_CLIENT_RESULT IoTHubClient_UploadMultipleBlocksToBlobAsyncEx( IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char* destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX getDataCallbackEx, void* context);
135 #endif /* DONT_USE_UPLOADTOBLOB */
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #endif /* IOTHUB_CLIENT_H */
IOTHUB_CLIENT_HANDLE IoTHubClient_CreateFromConnectionString(const char *connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol)
IOTHUB_CLIENT_CORE_HANDLE IOTHUB_CLIENT_HANDLE
Definition: iothub_client.h:40
IOTHUB_CLIENT_RESULT IoTHubClient_UploadMultipleBlocksToBlobAsyncEx(IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char *destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX getDataCallbackEx, void *context)
IOTHUB_CLIENT_HANDLE IoTHubClient_CreateWithTransport(TRANSPORT_HANDLE transportHandle, const IOTHUB_CLIENT_CONFIG *config)
IOTHUB_CLIENT_RESULT IoTHubClient_SetDeviceMethodCallback_Ex(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_INBOUND_DEVICE_METHOD_CALLBACK inboundDeviceMethodCallback, void *userContextCallback)
IOTHUB_CLIENT_RESULT IoTHubClient_SendEventAsync(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_MESSAGE_HANDLE eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK eventConfirmationCallback, void *userContextCallback)
IOTHUB_CLIENT_RESULT IoTHubClient_SetDeviceTwinCallback(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK deviceTwinCallback, void *userContextCallback)
IOTHUB_CLIENT_RESULT IoTHubClient_GetLastMessageReceiveTime(IOTHUB_CLIENT_HANDLE iotHubClientHandle, time_t *lastMessageReceiveTime)
IOTHUB_CLIENT_RESULT IoTHubClient_SetDeviceMethodCallback(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC deviceMethodCallback, void *userContextCallback)
void IoTHubClient_Destroy(IOTHUB_CLIENT_HANDLE iotHubClientHandle)
IOTHUB_CLIENT_RESULT IoTHubClient_GetRetryPolicy(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY *retryPolicy, size_t *retryTimeoutLimitInSeconds)
IOTHUB_CLIENT_RESULT IoTHubClient_GetSendStatus(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_STATUS *iotHubClientStatus)
IOTHUB_CLIENT_RESULT IoTHubClient_SetConnectionStatusCallback(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK connectionStatusCallback, void *userContextCallback)
IOTHUB_CLIENT_RESULT IoTHubClient_SetOption(IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char *optionName, const void *value)
IOTHUB_CLIENT_HANDLE IoTHubClient_Create(const IOTHUB_CLIENT_CONFIG *config)
IOTHUB_CLIENT_RESULT IoTHubClient_SetMessageCallback(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC messageCallback, void *userContextCallback)
IOTHUB_CLIENT_RESULT IoTHubClient_UploadToBlobAsync(IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char *destinationFileName, const unsigned char *source, size_t size, IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK iotHubClientFileUploadCallback, void *context)
IOTHUB_CLIENT_RESULT IoTHubClient_UploadMultipleBlocksToBlobAsync(IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char *destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK getDataCallback, void *context)
IOTHUB_CLIENT_HANDLE IoTHubClient_CreateFromDeviceAuth(const char *iothub_uri, const char *device_id, IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol)
IOTHUB_CLIENT_RESULT IoTHubClient_SendReportedState(IOTHUB_CLIENT_HANDLE iotHubClientHandle, const unsigned char *reportedState, size_t size, IOTHUB_CLIENT_REPORTED_STATE_CALLBACK reportedStateCallback, void *userContextCallback)
IOTHUB_CLIENT_RESULT IoTHubClient_DeviceMethodResponse(IOTHUB_CLIENT_HANDLE iotHubClientHandle, METHOD_HANDLE methodId, const unsigned char *response, size_t response_size, int statusCode)
IOTHUB_CLIENT_RESULT IoTHubClient_SetRetryPolicy(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY retryPolicy, size_t retryTimeoutLimitInSeconds)
void(* IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK)(IOTHUB_CLIENT_FILE_UPLOAD_RESULT result, void *userContextCallback)
Deprecated callback mechanism for uploading data to a blob.
Definition: iothub_client_core_common.h:29
IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_RESULT(* IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX)(IOTHUB_CLIENT_FILE_UPLOAD_RESULT result, unsigned char const **data, size_t *size, void *context)
Signature of the callback that the application implements to process IoT Hub client SDK requesting ad...
Definition: iothub_client_core_common.h:260
void(* IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK)(IOTHUB_CLIENT_FILE_UPLOAD_RESULT result, unsigned char const **data, size_t *size, void *context)
Deprecated callback mechanism for uploading data to a blob.
Definition: iothub_client_core_common.h:241
void(* IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK)(DEVICE_TWIN_UPDATE_STATE update_state, const unsigned char *payLoad, size_t size, void *userContextCallback)
Signature of the callback that the application implements to process data received from an IoT Hub de...
Definition: iothub_client_core_common.h:201
IOTHUB_CLIENT_RETRY_POLICY
Enumeration specifying the retry strategy the IoT Hub client should use.
Definition: iothub_client_core_common.h:63
void(* IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK)(IOTHUB_CLIENT_CONFIRMATION_RESULT result, void *userContextCallback)
Signature of the callback that the application implements to process acknowledgement or failures when...
Definition: iothub_client_core_common.h:170
void(* IOTHUB_CLIENT_REPORTED_STATE_CALLBACK)(int status_code, void *userContextCallback)
Signature of the callback that the application implements to receive notifications of device or modul...
Definition: iothub_client_core_common.h:209
int(* IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC)(const char *method_name, const unsigned char *payload, size_t size, unsigned char **response, size_t *response_size, void *userContextCallback)
Signature of the callback that the application implements to receive incoming device or module method...
Definition: iothub_client_core_common.h:227
void(* IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK)(IOTHUB_CLIENT_CONNECTION_STATUS result, IOTHUB_CLIENT_CONNECTION_STATUS_REASON reason, void *userContextCallback)
Signature of the callback that the application implements to process connection status changes betwee...
Definition: iothub_client_core_common.h:179
IOTHUBMESSAGE_DISPOSITION_RESULT(* IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC)(IOTHUB_MESSAGE_HANDLE message, void *userContextCallback)
Signature of the callback that the application implements to process incoming cloud-to-device message...
Definition: iothub_client_core_common.h:189
IOTHUB_CLIENT_RESULT
Enumeration specifying the status of calls to IoT Hub client.
Definition: iothub_client_core_common.h:42
IOTHUB_CLIENT_STATUS
Enumeration returned by the GetSendStatus family of APIs (e.g. IoTHubDeviceClient_LL_GetSendStatus())...
Definition: iothub_client_core_common.h:73
APIs that allow a user (usually a device) to communicate with an Azure IoT Hub.
struct IOTHUB_MESSAGE_HANDLE_DATA_TAG * IOTHUB_MESSAGE_HANDLE
Handle representing an IoT Hub message.
Definition: iothub_message.h:32
This struct specifies IoT Hub client configuration.
Definition: iothub_client_core_common.h:264