@@ -24,12 +24,11 @@ public:
|
||||
return (linkkey_t){{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
}
|
||||
|
||||
static char* ToString(const linkkey_t lk)
|
||||
static BString ToString(const linkkey_t lk)
|
||||
{
|
||||
// TODO: not safe
|
||||
static char str[50];
|
||||
BString str;
|
||||
|
||||
sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:"
|
||||
str.SetToFormat("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:"
|
||||
"%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
|
||||
lk.l[0], lk.l[1], lk.l[2], lk.l[3], lk.l[4], lk.l[5],
|
||||
lk.l[6], lk.l[7], lk.l[8], lk.l[9], lk.l[10], lk.l[11],
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <String.h>
|
||||
|
||||
#include <bluetooth/bluetooth.h>
|
||||
|
||||
namespace Bluetooth {
|
||||
@@ -45,12 +47,11 @@ public:
|
||||
memcpy(&dst, &src, sizeof(bdaddr_t));
|
||||
}
|
||||
|
||||
static char* ToString(const bdaddr_t bdaddr)
|
||||
static BString ToString(const bdaddr_t bdaddr)
|
||||
{
|
||||
// TODO: not safe
|
||||
static char str[18];
|
||||
BString str;
|
||||
|
||||
sprintf(str,"%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",bdaddr.b[5],
|
||||
str.SetToFormat("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",bdaddr.b[5],
|
||||
bdaddr.b[4], bdaddr.b[3], bdaddr.b[2], bdaddr.b[1],
|
||||
bdaddr.b[0]);
|
||||
return str;
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
PincodeWindow(RemoteDevice* rDevice);
|
||||
virtual void MessageReceived(BMessage *msg);
|
||||
virtual bool QuitRequested();
|
||||
void SetBDaddr(const char* address);
|
||||
void SetBDaddr(BString address);
|
||||
|
||||
private:
|
||||
void InitUI();
|
||||
|
||||
@@ -187,7 +187,7 @@ bool PincodeWindow::QuitRequested()
|
||||
}
|
||||
|
||||
|
||||
void PincodeWindow::SetBDaddr(const char* address)
|
||||
void PincodeWindow::SetBDaddr(BString address)
|
||||
{
|
||||
BString label;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user