diff --git a/monitor/bt.h b/monitor/bt.h
index f91545d..eaf8f4c 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
uint16_t result;
} __attribute__ ((packed));
-#define BT_L2CAP_PDU_MOVE_CHAN_CONF 0x10
-struct bt_l2cap_pdu_move_chan_conf {
+#define BT_L2CAP_PDU_MOVE_CHAN_CFM 0x10
+struct bt_l2cap_pdu_move_chan_cfm {
uint16_t icid;
uint16_t result;
} __attribute__ ((packed));
-#define BT_L2CAP_PDU_MOVE_CHAN_CONF_RSP 0x11
-struct bt_l2cap_pdu_move_chan_conf_rsp {
+#define BT_L2CAP_PDU_MOVE_CHAN_CFM_RSP 0x11
+struct bt_l2cap_pdu_move_chan_cfm_rsp {
uint16_t icid;
} __attribute__ ((packed));
uint16_t features;
} __attribute__ ((packed));
+#define BT_L2CAP_AMP_CHANGE_NOTIFY 0x04
+
+#define BT_L2CAP_AMP_CHANGE_RESPONSE 0x05
+
#define BT_L2CAP_AMP_GET_INFO_REQ 0x06
struct bt_l2cap_amp_get_info_req {
uint8_t ctrlid;
diff --git a/monitor/l2cap.c b/monitor/l2cap.c
index 6904d05..9ee0fd2 100644
--- a/monitor/l2cap.c
+++ b/monitor/l2cap.c
print_field("Result: %s (0x%4.4x)", str, btohs(result));
}
-static void print_move_conf_result(uint16_t result)
+static void print_move_cfm_result(uint16_t result)
{
const char *str;
print_move_result(pdu->result);
}
-static void sig_move_chan_conf(const struct l2cap_frame *frame)
+static void sig_move_chan_cfm(const struct l2cap_frame *frame)
{
- const struct bt_l2cap_pdu_move_chan_conf *pdu = frame->data;
+ const struct bt_l2cap_pdu_move_chan_cfm *pdu = frame->data;
print_cid("Initiator", pdu->icid);
- print_move_conf_result(pdu->result);
+ print_move_cfm_result(pdu->result);
}
-static void sig_move_chan_conf_rsp(const struct l2cap_frame *frame)
+static void sig_move_chan_cfm_rsp(const struct l2cap_frame *frame)
{
- const struct bt_l2cap_pdu_move_chan_conf_rsp *pdu = frame->data;
+ const struct bt_l2cap_pdu_move_chan_cfm_rsp *pdu = frame->data;
print_cid("Initiator", pdu->icid);
}
{ 0x0f, "Move Channel Response",
sig_move_chan_rsp, 4, true },
{ 0x10, "Move Channel Confirmation",
- sig_move_chan_conf, 4, true },
+ sig_move_chan_cfm, 4, true },
{ 0x11, "Move Channel Confirmation Response",
- sig_move_chan_conf_rsp, 2, true },
+ sig_move_chan_cfm_rsp, 2, true },
{ 0x12, "Connection Parameter Update Request",
sig_conn_param_req, 8, true },
{ 0x13, "Connection Parameter Update Response",
packet_hexdump(data, size);
}
-static void amp_cmd_reject(const struct l2cap_frame *frame)
-{
- const struct bt_l2cap_amp_cmd_reject *pdu = frame->data;
-
- print_field("Reason: 0x%4.4x", btohs(pdu->reason));
-}
-
-static void amp_discover_req(const struct l2cap_frame *frame)
-{
- const struct bt_l2cap_amp_discover_req *pdu = frame->data;
-
- print_field("MTU/MPS size: %d", btohs(pdu->size));
- print_field("Extended feature mask: 0x%4.4x", btohs(pdu->features));
-}
-
-static void amp_discover_rsp(const struct l2cap_frame *frame)
+static void print_controller_list(const uint8_t *data, uint16_t size)
{
- const struct bt_l2cap_amp_discover_rsp *pdu = frame->data;
- const uint8_t *data = frame->data + 4;
- uint16_t size = frame->size - 4;
-
- print_field("MTU/MPS size: %d", btohs(pdu->size));
- print_field("Extended feature mask: 0x%4.4x", btohs(pdu->features));
-
while (size > 2) {
const char *str;
packet_hexdump(data, size);
}
+static void amp_cmd_reject(const struct l2cap_frame *frame)
+{
+ const struct bt_l2cap_amp_cmd_reject *pdu = frame->data;
+
+ print_field("Reason: 0x%4.4x", btohs(pdu->reason));
+}
+
+static void amp_discover_req(const struct l2cap_frame *frame)
+{
+ const struct bt_l2cap_amp_discover_req *pdu = frame->data;
+
+ print_field("MTU/MPS size: %d", btohs(pdu->size));
+ print_field("Extended feature mask: 0x%4.4x", btohs(pdu->features));
+}
+
+static void amp_discover_rsp(const struct l2cap_frame *frame)
+{
+ const struct bt_l2cap_amp_discover_rsp *pdu = frame->data;
+
+ print_field("MTU/MPS size: %d", btohs(pdu->size));
+ print_field("Extended feature mask: 0x%4.4x", btohs(pdu->features));
+
+ print_controller_list(frame->data + 4, frame->size - 4);
+}
+
+static void amp_change_notify(const struct l2cap_frame *frame)
+{
+ print_controller_list(frame->data, frame->size);
+}
+
+static void amp_change_response(const struct l2cap_frame *frame)
+{
+}
+
static void amp_get_info_req(const struct l2cap_frame *frame)
{
const struct bt_l2cap_amp_get_info_req *pdu = frame->data;
amp_discover_req, 4, true },
{ 0x03, "Discover Response",
amp_discover_rsp, 7, false },
- { 0x04, "Change Notify" },
- { 0x05, "Change Response" },
+ { 0x04, "Change Notify",
+ amp_change_notify, 3, false },
+ { 0x05, "Change Response",
+ amp_change_response, 0, true },
{ 0x06, "Get Info Request",
amp_get_info_req, 1, true },
{ 0x07, "Get Info Response",