Lines Matching refs:str
53 char *str = bt_malloc(18);
54 if (!str)
57 sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
61 return str;
64 bdaddr_t *strtoba(const char *str)
70 str2ba(str, &b);
77 int ba2str(const bdaddr_t *ba, char *str)
79 return sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
83 int str2ba(const char *str, bdaddr_t *ba)
88 if (bachk(str) < 0) {
93 for (i = 0; i < 6; i++, str += 3)
94 b.b[i] = strtol(str, NULL, 16);
101 int ba2oui(const bdaddr_t *ba, char *str)
103 return sprintf(str, "%2.2X-%2.2X-%2.2X", ba->b[5], ba->b[4], ba->b[3]);
106 int bachk(const char *str)
108 if (!str)
111 if (strlen(str) != 17)
114 while (*str) {
115 if (!isxdigit(*str++))
118 if (!isxdigit(*str++))
121 if (*str == 0)
124 if (*str++ != ':')
155 int basprintf(char *str, const char *format, ...)
161 len = vsnprintf(str, (~0U) >> 1, format, ap);
167 int basnprintf(char *str, size_t size, const char *format, ...)
173 len = vsnprintf(str, size, format, ap);