summaryrefslogtreecommitdiff
path: root/monitor/control.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-02-27 10:20:33 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2015-02-27 10:20:33 +0200
commit6271215e3d077ceb0dad63ac60d09ccd51cadc07 (patch)
tree2a7014a38377e2f2f57f6511c4bdd89ef039206f /monitor/control.c
parent60ba9a54934ed2bd1cf60c858fc0defd2e4f725e (diff)
downloadbluez-6271215e3d077ceb0dad63ac60d09ccd51cadc07.tar.gz
mgmt: Update code to match updated New CSRK specification
The 'master' parameter was renamed to 'type' and now has two new possible values.
Diffstat (limited to 'monitor/control.c')
-rw-r--r--monitor/control.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/monitor/control.c b/monitor/control.c
index c6ed03c71..f40debbc8 100644
--- a/monitor/control.c
+++ b/monitor/control.c
@@ -599,6 +599,7 @@ static void mgmt_new_irk(uint16_t len, const void *buf)
static void mgmt_new_csrk(uint16_t len, const void *buf)
{
const struct mgmt_ev_new_csrk *ev = buf;
+ const char *type;
char addr[18];
if (len < sizeof(*ev)) {
@@ -608,8 +609,26 @@ static void mgmt_new_csrk(uint16_t len, const void *buf)
ba2str(&ev->key.addr.bdaddr, addr);
- printf("@ New CSRK: %s (%d) %s\n", addr, ev->key.addr.type,
- ev->key.master ? "Master" : "Slave");
+ switch (ev->key.type) {
+ case 0x00:
+ type = "Local Unauthenticated";
+ break;
+ case 0x01:
+ type = "Remote Unauthenticated";
+ break;
+ case 0x02:
+ type = "Local Authenticated";
+ break;
+ case 0x03:
+ type = "Remote Authenticated";
+ break;
+ default:
+ type = "<unknown>";
+ break;
+ }
+
+ printf("@ New CSRK: %s (%d) %s (%u)\n", addr, ev->key.addr.type,
+ type, ev->key.type);
buf += sizeof(*ev);
len -= sizeof(*ev);