9 #ifndef __ewf_interface_win32_com__h__included__
10 #define __ewf_interface_win32_com__h__included__
34 #ifndef EWF_INTERFACE_WIN32_COM_CONFIG_RX_BUFFER_SIZE
35 #define EWF_INTERFACE_WIN32_COM_CONFIG_RX_BUFFER_SIZE (1)
38 #ifndef EWF_INTERFACE_WIN32_COM_CONFIG_RESPONSE_QUEUE_SIZE
39 #define EWF_INTERFACE_WIN32_COM_CONFIG_RESPONSE_QUEUE_SIZE (8)
42 #ifndef EWF_INTERFACE_WIN32_COM_CONFIG_URC_QUEUE_SIZE
43 #define EWF_INTERFACE_WIN32_COM_CONFIG_URC_QUEUE_SIZE (8)
54 const char* com_port_cstr;
55 BYTE buffer[EWF_INTERFACE_WIN32_COM_CONFIG_RX_BUFFER_SIZE];
85 #ifdef EWF_PARAMETER_CHECKING
86 #define EWF_INTERFACE_WIN32_COM_INITIALIZE_HEADER(interface_ptr) \
88 (interface_ptr)->struct_magic = EWF_INTERFACE_STRUCT_MAGIC; \
89 (interface_ptr)->struct_size = EWF_INTERFACE_STRUCT_SIZE; \
90 (interface_ptr)->struct_version = EWF_INTERFACE_VERSION; \
91 (interface_ptr)->struct_type = EWF_INTERFACE_TYPE_WIN32_COM; \
94 #define EWF_INTERFACE_WIN32_COM_INITIALIZE_HEADER(interface_ptr)
107 #define EWF_INTERFACE_WIN32_COM_STATIC_DECLARE(interface_ptr, interface_name_symb, com_port_cstr_param, BaudRate_param, ByteSize_param, Parity_param, StopBits_param) \
109 static ewf_interface_win32_com ewf_interface_win32_com__implementation__##interface_name_symb = {0}; \
110 static ewf_interface ewf_interface_win32_com__interface__##interface_name_symb = {0}; \
111 ewf_interface_win32_com__implementation__##interface_name_symb.hComm = NULL; \
112 ewf_interface_win32_com__implementation__##interface_name_symb.com_port_cstr = com_port_cstr_param; \
113 ewf_interface_win32_com__implementation__##interface_name_symb.BaudRate = BaudRate_param; \
114 ewf_interface_win32_com__implementation__##interface_name_symb.ByteSize = ByteSize_param; \
115 ewf_interface_win32_com__implementation__##interface_name_symb.Parity = Parity_param; \
116 ewf_interface_win32_com__implementation__##interface_name_symb.StopBits = StopBits_param; \
117 EWF_PLATFORM_QUEUE_STATIC_DECLARE( \
118 ewf_interface_win32_com__interface__##interface_name_symb.response_queue_ptr, \
119 ewf_interface_win32_com__response_queue__##interface_name_symb, \
120 ewf_interface_message, \
121 EWF_INTERFACE_WIN32_COM_CONFIG_RESPONSE_QUEUE_SIZE); \
122 EWF_PLATFORM_QUEUE_STATIC_DECLARE( \
123 ewf_interface_win32_com__interface__##interface_name_symb.urc_queue_ptr, \
124 ewf_interface_win32_com__urc_queue__##interface_name_symb, \
125 ewf_interface_message, \
126 EWF_INTERFACE_WIN32_COM_CONFIG_URC_QUEUE_SIZE); \
127 ewf_interface_win32_com__interface__##interface_name_symb.hardware_start = ewf_interface_win32_com_hardware_start; \
128 ewf_interface_win32_com__interface__##interface_name_symb.hardware_stop = ewf_interface_win32_com_hardware_stop; \
129 ewf_interface_win32_com__interface__##interface_name_symb.hardware_send = ewf_interface_win32_com_hardware_send; \
130 ewf_interface_win32_com__interface__##interface_name_symb.hardware_receive = ewf_interface_win32_com_hardware_receive; \
131 ewf_interface_win32_com__interface__##interface_name_symb.implementation_ptr = &(ewf_interface_win32_com__implementation__##interface_name_symb); \
132 interface_ptr = &(ewf_interface_win32_com__interface__##interface_name_symb); \
133 EWF_INTERFACE_WIN32_COM_INITIALIZE_HEADER(interface_ptr); \
The Embedded Wireless Framework host interface API.
enum _ewf_result ewf_result
Success and error result codes specific to the EWF API.
ewf_result ewf_interface_win32_com_hardware_receive(ewf_interface *interface_ptr, uint8_t *buffer_ptr, uint32_t *buffer_length_ptr, bool wait)
Receive a buffer using the WIN32 COM hardware interface.
Definition: ewf_interface_win32_com.c:194
ewf_result ewf_interface_win32_com_hardware_send(ewf_interface *interface_ptr, const uint8_t *buffer_ptr, uint32_t buffer_length)
Send a buffer using the WIN32 COM hardware interface.
Definition: ewf_interface_win32_com.c:126
struct _ewf_interface_win32_com ewf_interface_win32_com
the WIN32 COM host interface implementation data structure type
ewf_result ewf_interface_win32_com_hardware_start(ewf_interface *interface_ptr)
Start the WIN32 COM hardware interface.
Definition: ewf_interface_win32_com.c:21
ewf_result ewf_interface_win32_com_hardware_stop(ewf_interface *interface_ptr)
Stop the WIN32 COM hardware interface.
Definition: ewf_interface_win32_com.c:102
the WIN32 COM host interface implementation data structure type
Definition: ewf_interface_win32_com.h:52
The interface structure definition.
Definition: ewf_interface.h:66