Embedded Wireless Framework
Data Structures | Macros | Typedefs | Functions
ewf_interface.h File Reference

The Embedded Wireless Framework host interface API. More...

#include "ewf.h"
#include "ewf_platform.h"
#include "ewf_allocator.h"
#include "ewf_tokenizer.h"
#include "ewf_message.h"

Go to the source code of this file.

Data Structures

struct  _ewf_interface
 The interface structure definition. More...
 

Macros

#define EWF_INTERFACE_STRUCT_MAGIC   (0x017eface) /* ~~ i(n)te(r)face */
 
#define EWF_INTERFACE_STRUCT_SIZE   (sizeof(struct _ewf_interface))
 
#define EWF_INTERFACE_VERSION   (EWF_DEVELOPER_MICROSOFT | 0x0001)
 
#define EWF_INTERFACE_VALIDATE_POINTER(interface_ptr)
 
#define EWF_INTERFACE_VALIDATE_POINTER_TYPE(interface_ptr, interface_type)
 

Typedefs

typedef ewf_message ewf_interface_message
 Legacy type for messages.
 
typedef ewf_tokenizer_pattern ewf_interface_tokenizer_pattern
 Legacy type for tokenizer patters.
 
typedef ewf_result(* ewf_interface_response_callback) (ewf_interface *interface_ptr, uint8_t *buffer_ptr, uint32_t length)
 a function pointer type for response callbacks
 
typedef ewf_result(* ewf_interface_urc_callback) (ewf_interface *interface_ptr, uint8_t *buffer_ptr, uint32_t length)
 a function pointer type for URC callbacks
 

Functions

ewf_result ewf_interface_init (ewf_interface *interface_ptr)
 Initialize the interface This initializes the internal status of the control structure This doesn't start the hardware interface Call ewf_interface_start to start the interface before using it. More...
 
ewf_result ewf_interface_clean (ewf_interface *interface_ptr)
 Cleanup the interface This is called after the interface has been stopped It releases resources used by the internal status of interface control structure. More...
 
ewf_result ewf_interface_start (ewf_interface *interface_ptr)
 Starts the interface. More...
 
ewf_result ewf_interface_stop (ewf_interface *interface_ptr)
 Stops the interface. More...
 
ewf_result ewf_interface_send (ewf_interface *interface_ptr, const uint8_t *buffer_ptr, uint32_t buffer_length)
 Sends data to the interface. More...
 
ewf_result ewf_interface_receive_response (ewf_interface *interface_ptr, uint8_t **buffer_ptr_ptr, uint32_t *buffer_length_ptr, uint32_t wait_time)
 Read a response message from the interface. More...
 
ewf_result ewf_interface_receive_urc (ewf_interface *interface_ptr, uint8_t **buffer, uint32_t *buffer_length_ptr, uint32_t wait_time)
 Receive a message from the URC queue. More...
 
ewf_result ewf_interface_message_allocator_set (ewf_interface *interface_ptr, ewf_allocator *allocator_ptr)
 Set the interface message allocator. More...
 
ewf_result ewf_interface_data_allocator_set (ewf_interface *interface_ptr, ewf_allocator *allocator_ptr)
 Set the interface data allocator. More...
 
ewf_result ewf_interface_release (ewf_interface *interface_ptr, void *buffer_ptr)
 Release a message buffer returned by the interface. More...
 
ewf_result ewf_interface_release_data (ewf_interface *interface_ptr, void *buffer_ptr)
 Release a data buffer returned by the interface. More...
 
ewf_result ewf_interface_default_timeout_set (ewf_interface *interface_ptr, uint32_t timeout)
 Set the interface default timeout value. More...
 
ewf_result ewf_interface_default_timeout_get (ewf_interface *interface_ptr, uint32_t *timeout_ptr)
 Get the current interface default timeout value. More...
 
ewf_result ewf_interface_tokenizer_message_pattern_set (ewf_interface *interface_ptr, ewf_interface_tokenizer_pattern *tokenizer_patter_ptr)
 Set the interface message tokenizer pattern. More...
 
ewf_result ewf_interface_tokenizer_message_pattern_get (ewf_interface *interface_ptr, ewf_interface_tokenizer_pattern **tokenizer_patter_ptr_ptr)
 Get the interface message tokenizer pattern. More...
 
ewf_result ewf_interface_tokenizer_command_response_end_pattern_set (ewf_interface *interface_ptr, ewf_interface_tokenizer_pattern *tokenizer_patter_ptr)
 Set the interface command response end tokenizer pattern. More...
 
