@@ -100,6 +100,7 @@
#define COLOR_UNKNOWN_EXP_FEATURE_FLAG COLOR_WHITE_BG
#define COLOR_UNKNOWN_ADV_FLAG COLOR_WHITE_BG
#define COLOR_UNKNOWN_PHY COLOR_WHITE_BG
+#define COLOR_UNKNOWN_ADDED_DEVICE_FLAG COLOR_WHITE_BG
#define COLOR_PHY_PACKET COLOR_BLUE
@@ -13099,6 +13100,54 @@ static void mgmt_set_exp_feature_rsp(const void *data, uint16_t size)
mgmt_print_exp_feature(data);
}
+static const struct bitfield_data mgmt_added_device_flags_table[] = {
+ { 0, "Remote Wakeup" },
+ { }
+};
+
+static void mgmt_print_added_device_flags(char *label, uint32_t flags)
+{
+ uint32_t mask;
+
+ print_field("%s: 0x%8.8x", label, flags);
+ mask = print_bitfield(2, flags, mgmt_added_device_flags_table);
+ if (mask)
+ print_text(COLOR_UNKNOWN_ADDED_DEVICE_FLAG,
+ " Unknown Flags (0x%8.8x)", mask);
+}
+
+static void mgmt_get_device_flags_cmd(const void *data, uint16_t size)
+{
+ uint8_t type = get_u8(data + 6);
+ mgmt_print_address(data, type);
+}
+
+static void mgmt_get_device_flags_rsp(const void *data, uint16_t size)
+{
+ uint8_t type = get_u8(data + 6);
+ uint32_t supported_flags = get_le32(data + 7);
+ uint32_t current_flags = get_le32(data + 11);
+
+ mgmt_print_address(data, type);
+ mgmt_print_added_device_flags("Supported Flags", supported_flags);
+ mgmt_print_added_device_flags("Current Flags", current_flags);
+}
+
+static void mgmt_set_device_flags_cmd(const void *data, uint16_t size)
+{
+ uint8_t type = get_u8(data + 6);
+ uint32_t current_flags = get_le32(data + 7);
+
+ mgmt_print_address(data, type);
+ mgmt_print_added_device_flags("Current Flags", current_flags);
+}
+
+static void mgmt_set_device_flags_rsp(const void *data, uint16_t size)
+{
+ uint8_t type = get_u8(data + 6);
+ mgmt_print_address(data, type);
+}
+
struct mgmt_data {
uint16_t opcode;
const char *str;
@@ -13324,6 +13373,12 @@ static const struct mgmt_data mgmt_command_table[] = {
{ 0x004a, "Set Experimental Feature",
mgmt_set_exp_feature_cmd, 17, true,
mgmt_set_exp_feature_rsp, 20, true },
+ { 0x004f, "Get Device Flags",
+ mgmt_get_device_flags_cmd, 7, true,
+ mgmt_get_device_flags_rsp, 15, true},
+ { 0x0050, "Set Device Flags",
+ mgmt_set_device_flags_cmd, 11, true,
+ mgmt_set_device_flags_rsp, 7, true},
{ }
};
@@ -13714,6 +13769,17 @@ static void mgmt_exp_feature_changed_evt(const void *data, uint16_t size)
mgmt_print_exp_feature(data);
}
+static void mgmt_device_flags_changed_evt(const void *data, uint16_t size)
+{
+ uint8_t type = get_u8(data + 6);
+ uint32_t supported_flags = get_le32(data + 7);
+ uint32_t current_flags = get_le32(data + 11);
+
+ mgmt_print_address(data, type);
+ mgmt_print_added_device_flags("Supported Flags", supported_flags);
+ mgmt_print_added_device_flags("Current Flags", current_flags);
+}
+
static const struct mgmt_data mgmt_event_table[] = {
{ 0x0001, "Command Complete",
mgmt_command_complete_evt, 3, false },
@@ -13793,6 +13859,8 @@ static const struct mgmt_data mgmt_event_table[] = {
mgmt_phy_changed_evt, 4, true },
{ 0x0027, "Experimental Feature Changed",
mgmt_exp_feature_changed_evt, 20, true },
+ { 0x002a, "Device Flags Changed",
+ mgmt_device_flags_changed_evt, 15, true },
{ }
};