diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2005-03-27 14:43:44 +0000 | 
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2005-03-27 14:43:44 +0000 | 
| commit | 4c2d1cbe438713b5d6c350ee0983e1d312c69823 (patch) | |
| tree | 477590f16366f1ce3bae4b4a034de309f2f32fd0 | |
| parent | 9280b803576dc54bfc7f51c8e5154d1f29692991 (diff) | |
Add ba2oui() function
| -rw-r--r-- | include/bluetooth.h | 1 | ||||
| -rw-r--r-- | src/bluetooth.c | 8 | 
2 files changed, 9 insertions, 0 deletions
diff --git a/include/bluetooth.h b/include/bluetooth.h index d7747996..276831ae 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -128,6 +128,7 @@ bdaddr_t *strtoba(const char *str);  char *batostr(const bdaddr_t *ba);  int ba2str(const bdaddr_t *ba, char *str);  int str2ba(const char *str, bdaddr_t *ba); +int ba2oui(const bdaddr_t *ba, char *oui);  int baprintf(const char *format, ...);  int bafprintf(FILE *stream, const char *format, ...); diff --git a/src/bluetooth.c b/src/bluetooth.c index 484b263b..0f4c49e6 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -106,6 +106,14 @@ int str2ba(const char *str, bdaddr_t *ba)  	return 0;  } +int ba2oui(const bdaddr_t *ba, char *str) +{ +	uint8_t b[6]; + +	baswap((bdaddr_t *) b, ba); +	return sprintf(str, "%2.2X-%2.2X-%2.2X", b[0], b[1], b[2]); +} +  int baprintf(const char *format, ...)  {  	va_list ap;  | 
