7 #include <osmocore/utils.h>
9 static char namebuf[255];
10 const char *get_value_string(const struct value_string *vs, uint32_t val)
15 if (vs[i].value == 0 && vs[i].str == NULL)
17 if (vs[i].value == val)
21 snprintf(namebuf, sizeof(namebuf), "unknown 0x%x", val);
25 int get_string_value(const struct value_string *vs, const char *str)
30 if (vs[i].value == 0 && vs[i].str == NULL)
32 if (!strcasecmp(vs[i].str, str))
38 char bcd2char(uint8_t bcd)
43 return 'A' + (bcd - 0xa);
46 /* only works for numbers in ascci */
47 uint8_t char2bcd(char c)