Mark Radbourne / Mbed 2 deprecated iothub_client_sample_amqp

Dependencies:   EthernetInterface NTPClient iothub_amqp_transport iothub_client mbed-rtos mbed

Fork of iothub_client_sample_amqp by Azure IoT

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers message_sender.h Source File

message_sender.h

00001 // Copyright (c) Microsoft. All rights reserved.
00002 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
00003 
00004 #ifndef MESSAGE_SENDER_H
00005 #define MESSAGE_SENDER_H
00006 
00007 #include <stdbool.h>
00008 #include "azure_uamqp_c/link.h"
00009 #include "azure_uamqp_c/message.h"
00010 #include "azure_c_shared_utility/xlogging.h"
00011 
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif /* __cplusplus */
00015 
00016 #include "azure_c_shared_utility/umock_c_prod.h"
00017 
00018     typedef enum MESSAGE_SEND_RESULT_TAG
00019     {
00020         MESSAGE_SEND_OK,
00021         MESSAGE_SEND_ERROR
00022     } MESSAGE_SEND_RESULT;
00023 
00024     typedef enum MESSAGE_SENDER_STATE_TAG
00025     {
00026         MESSAGE_SENDER_STATE_IDLE,
00027         MESSAGE_SENDER_STATE_OPENING,
00028         MESSAGE_SENDER_STATE_OPEN,
00029         MESSAGE_SENDER_STATE_CLOSING,
00030         MESSAGE_SENDER_STATE_ERROR
00031     } MESSAGE_SENDER_STATE;
00032 
00033     typedef struct MESSAGE_SENDER_INSTANCE_TAG* MESSAGE_SENDER_HANDLE;
00034     typedef void(*ON_MESSAGE_SEND_COMPLETE)(void* context, MESSAGE_SEND_RESULT send_result);
00035     typedef void(*ON_MESSAGE_SENDER_STATE_CHANGED)(void* context, MESSAGE_SENDER_STATE new_state, MESSAGE_SENDER_STATE previous_state);
00036 
00037     MOCKABLE_FUNCTION(, MESSAGE_SENDER_HANDLE, messagesender_create, LINK_HANDLE, link, ON_MESSAGE_SENDER_STATE_CHANGED, on_message_sender_state_changed, void*, context);
00038     MOCKABLE_FUNCTION(, void, messagesender_destroy, MESSAGE_SENDER_HANDLE, message_sender);
00039     MOCKABLE_FUNCTION(, int, messagesender_open, MESSAGE_SENDER_HANDLE, message_sender);
00040     MOCKABLE_FUNCTION(, int, messagesender_close, MESSAGE_SENDER_HANDLE, message_sender);
00041     MOCKABLE_FUNCTION(, int, messagesender_send, MESSAGE_SENDER_HANDLE, message_sender, MESSAGE_HANDLE, message, ON_MESSAGE_SEND_COMPLETE, on_message_send_complete, void*, callback_context);
00042     MOCKABLE_FUNCTION(, void, messagesender_set_trace, MESSAGE_SENDER_HANDLE, message_sender, bool, traceOn);
00043 
00044 #ifdef __cplusplus
00045 }
00046 #endif /* __cplusplus */
00047 
00048 #endif /* MESSAGE_SENDER_H */