ioLibrary for Cortex M series
|
![]() |
Modules | |
Alarm | |
Base64 | |
Macro Util | |
Functions | |
int8_t | digit_length (int32_t dgt, int8_t base) |
int32_t | str_check (int(*method)(int), int8_t *str) |
void | print_dump (void *buf, uint16_t len) |
uint16_t | checksum (uint8_t *src, uint32_t len) |
int8_t digit_length | ( | int32_t | dgt, |
int8_t | base | ||
) |
int32_t str_check | ( | int(*)(int) | method, |
int8_t * | str | ||
) |
Check string with standard library method. Below is the method you can use.
Ex) str_check(isdigit, "12345") : This will return RET_OK.
Ex) str_check(islower, "AbcDe") : This will return RET_NOK.
method | The method to use for check |
str | The string to check |
Definition at line 232 of file util.c.
References RET_NOK, and RET_OK.
Referenced by ip_check(), and mac_check().
void print_dump | ( | void * | buf, |
uint16_t | len | ||
) |
Separate string into small peace by delimiter like strtok. But if the input string contains more than one character from delimiter
in a row, strsep returns an empty string for each pair of characters from delimiter.
Ex) strsep("a,b,c,,,f,gh", ",") : When meet ,,, strtok returns 'f' but this returns NULL.
stringp | String to separate |
delim | Delimiter |
buf | The data to print |
len | The data length |