Embedded Wireless Framework
ewf_lib.h
Go to the documentation of this file.
1 /************************************************************************/
9 #ifndef __ewf_lib__h__included__
10 #define __ewf_lib__h__included__
11 
12 #include "ewf.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /************************************************************************/
24 /************************************************************************/
35 #ifdef EWF_DEBUG // only in debug configurations!!!
36 
51 const char * ewfl_escape_str_to_str_buffer(const char * str, uint32_t len);
52 
53 #endif
54 
62 char * ewfl_unsigned_to_str(uint32_t u, char * str, uint32_t len);
63 
74 uint32_t ewfl_str_to_unsigned(const char * str);
75 
85 uint32_t ewfl_str_length(const char * str);
86 
100 bool ewfl_str_starts_with(const char * str, const char * prefix_str);
101 
115 bool ewfl_str_ends_with(const char* str, const char* suffix_str);
116 
121 bool ewfl_buffer_starts_with(const uint8_t* buffer_ptr, uint32_t buffer_length, const uint8_t* prefix_ptr, uint32_t prefix_length);
122 
127 bool ewfl_buffer_ends_with(const uint8_t* buffer_ptr, uint32_t buffer_length, const uint8_t* suffix_ptr, uint32_t suffix_length);
128 
134 bool ewfl_buffer_ends_with_wildcard_string(const uint8_t* buffer_ptr, uint32_t buffer_length, const uint8_t* suffix_ptr, uint32_t suffix_length);
135 
150 bool ewfl_str_equals_str(const char * str1, const char * str2);
151 
167 bool ewfl_buffer_equals_buffer(const uint8_t* buffer1, const uint8_t* buffer2, uint32_t length);
168 
180 bool ewfl_str_contains_str(const char * str, const char * substr);
181 
190 char * ewfl_str_n_cpy(char* dest, const char* src_str, uint32_t n);
191 
198 char * ewfl_str_remove_white_spaces(char* str);
199 
207 char * ewfl_str_remove_suffix_str(char* str, const char * suffix_str);
208 
216 char* ewfl_adapter_response_str_extract(char* str);
217 
227 char* ewfl_find_chars_with_terms(char* str, char* chars_str, char* term_str);
228 
234 char* ewfl_str_tok(char* str, const char* delim, char** saveptr);
235 
236 /************************************************************************/
240 /************************************************************************/
244 #ifdef __cplusplus
245 }
246 #endif
247 
248 #endif /* __ewf_lib__h__included__ */
The Embedded Wireless Framework.
char * ewfl_str_tok(char *str, const char *delim, char **saveptr)
Wrapper function with functionality equivalent to strtok_s / strtok_r.
Definition: ewf_lib.c:305
bool ewfl_buffer_starts_with(const uint8_t *buffer_ptr, uint32_t buffer_length, const uint8_t *prefix_ptr, uint32_t prefix_length)
Checks if a buffer starts with a string.
Definition: ewf_lib.c:133
bool ewfl_buffer_ends_with_wildcard_string(const uint8_t *buffer_ptr, uint32_t buffer_length, const uint8_t *suffix_ptr, uint32_t suffix_length)
Checks if a buffer ends with a string containing wildcards The current version supports question mark...
Definition: ewf_lib.c:164
bool ewfl_buffer_equals_buffer(const uint8_t *buffer1, const uint8_t *buffer2, uint32_t length)
Checks if two buffers are equal.
Definition: ewf_lib.c:194
uint32_t ewfl_str_to_unsigned(const char *str)
Parse an uint32_t from a string.
Definition: ewf_lib.c:97
bool ewfl_buffer_ends_with(const uint8_t *buffer_ptr, uint32_t buffer_length, const uint8_t *suffix_ptr, uint32_t suffix_length)
Checks if a buffer ends with a string.
Definition: ewf_lib.c:148
char * ewfl_str_remove_white_spaces(char *str)
Remove leading and trailing white space characters.
Definition: ewf_lib.c:232
bool ewfl_str_equals_str(const char *str1, const char *str2)
Checks if two strings are equal.
Definition: ewf_lib.c:186
char * ewfl_str_n_cpy(char *dest, const char *src_str, uint32_t n)
Copies source string to destination buffer and terminates it by NULL.
Definition: ewf_lib.c:226
char * ewfl_adapter_response_str_extract(char *str)
Parse adapter response by trimming white space and "OK".
Definition: ewf_lib.c:264
bool ewfl_str_contains_str(const char *str, const char *substr)
Searches for a string in a substring.
Definition: ewf_lib.c:204
char * ewfl_str_remove_suffix_str(char *str, const char *suffix_str)
Remove suffix from string.
Definition: ewf_lib.c:249
char * ewfl_find_chars_with_terms(char *str, char *chars_str, char *term_str)
Find the next matching character from several of many in a string, break and fail on matching custom ...
Definition: ewf_lib.c:273
char * ewfl_unsigned_to_str(uint32_t u, char *str, uint32_t len)
Converts an uint32_t to a string.
Definition: ewf_lib.c:82
bool ewfl_str_ends_with(const char *str, const char *suffix_str)
Tests for a string end match.
Definition: ewf_lib.c:121
uint32_t ewfl_str_length(const char *str)
Returns the length of the passed NULL terminated string.
Definition: ewf_lib.c:106
bool ewfl_str_starts_with(const char *str, const char *prefix_str)
Tests for a string start match.
Definition: ewf_lib.c:114