summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Krasnyansky <maxk@qualcomm.com>2002-03-28 23:11:53 +0000
committerMax Krasnyansky <maxk@qualcomm.com>2002-03-28 23:11:53 +0000
commit21efc9d87640fa0d9b78a311677e316590515171 (patch)
tree6d8adf35f22e36f8574a81a9fe91a24dd7555ff5
parent59fa39d1686237493fce068472e195a709134a39 (diff)
Swap address in str2ba and ba2str.
-rw-r--r--src/bluetooth.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bluetooth.c b/src/bluetooth.c
index add25594..97a1cf57 100644
--- a/src/bluetooth.c
+++ b/src/bluetooth.c
@@ -76,14 +76,16 @@ bdaddr_t *strtoba(char *str)
int ba2str(bdaddr_t *ba, char *str)
{
+ uint8_t b[6];
+
+ baswap((bdaddr_t *)b, ba);
return sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
- ba->b[0], ba->b[1], ba->b[2],
- ba->b[3], ba->b[4], ba->b[5]);
+ b[0], b[1], b[2], b[3], b[4], b[5]);
}
int str2ba(char *str, bdaddr_t *ba)
{
- uint8_t *b = (void *) ba;
+ uint8_t b[6];
char *ptr = str;
int i;
@@ -93,6 +95,7 @@ int str2ba(char *str, bdaddr_t *ba)
ptr = ":00:00:00:00:00";
ptr++;
}
+ baswap(ba, (bdaddr_t *)b);
return 0;
}