diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-07-04 19:16:26 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-04 19:16:26 +0200 |
commit | 902b44266bd3cf10f1421ccb2c25aeaaf9677515 (patch) | |
tree | 09edfd3b3382fd2aec5e60f3e9dbd2844ffb0e3b /monitor/control.c | |
parent | 2cf1e0240b6250ff969491827418713ed58d77d8 (diff) | |
download | bluez-902b44266bd3cf10f1421ccb2c25aeaaf9677515.tar.gz |
monitor: Decode New Configuration Options control message
Diffstat (limited to 'monitor/control.c')
-rw-r--r-- | monitor/control.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/monitor/control.c b/monitor/control.c index 54335a574..287341b5c 100644 --- a/monitor/control.c +++ b/monitor/control.c @@ -119,6 +119,39 @@ static void mgmt_controller_error(uint16_t len, const void *buf) #define NELEM(x) (sizeof(x) / sizeof((x)[0])) #endif +static const char *config_options_str[] = { + "external", "public-address", +}; + +static void mgmt_new_config_options(uint16_t len, const void *buf) +{ + uint32_t options; + unsigned int i; + + if (len < 4) { + printf("* Malformed New Configuration Options control\n"); + return; + } + + options = get_le32(buf); + + printf("@ New Configuration Options: 0x%4.4x\n", options); + + if (options) { + printf("%-12c", ' '); + for (i = 0; i < NELEM(config_options_str); i++) { + if (options & (1 << i)) + printf("%s ", config_options_str[i]); + } + printf("\n"); + } + + buf += 4; + len -= 4; + + packet_hexdump(buf, len); +} + static const char *settings_str[] = { "powered", "connectable", "fast-connectable", "discoverable", "pairable", "link-security", "ssp", "br/edr", "hs", "le", @@ -708,6 +741,9 @@ void control_message(uint16_t opcode, const void *data, uint16_t size) case MGMT_EV_UNCONF_INDEX_REMOVED: mgmt_unconf_index_removed(size, data); break; + case MGMT_EV_NEW_CONFIG_OPTIONS: + mgmt_new_config_options(size, data); + break; default: printf("* Unknown control (code %d len %d)\n", opcode, size); packet_hexdump(data, size); |