2007-10-21 17:56:01 +00:00
|
|
|
/*
|
2007-11-30 19:51:44 +00:00
|
|
|
* Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
|
|
|
|
*
|
|
|
|
* All rights reserved. Distributed under the terms of the MIT License.
|
2007-10-21 17:56:01 +00:00
|
|
|
*
|
|
|
|
*/
|
2007-11-30 19:51:44 +00:00
|
|
|
|
2007-10-21 17:56:01 +00:00
|
|
|
#ifndef _BDADDR_UTILS_H
|
|
|
|
#define _BDADDR_UTILS_H
|
|
|
|
|
2007-10-22 17:51:59 +00:00
|
|
|
#include <bluetooth/bluetooth.h>
|
2007-10-21 17:56:01 +00:00
|
|
|
|
|
|
|
namespace Bluetooth {
|
|
|
|
|
2007-10-22 17:51:59 +00:00
|
|
|
class bdaddrUtils {
|
|
|
|
|
|
|
|
public:
|
2007-11-30 19:51:44 +00:00
|
|
|
static inline bdaddr_t NullAddress()
|
2007-10-22 17:51:59 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
return ((bdaddr_t) {{0, 0, 0, 0, 0, 0}});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline bdaddr_t LocalAddress()
|
|
|
|
{
|
|
|
|
|
|
|
|
return ((bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline bdaddr_t BroadcastAddress()
|
|
|
|
{
|
|
|
|
|
|
|
|
return ((bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const char* ToString(bdaddr_t bdaddr)
|
|
|
|
{
|
|
|
|
// TODO:
|
|
|
|
static char str[12];
|
2007-10-21 17:56:01 +00:00
|
|
|
|
2007-10-22 17:51:59 +00:00
|
|
|
return str;
|
|
|
|
}
|
2007-10-21 17:56:01 +00:00
|
|
|
|
2007-10-22 17:51:59 +00:00
|
|
|
};
|
|
|
|
|
2007-10-21 17:56:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|