Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface NTPClient iothub_amqp_transport iothub_client mbed-rtos mbed
Fork of iothub_client_sample_amqp by
link.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 LINK_H 00005 #define LINK_H 00006 00007 #include <stddef.h> 00008 #include "azure_uamqp_c/session.h" 00009 #include "azure_uamqp_c/amqpvalue.h" 00010 #include "azure_uamqp_c/amqp_definitions.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 struct LINK_INSTANCE_TAG* LINK_HANDLE; 00019 00020 typedef enum LINK_STATE_TAG 00021 { 00022 LINK_STATE_DETACHED, 00023 LINK_STATE_HALF_ATTACHED, 00024 LINK_STATE_ATTACHED, 00025 LINK_STATE_ERROR 00026 } LINK_STATE; 00027 00028 typedef enum LINK_TRANSFER_RESULT_TAG 00029 { 00030 LINK_TRANSFER_OK, 00031 LINK_TRANSFER_ERROR, 00032 LINK_TRANSFER_BUSY 00033 } LINK_TRANSFER_RESULT; 00034 00035 typedef void(*ON_DELIVERY_SETTLED)(void* context, delivery_number delivery_no, AMQP_VALUE delivery_state); 00036 typedef AMQP_VALUE(*ON_TRANSFER_RECEIVED)(void* context, TRANSFER_HANDLE transfer, uint32_t payload_size, const unsigned char* payload_bytes); 00037 typedef void(*ON_LINK_STATE_CHANGED)(void* context, LINK_STATE new_link_state, LINK_STATE previous_link_state); 00038 typedef void(*ON_LINK_FLOW_ON)(void* context); 00039 00040 MOCKABLE_FUNCTION(, LINK_HANDLE, link_create, SESSION_HANDLE, session, const char*, name, role, role, AMQP_VALUE, source, AMQP_VALUE, target); 00041 MOCKABLE_FUNCTION(, LINK_HANDLE, link_create_from_endpoint, SESSION_HANDLE, session, LINK_ENDPOINT_HANDLE, link_endpoint, const char*, name, role, role, AMQP_VALUE, source, AMQP_VALUE, target); 00042 MOCKABLE_FUNCTION(, void, link_destroy, LINK_HANDLE, handle); 00043 MOCKABLE_FUNCTION(, int, link_set_snd_settle_mode, LINK_HANDLE, link, sender_settle_mode, snd_settle_mode); 00044 MOCKABLE_FUNCTION(, int, link_get_snd_settle_mode, LINK_HANDLE, link, sender_settle_mode*, snd_settle_mode); 00045 MOCKABLE_FUNCTION(, int, link_set_rcv_settle_mode, LINK_HANDLE, link, receiver_settle_mode, rcv_settle_mode); 00046 MOCKABLE_FUNCTION(, int, link_get_rcv_settle_mode, LINK_HANDLE, link, receiver_settle_mode*, rcv_settle_mode); 00047 MOCKABLE_FUNCTION(, int, link_set_initial_delivery_count, LINK_HANDLE, link, sequence_no, initial_delivery_count); 00048 MOCKABLE_FUNCTION(, int, link_get_initial_delivery_count, LINK_HANDLE, link, sequence_no*, initial_delivery_count); 00049 MOCKABLE_FUNCTION(, int, link_set_max_message_size, LINK_HANDLE, link, uint64_t, max_message_size); 00050 MOCKABLE_FUNCTION(, int, link_get_max_message_size, LINK_HANDLE, link, uint64_t*, max_message_size); 00051 MOCKABLE_FUNCTION(, int, link_set_attach_properties, LINK_HANDLE, link, fields, attach_properties); 00052 MOCKABLE_FUNCTION(, int, link_attach, LINK_HANDLE, link, ON_TRANSFER_RECEIVED, on_transfer_received, ON_LINK_STATE_CHANGED, on_link_state_changed, ON_LINK_FLOW_ON, on_link_flow_on, void*, callback_context); 00053 MOCKABLE_FUNCTION(, int, link_detach, LINK_HANDLE, link, bool, close); 00054 MOCKABLE_FUNCTION(, LINK_TRANSFER_RESULT, link_transfer, LINK_HANDLE, handle, message_format, message_format, PAYLOAD*, payloads, size_t, payload_count, ON_DELIVERY_SETTLED, on_delivery_settled, void*, callback_context); 00055 00056 #ifdef __cplusplus 00057 } 00058 #endif /* __cplusplus */ 00059 00060 #endif /* LINK_H */
Generated on Tue Jul 12 2022 12:43:19 by