ewf_result ewf_interface_tokenizer_command_response_end_pattern_get (ewf_interface *interface_ptr, ewf_interface_tokenizer_pattern **tokenizer_patter_ptr_ptr)
 Get the interface command response end tokenizer pattern. More...
 
ewf_result ewf_interface_tokenizer_command_response_pattern_set (ewf_interface *interface_ptr, ewf_interface_tokenizer_pattern *tokenizer_patter_ptr)
 Set the interface command response tokenizer pattern. More...
 
ewf_result ewf_interface_tokenizer_command_response_pattern_get (ewf_interface *interface_ptr, ewf_interface_tokenizer_pattern **tokenizer_patter_ptr_ptr)
 Get the interface command response tokenizer pattern. More...
 
ewf_result ewf_interface_tokenizer_urc_pattern_set (ewf_interface *interface_ptr, ewf_interface_tokenizer_pattern *tokenizer_patter_ptr)
 Set the interface URC tokenizer pattern. More...
 
ewf_result ewf_interface_tokenizer_urc_pattern_get (ewf_interface *interface_ptr, ewf_interface_tokenizer_pattern **tokenizer_patter_ptr_ptr)
 Get the interface URC tokenizer pattern. More...
 
ewf_result ewf_interface_process_byte (ewf_interface *interface_ptr, uint8_t b)
 Called by the hardware code to process an incoming byte When the hardware interface receives a byte it used this function to pase this byte to the common code for further processing. Typically used to process commands, when in command mode. More...
 
ewf_result ewf_interface_process_buffer (ewf_interface *interface_ptr, uint8_t *buffer_ptr, uint32_t buffer_length)
 Called by the hardware code to process a buffer When the hardware interface receives a byte it used this function to pase this byte to the common code for further processing. Typically used to process data. More...
 
ewf_result ewf_interface_urc_processing (ewf_interface *interface_ptr)
 Call periodically to process URCs This is called internally by the URC thread. Call manually if there is not threading. More...
 
ewf_result ewf_interface_urc_process_message (ewf_interface *interface_ptr, uint8_t *buffer_ptr, uint32_t buffer_length)
 Process a URC message. More...
 
ewf_result ewf_interface_poll (ewf_interface *interface_ptr)
 
ewf_result ewf_interface_receive_poll (ewf_interface *interface_ptr)
 
ewf_result ewf_interface_process_poll (ewf_interface *interface_ptr)
 
ewf_result ewf_interface_set_response_callback (ewf_interface *interface_ptr, ewf_interface_response_callback callback)
 register a user callback for responses More...
 
ewf_result ewf_interface_set_urc_callback (ewf_interface *interface_ptr, ewf_interface_urc_callback callback)
 register a callback for URC More...
 
ewf_result ewf_interface_set_user_urc_callback (ewf_interface *interface_ptr, ewf_interface_urc_callback callback)
 register a user callback for URC More...
 
ewf_result ewf_interface_send_command (ewf_interface *interface_ptr, const char *command_str)
 Send a command. More...
 
ewf_result ewf_interface_send_commands (ewf_interface *interface_ptr, const char *command_str,...)
 Send a command. More...
 
ewf_result ewf_interface_drop_all_responses (ewf_interface *interface_ptr)
 Drop all responses from the interface. More...
 
ewf_result ewf_interface_drop_response (ewf_interface *interface_ptr)
 Drop a single response from the interface. More...
 
ewf_result ewf_interface_get_response (ewf_interface *interface_ptr, uint8_t **response_out)
 Get a response from the interface. More...
 
ewf_result ewf_interface_verify_response (ewf_interface *interface_ptr, const char *expected_str)
 Verify an interface response, compare against a string. More...
 
ewf_result ewf_interface_verify_responses (ewf_interface *interface_ptr, uint32_t response_count, const char **expected_str_arr)
 Verify an interface response, compare agains an array of strings. More...
 
ewf_result ewf_interface_verify_response_starts_with (ewf_interface *interface_ptr, const char *expected_start_str)
 Verify if interface response starts with expected string. More...
 
ewf_result ewf_interface_verify_response_ends_with (ewf_interface *interface_ptr, const char *expected_end_str)
 Verify if interface response starts with expected string. More...
 

Detailed Description

The Embedded Wireless Framework host interface API.

Version
Preview