Embedded Wireless Framework
ewf.h
Go to the documentation of this file.
1 /************************************************************************/
9 #ifndef __ewf__h__included__
10 #define __ewf__h__included__
11 
12 /************************************************************************/
26 #include "ewf.config.h"
27 
28 #include "ewf_ids.h"
29 
30 #ifdef EWF_DEBUG
31 #include <stdio.h>
32 #endif
33 
34 #include <stdint.h>
35 #include <stdbool.h>
36 #include <inttypes.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /************************************************************************/
57 typedef enum _ewf_result
58 {
59  /* Non error results - positive or zero */
60 
67  /* Error results - negative */
68 
101  /* EWF Apdater MQTT Result codes */
109 
121 #define ewf_result_failed(code) (EWF_RESULT_OK > (code))
122 
126 #define ewf_result_succeeded(code) ((code) >= EWF_RESULT_OK)
127 
141 #ifndef EWF_LOG
142 #ifndef EWF_DEBUG
143 #define EWF_LOG(...)
144 #else
145 #define EWF_LOG(...) \
146 do { \
147  (void)fprintf(stdout, __VA_ARGS__); \
148  (void)fflush(stdout); \
149 } while (0)
150 #endif
151 #endif
152 
153 #ifndef EWF_LOG_ERROR
154 #ifndef EWF_DEBUG
155 #define EWF_LOG_ERROR(...)
156 #else
157 #define EWF_LOG_ERROR(...) \
158 do { \
159  EWF_LOG( \
160  "\n\n" \
161  "ERROR:\n" \
162  "[%s]:[%d]\n" \
163  "function: [%s]\n\n", \
164  __FILE__, __LINE__, __func__); \
165  EWF_LOG(__VA_ARGS__); \
166 } while (0)
167 #endif
168 #endif
169 
179 struct _ewf_adapter;
180 
182 typedef struct _ewf_adapter ewf_adapter;
183 
185 struct _ewf_interface;
186 
188 typedef struct _ewf_interface ewf_interface;
189 
191 struct _ewf_allocator;
192 
194 typedef struct _ewf_allocator ewf_allocator;
195 
197 struct _ewf_message;
198 
200 typedef struct _ewf_message ewf_message;
201 
204 
207 
210 /* Disable warning of parameter not used. */
211 
218 #ifndef EWF_PARAMETER_NOT_USED
219 #define EWF_PARAMETER_NOT_USED(p) ((void)(p))
220 #endif /* EWF_PARAMETER_NOT_USED */
221 
224 /************************************************************************/
228 #ifdef __cplusplus
229 }
230 #endif
231 
232 #endif /* __ewf__h__included__ */
enum _ewf_result ewf_result
Success and error result codes specific to the EWF API.
_ewf_result
Success and error result codes specific to the EWF API.
Definition: ewf.h:58
@ EWF_RESULT_ADAPTER_TRANSMIT_FAILED
Definition: ewf.h:95
@ EWF_RESULT_RECEPTION_FAILED
Definition: ewf.h:81
@ EWF_RESULT_ADAPTER_RECEIVE_FAILED
Definition: ewf.h:94
@ EWF_RESULT_ADAPTER_NETWORK_NOT_REGISTERED
Definition: ewf.h:99
@ EWF_RESULT_INVALID_FUNCTION_ARGUMENT
Definition: ewf.h:69
@ EWF_RESULT_UNHANDLED_URC
Definition: ewf.h:63
@ EWF_RESULT_UNEXPECTED_RESPONSE
Definition: ewf.h:75
@ EWF_RESULT_NOT_SUPPORTED
Definition: ewf.h:71
@ EWF_RESULT_OUT_OF_MEMORY
Definition: ewf.h:70
@ EWF_RESULT_NO_DATA_AVAILABLE
Definition: ewf.h:65
@ EWF_RESULT_ADAPTER_MQTT_PUBLISH_FAILED
Definition: ewf.h:104
@ EWF_RESULT_INVALID_SOCKET
Definition: ewf.h:85
@ EWF_RESULT_EMPTY_QUEUE
Definition: ewf.h:77
@ EWF_RESULT_SOCKET_NOT_OPEN
Definition: ewf.h:86
@ EWF_RESULT_ADAPTER_MQTT_DISCONNECTED
Definition: ewf.h:103
@ EWF_RESULT_NO_DATA_RECEIVED
Definition: ewf.h:82
@ EWF_RESULT_ALLOCATOR_INITIALIZATION_FAILED
Definition: ewf.h:97
@ EWF_RESULT_FULL_QUEUE
Definition: ewf.h:78
@ EWF_RESULT_ADAPTER_MQTT_SUBSCRIBE_FAILED
Definition: ewf.h:105
@ EWF_RESULT_TIMEOUT
Definition: ewf.h:72
@ EWF_RESULT_INTERFACE_SEND_FAILED
Definition: ewf.h:89
@ EWF_RESULT_INTERFACE_INITIALIZATION_FAILED
Definition: ewf.h:88
@ EWF_RESULT_CONNECTION_FAILED
Definition: ewf.h:80
@ EWF_RESULT_ADAPTER_RESPONDED_ERROR
Definition: ewf.h:93
@ EWF_RESULT_ADAPTER_MQTT_MESSAGE_GET_FAILED
Definition: ewf.h:106
@ EWF_RESULT_IRRECOVERABLE_ERROR
Definition: ewf.h:73
@ EWF_RESULT_OK
Definition: ewf.h:61
@ EWF_RESULT_ADAPTER_MQTT_CONNECTION_FAILED
Definition: ewf.h:102
@ EWF_RESULT_ADAPTER_INITIALIZATION_FAILED
Definition: ewf.h:92
@ EWF_RESULT_TOO_MANY_OPEN_SOCKETS
Definition: ewf.h:84
@ EWF_RESULT_INTERFACE_RECEIVE_FAILED
Definition: ewf.h:90
The EWF network adapter control structure definition.
Definition: ewf_adapter.h:50
The allocator structure definition.
Definition: ewf_allocator.h:27
The interface structure definition.
Definition: ewf_interface.h:66
The interface message structure definition.
Definition: ewf_message.h:27
The interface tokenizer pattern structure definition.
Definition: ewf_tokenizer.h:27