iothub_messaging_ll.h

Includes

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

Detailed Description

Functions

Function Name Description
IOTHUB_FEEDBACK_STATUS_CODEStrings
IOTHUB_FEEDBACK_STATUS_CODE_FromString
IOTHUB_MESSAGE_SEND_STATEStrings
IOTHUB_MESSAGE_SEND_STATE_FromString
IOTHUB_MESSAGING_RESULTStrings
IOTHUB_MESSAGING_RESULT_FromString
IoTHubMessaging_LL_Create Creates a IoT Hub Service Client Messaging handle for use it in consequent APIs.
IoTHubMessaging_LL_Destroy Disposes of resources allocated by the IoT Hub Service Client Messaging.
IoTHubMessaging_LL_Open Opens connection to IoTHub.
IoTHubMessaging_LL_Close Closes connection to IoTHub.
IoTHubMessaging_LL_Send Synchronous call to send the message to a specified device.
IoTHubMessaging_LL_SetFeedbackMessageCallback This API specifies a callback to be used when the device receives the message.
IoTHubMessaging_LL_DoWork This function is meant to be called by the user when work (sending/receiving) can be done by the IoTHubServiceClient.
IoTHubMessaging_LL_SetTrustedCert This function is meant to be called by the user when to set the trusted certificate on the tls connection.

Structures

IOTHUB_SERVICE_FEEDBACK_RECORD

struct IOTHUB_SERVICE_FEEDBACK_RECORD {
  char *                       description,
  const char *                 deviceId,
  const char *                 correlationId,
  const char *                 generationId,
  const char *                 enqueuedTimeUtc,
  IOTHUB_FEEDBACK_STATUS_CODE  statusCode,
  const char *                 originalMessageId
};
Member name Description
description
deviceId
correlationId
generationId
enqueuedTimeUtc
statusCode
originalMessageId

IOTHUB_SERVICE_FEEDBACK_BATCH

struct IOTHUB_SERVICE_FEEDBACK_BATCH {
  const char *             userId,
  const char *             lockToken,
  SINGLYLINKEDLIST_HANDLE  feedbackRecordList
};
Member name Description
userId
lockToken
feedbackRecordList

Macro definitions

IOTHUB_FEEDBACK_STATUS_CODE_VALUES

#define IOTHUB_FEEDBACK_STATUS_CODE_VALUES \
        IOTHUB_FEEDBACK_STATUS_CODE_SUCCESS, \
        IOTHUB_FEEDBACK_STATUS_CODE_EXPIRED, \
        IOTHUB_FEEDBACK_STATUS_CODE_DELIVER_COUNT_EXCEEDED, \
        IOTHUB_FEEDBACK_STATUS_CODE_REJECTED, \
        IOTHUB_FEEDBACK_STATUS_CODE_UNKNOWN 

IOTHUB_MESSAGE_SEND_STATE_VALUES

#define IOTHUB_MESSAGE_SEND_STATE_VALUES \
        IOTHUB_MESSAGE_SEND_STATE_NOT_SENT, \
        IOTHUB_MESSAGE_SEND_STATE_SEND_IN_PROGRESS, \
        IOTHUB_MESSAGE_SEND_STATE_SENT_OK, \
        IOTHUB_MESSAGE_SEND_STATE_SEND_FAILED 

IOTHUB_MESSAGING_RESULT_VALUES

#define IOTHUB_MESSAGING_RESULT_VALUES \
        IOTHUB_MESSAGING_OK, \
        IOTHUB_MESSAGING_INVALID_ARG, \
        IOTHUB_MESSAGING_ERROR, \
        IOTHUB_MESSAGING_INVALID_JSON, \
        IOTHUB_MESSAGING_DEVICE_EXIST, \
        IOTHUB_MESSAGING_CALLBACK_NOT_SET 

Enumeration types

IOTHUB_FEEDBACK_STATUS_CODE

enum IOTHUB_FEEDBACK_STATUS_CODE {
  IOTHUB_FEEDBACK_STATUS_CODE_SUCCESS,
  IOTHUB_FEEDBACK_STATUS_CODE_EXPIRED,
  IOTHUB_FEEDBACK_STATUS_CODE_DELIVER_COUNT_EXCEEDED,
  IOTHUB_FEEDBACK_STATUS_CODE_REJECTED,
  IOTHUB_FEEDBACK_STATUS_CODE_UNKNOWN
}

IOTHUB_MESSAGE_SEND_STATE

enum IOTHUB_MESSAGE_SEND_STATE {
  IOTHUB_MESSAGE_SEND_STATE_NOT_SENT,
  IOTHUB_MESSAGE_SEND_STATE_SEND_IN_PROGRESS,
  IOTHUB_MESSAGE_SEND_STATE_SENT_OK,
  IOTHUB_MESSAGE_SEND_STATE_SEND_FAILED
}

IOTHUB_MESSAGING_RESULT

enum IOTHUB_MESSAGING_RESULT {
  IOTHUB_MESSAGING_OK,
  IOTHUB_MESSAGING_INVALID_ARG,
  IOTHUB_MESSAGING_ERROR,
  IOTHUB_MESSAGING_INVALID_JSON,
  IOTHUB_MESSAGING_DEVICE_EXIST,
  IOTHUB_MESSAGING_CALLBACK_NOT_SET
}

Type definitions

IOTHUB_MESSAGING_HANDLE

typedef struct IOTHUB_MESSAGING_TAG* IOTHUB_MESSAGING_HANDLE;

IOTHUB_OPEN_COMPLETE_CALLBACK

typedef void(* IOTHUB_OPEN_COMPLETE_CALLBACK) (
  void *  context
);

IOTHUB_SEND_COMPLETE_CALLBACK

typedef void(* IOTHUB_SEND_COMPLETE_CALLBACK) (
  void *                   context,
  IOTHUB_MESSAGING_RESULT  messagingResult
);

IOTHUB_FEEDBACK_MESSAGE_RECEIVED_CALLBACK

typedef void(* IOTHUB_FEEDBACK_MESSAGE_RECEIVED_CALLBACK) (
  void *                           context,
  IOTHUB_SERVICE_FEEDBACK_BATCH *  feedbackBatch
);