summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-14 21:40:30 -0800
committerMarcel Holtmann <marcel@holtmann.org>2015-01-14 21:40:30 -0800
commit387498b65553aa207f376c6a8e9347eb1b4339e4 (patch)
treea75e32e96c7b166f7227a2fbbaabe3727bc90fdd /monitor
parent3c2f37ef2f6bff1e53c517c59660966d2cac0fc1 (diff)
downloadbluez-387498b65553aa207f376c6a8e9347eb1b4339e4.tar.gz
monitor: Add decoding for erroneous data reporting commands
Diffstat (limited to 'monitor')
-rw-r--r--monitor/packet.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/monitor/packet.c b/monitor/packet.c
index 50abc4367..97593f860 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -1369,6 +1369,25 @@ static void print_afh_mode(uint8_t mode)
print_field("Mode: %s (0x%2.2x)", str, mode);
}
+static void print_erroneous_reporting(uint8_t mode)
+{
+ const char *str;
+
+ switch (mode) {
+ case 0x00:
+ str = "Disabled";
+ break;
+ case 0x01:
+ str = "Enabled";
+ break;
+ default:
+ str = "Reserved";
+ break;
+ }
+
+ print_field("Mode: %s (0x%2.2x)", str, mode);
+}
+
static void print_simple_pairing_mode(uint8_t mode)
{
const char *str;
@@ -4899,6 +4918,21 @@ static void write_inquiry_tx_power_cmd(const void *data, uint8_t size)
print_power_level(cmd->level);
}
+static void read_erroneous_reporting_rsp(const void *data, uint8_t size)
+{
+ const struct bt_hci_rsp_read_erroneous_reporting *rsp = data;
+
+ print_status(rsp->status);
+ print_erroneous_reporting(rsp->mode);
+}
+
+static void write_erroneous_reporting_cmd(const void *data, uint8_t size)
+{
+ const struct bt_hci_cmd_write_erroneous_reporting *cmd = data;
+
+ print_erroneous_reporting(cmd->mode);
+}
+
static void enhanced_flush_cmd(const void *data, uint8_t size)
{
const struct bt_hci_cmd_enhanced_flush *cmd = data;
@@ -6561,8 +6595,12 @@ static const struct opcode_data opcode_table[] = {
{ 0x0c59, 145, "Write Inquiry Transmit Power Level",
write_inquiry_tx_power_cmd, 1, true,
status_rsp, 1, true },
- { 0x0c5a, 146, "Read Default Erroneous Reporting" },
- { 0x0c5b, 147, "Write Default Erroneous Reporting" },
+ { 0x0c5a, 146, "Read Default Erroneous Reporting",
+ null_cmd, 0, true,
+ read_erroneous_reporting_rsp, 2, true },
+ { 0x0c5b, 147, "Write Default Erroneous Reporting",
+ write_erroneous_reporting_cmd, 1, true,
+ status_rsp, 1, true },
{ 0x0c5f, 158, "Enhanced Flush",
enhanced_flush_cmd, 3, true },
{ 0x0c60, 162, "Send Keypress Notification",