mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-13 15:41:17 +00:00
util: add btstack_util
This commit is contained in:
parent
64eccac7d9
commit
5d067ab1c4
@ -312,3 +312,14 @@ int sscanf_bd_addr(const char * addr_string, bd_addr_t addr){
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t btstack_atoi(const char *str){
|
||||
uint32_t val = 0;
|
||||
while (1){
|
||||
char chr = *str;
|
||||
if (!chr || chr < '0' || chr > '9')
|
||||
return val;
|
||||
val = (val * 10) + (chr - '0');
|
||||
str++;
|
||||
}
|
||||
}
|
@ -216,6 +216,14 @@ void uuid_add_bluetooth_prefix(uint8_t * uuid128, uint32_t short_uuid);
|
||||
*/
|
||||
int uuid_has_bluetooth_prefix(uint8_t * uuid128);
|
||||
|
||||
/**
|
||||
* @brief Parse unsigned number
|
||||
* @param str to parse
|
||||
* @return value
|
||||
*/
|
||||
uint32_t btstack_atoi(const char *str);
|
||||
|
||||
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user