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
xio.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 XIO_H 00005 #define XIO_H 00006 00007 #include "azure_c_shared_utility/optionhandler.h" 00008 00009 #include "azure_c_shared_utility/xlogging.h" 00010 #include "azure_c_shared_utility/umock_c_prod.h" 00011 #include "azure_c_shared_utility/macro_utils.h" 00012 00013 #ifdef __cplusplus 00014 #include <cstddef> 00015 extern "C" { 00016 #else 00017 #include <stddef.h> 00018 #endif /* __cplusplus */ 00019 00020 typedef struct XIO_INSTANCE_TAG* XIO_HANDLE; 00021 typedef void* CONCRETE_IO_HANDLE; 00022 00023 #define IO_SEND_RESULT_VALUES \ 00024 IO_SEND_OK, \ 00025 IO_SEND_ERROR, \ 00026 IO_SEND_CANCELLED 00027 00028 DEFINE_ENUM(IO_SEND_RESULT, IO_SEND_RESULT_VALUES); 00029 00030 #define IO_OPEN_RESULT_VALUES \ 00031 IO_OPEN_OK, \ 00032 IO_OPEN_ERROR, \ 00033 IO_OPEN_CANCELLED 00034 00035 DEFINE_ENUM(IO_OPEN_RESULT, IO_OPEN_RESULT_VALUES); 00036 00037 typedef void(*ON_BYTES_RECEIVED)(void* context, const unsigned char* buffer, size_t size); 00038 typedef void(*ON_SEND_COMPLETE)(void* context, IO_SEND_RESULT send_result); 00039 typedef void(*ON_IO_OPEN_COMPLETE)(void* context, IO_OPEN_RESULT open_result); 00040 typedef void(*ON_IO_CLOSE_COMPLETE)(void* context); 00041 typedef void(*ON_IO_ERROR)(void* context); 00042 00043 typedef OPTIONHANDLER_HANDLE (*IO_RETRIEVEOPTIONS)(CONCRETE_IO_HANDLE concrete_io); 00044 typedef CONCRETE_IO_HANDLE(*IO_CREATE)(void* io_create_parameters); 00045 typedef void(*IO_DESTROY)(CONCRETE_IO_HANDLE concrete_io); 00046 typedef int(*IO_OPEN)(CONCRETE_IO_HANDLE concrete_io, ON_IO_OPEN_COMPLETE on_io_open_complete, void* on_io_open_complete_context, ON_BYTES_RECEIVED on_bytes_received, void* on_bytes_received_context, ON_IO_ERROR on_io_error, void* on_io_error_context); 00047 typedef int(*IO_CLOSE)(CONCRETE_IO_HANDLE concrete_io, ON_IO_CLOSE_COMPLETE on_io_close_complete, void* callback_context); 00048 typedef int(*IO_SEND)(CONCRETE_IO_HANDLE concrete_io, const void* buffer, size_t size, ON_SEND_COMPLETE on_send_complete, void* callback_context); 00049 typedef void(*IO_DOWORK)(CONCRETE_IO_HANDLE concrete_io); 00050 typedef int(*IO_SETOPTION)(CONCRETE_IO_HANDLE concrete_io, const char* optionName, const void* value); 00051 00052 00053 typedef struct IO_INTERFACE_DESCRIPTION_TAG 00054 { 00055 IO_RETRIEVEOPTIONS concrete_io_retrieveoptions; 00056 IO_CREATE concrete_io_create; 00057 IO_DESTROY concrete_io_destroy; 00058 IO_OPEN concrete_io_open; 00059 IO_CLOSE concrete_io_close; 00060 IO_SEND concrete_io_send; 00061 IO_DOWORK concrete_io_dowork; 00062 IO_SETOPTION concrete_io_setoption; 00063 } IO_INTERFACE_DESCRIPTION; 00064 00065 MOCKABLE_FUNCTION(, XIO_HANDLE, xio_create, const IO_INTERFACE_DESCRIPTION*, io_interface_description, const void*, io_create_parameters); 00066 MOCKABLE_FUNCTION(, void, xio_destroy, XIO_HANDLE, xio); 00067 MOCKABLE_FUNCTION(, int, xio_open, XIO_HANDLE, xio, ON_IO_OPEN_COMPLETE, on_io_open_complete, void*, on_io_open_complete_context, ON_BYTES_RECEIVED, on_bytes_received, void*, on_bytes_received_context, ON_IO_ERROR, on_io_error, void*, on_io_error_context); 00068 MOCKABLE_FUNCTION(, int, xio_close, XIO_HANDLE, xio, ON_IO_CLOSE_COMPLETE, on_io_close_complete, void*, callback_context); 00069 MOCKABLE_FUNCTION(, int, xio_send, XIO_HANDLE, xio, const void*, buffer, size_t, size, ON_SEND_COMPLETE, on_send_complete, void*, callback_context); 00070 MOCKABLE_FUNCTION(, void, xio_dowork, XIO_HANDLE, xio); 00071 MOCKABLE_FUNCTION(, int, xio_setoption, XIO_HANDLE, xio, const char*, optionName, const void*, value); 00072 MOCKABLE_FUNCTION(, OPTIONHANDLER_HANDLE, xio_retrieveoptions, XIO_HANDLE, xio); 00073 00074 #ifdef __cplusplus 00075 } 00076 #endif /* __cplusplus */ 00077 00078 #endif /* XIO_H */
Generated on Tue Jul 12 2022 12:43:25 by
