Implementation for pretty_showing bluetooth physical addresses
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24123 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -8,6 +8,8 @@
|
|||||||
#ifndef _BDADDR_UTILS_H
|
#ifndef _BDADDR_UTILS_H
|
||||||
#define _BDADDR_UTILS_H
|
#define _BDADDR_UTILS_H
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <bluetooth/bluetooth.h>
|
#include <bluetooth/bluetooth.h>
|
||||||
|
|
||||||
namespace Bluetooth {
|
namespace Bluetooth {
|
||||||
@@ -36,11 +38,18 @@ class bdaddrUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const char* ToString(bdaddr_t bdaddr)
|
static char* ToString(const bdaddr_t bdaddr)
|
||||||
{
|
{
|
||||||
// TODO:
|
// TODO: not safe
|
||||||
static char str[12];
|
static char str[18];
|
||||||
|
|
||||||
|
sprintf(str,"%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",bdaddr.b[0],
|
||||||
|
bdaddr.b[1],
|
||||||
|
bdaddr.b[2],
|
||||||
|
bdaddr.b[3],
|
||||||
|
bdaddr.b[4],
|
||||||
|
bdaddr.b[5]);
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,4 +57,9 @@ class bdaddrUtils {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _BT_USE_EXPLICIT_NAMESPACE
|
||||||
|
using Bluetooth::bdaddrUtils;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user