Diff between 4d705a845152bd5f33a86f3bd84598d0835171d9 and fc5bd197aa30c3b3d47e918e7659dca31b0be731

Changed Files

File Additions Deletions Status
monitor/bt.h +28 -0 modified
monitor/lmp.c +70 -14 modified

Full Patch

diff --git a/monitor/bt.h b/monitor/bt.h
index 02cba56..d4c9a0e 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -112,6 +112,8 @@ struct bt_lmp_not_accepted {
 	uint8_t  error;
 } __attribute__ ((packed));
 
+#define BT_LMP_CLKOFFSET_REQ		5
+
 #define BT_LMP_DETACH			7
 struct bt_lmp_detach {
 	uint8_t  error;
@@ -144,6 +146,12 @@ struct bt_lmp_start_encryption_req {
 
 #define BT_LMP_STOP_ENCRYPTION_REQ	18
 
+#define BT_LMP_UNSNIFF_REQ		24
+
+#define BT_LMP_MAX_POWER		33
+
+#define BT_LMP_MIN_POWER		34
+
 #define BT_LMP_AUTO_RATE		35
 
 #define BT_LMP_VERSION_REQ		37
@@ -190,6 +198,8 @@ struct bt_lmp_timing_accuracy_res {
 
 #define BT_LMP_SETUP_COMPLETE		49
 
+#define BT_LMP_USE_SEMI_PERMANENT_KEY	50
+
 #define BT_LMP_HOST_CONNECTION_REQ	51
 
 #define BT_LMP_PAGE_SCAN_MODE_REQ	54
@@ -198,6 +208,10 @@ struct bt_lmp_page_scan_mode_req {
 	uint8_t  settings;
 } __attribute__ ((packed));
 
+#define BT_LMP_TEST_ACTIVATE		56
+
+#define BT_LMP_ENCRYPTION_KEY_SIZE_MASK_REQ	58
+
 #define BT_LMP_SET_AFH			60
 struct bt_lmp_set_afh {
 	uint32_t instant;
@@ -278,6 +292,10 @@ struct bt_lmp_channel_classification {
 	uint8_t  classification[10];
 } __attribute__ ((packed));
 
+#define BT_LMP_PAUSE_ENCRYPTION_REQ	LMP_ESC4(23)
+
+#define BT_LMP_RESUME_ENCRYPTION_REQ	LMP_ESC4(24)
+
 #define BT_LMP_IO_CAPABILITY_REQ	LMP_ESC4(25)
 struct bt_lmp_io_capability_req {
 	uint8_t  capability;
@@ -292,6 +310,12 @@ struct bt_lmp_io_capability_res {
 	uint8_t  authentication;
 } __attribute__ ((packed));
 
+#define BT_LMP_NUMERIC_COMPARISON_FAILED	LMP_ESC(27)
+
+#define BT_LMP_PASSKEY_FAILED		LMP_ESC4(28)
+
+#define BT_LMP_OOB_FAILED		LMP_ESC(29)
+
 #define BT_LMP_POWER_CONTROL_REQ	LMP_ESC4(31)
 struct bt_lmp_power_control_req {
 	uint8_t  request;
@@ -302,6 +326,10 @@ struct bt_lmp_power_control_res {
 	uint8_t  response;
 } __attribute__ ((packed));
 
+#define BT_LMP_PING_REQ			LMP_ESC4(33)
+
+#define BT_LMP_PING_RES			LMP_ESC4(34)
+
 #define BT_H4_CMD_PKT	0x01
 #define BT_H4_ACL_PKT	0x02
 #define BT_H4_SCO_PKT	0x03
diff --git a/monitor/lmp.c b/monitor/lmp.c
index 0a8b4d3..250c8f1 100644
--- a/monitor/lmp.c
+++ b/monitor/lmp.c
@@ -70,6 +70,10 @@ static void not_accepted(const void *data, uint8_t size)
 	packet_print_error("Error code", pdu->error);
 }
 
+static void clkoffset_req(const void *data, uint8_t size)
+{
+}
+
 static void detach(const void *data, uint8_t size)
 {
 	const struct bt_lmp_detach *pdu = data;
@@ -132,6 +136,18 @@ static void stop_encryption_req(const void *data, uint8_t size)
 {
 }
 
+static void unsniff_req(const void *data, uint8_t size)
+{
+}
+
+static void max_power(const void *data, uint8_t size)
+{
+}
+
+static void min_power(const void *data, uint8_t size)
+{
+}
+
 static void auto_rate(const void *data, uint8_t size)
 {
 }
@@ -198,6 +214,10 @@ static void setup_complete(const void *data, uint8_t size)
 {
 }
 
+static void use_semi_permanent_key(const void *data, uint8_t size)
+{
+}
+
 static void host_connection_req(const void *data, uint8_t size)
 {
 }
@@ -239,6 +259,14 @@ static void page_scan_mode_req(const void *data, uint8_t size)
 	print_field("Paging scheme settings: %s (%u)", str, pdu->settings);
 }
 
+static void test_activate(const void *data, uint8_t size)
+{
+}
+
+static void encryption_key_size_mask_req(const void *data, uint8_t size)
+{
+}
+
 static void set_afh(const void *data, uint8_t size)
 {
 	const struct bt_lmp_set_afh *pdu = data;
@@ -422,6 +450,14 @@ static void channel_classification(const void *data, uint8_t size)
 	print_field("Features: 0x%s", str);
 }
 
+static void pause_encryption_req(const void *data, uint8_t size)
+{
+}
+
+static void resume_encryption_req(const void *data, uint8_t size)
+{
+}
+
 static void io_capability_req(const void *data, uint8_t size)
 {
 	const struct bt_lmp_io_capability_req *pdu = data;
@@ -470,6 +506,18 @@ static void io_capability_res(const void *data, uint8_t size)
 	packet_print_io_authentication(pdu->authentication);
 }
 
+static void numeric_comparison_failed(const void *data, uint8_t size)
+{
+}
+
+static void passkey_failed(const void *data, uint8_t size)
+{
+}
+
+static void oob_failed(const void *data, uint8_t size)
+{
+}
+
 static void power_control_req(const void *data, uint8_t size)
 {
 	const struct bt_lmp_power_control_req *pdu = data;
@@ -561,6 +609,14 @@ static void power_control_res(const void *data, uint8_t size)
 	print_field("  8DPSK: %s", str);
 }
 
+static void ping_req(const void *data, uint8_t size)
+{
+}
+
+static void ping_res(const void *data, uint8_t size)
+{
+}
+
 struct lmp_data {
 	uint16_t opcode;
 	const char *str;
@@ -574,7 +630,7 @@ static const struct lmp_data lmp_table[] = {
 	{  2, "LMP_name_res" },
 	{  3, "LMP_accepted", accepted, 1, true },
 	{  4, "LMP_not_accepted", not_accepted, 2, true },
-	{  5, "LMP_clkoffset_req" },
+	{  5, "LMP_clkoffset_req", clkoffset_req, 0, true },
 	{  6, "LMP_clkoffset_res" },
 	{  7, "LMP_detach", detach, 1, true },
 	{  8, "LMP_in_rand" },
@@ -593,7 +649,7 @@ static const struct lmp_data lmp_table[] = {
 	{ 21, "LMP_hold_req" },
 	{ 22, "LMP_sniff" },
 	{ 23, "LMP_sniff_req" },
-	{ 24, "LMP_unsniff_req" },
+	{ 24, "LMP_unsniff_req", unsniff_req, 0, true },
 	{ 25, "LMP_park_req" },
 	{ 26, "LMP_park" },
 	{ 27, "LMP_set_broadcast_scan_window" },
@@ -602,8 +658,8 @@ static const struct lmp_data lmp_table[] = {
 	{ 30, "LMP_unpark_PM_ADDR_req" },
 	{ 31, "LMP_incr_power_req" },
 	{ 32, "LMP_decr_power_req" },
-	{ 33, "LMP_max_power" },
-	{ 34, "LMP_min_power" },
+	{ 33, "LMP_max_power", max_power, 0, true },
+	{ 34, "LMP_min_power", min_power, 0, true },
 	{ 35, "LMP_auto_rate", auto_rate, 0, true },
 	{ 36, "LMP_preferred_rate" },
 	{ 37, "LMP_version_req", version_req, 5, true },
@@ -619,15 +675,15 @@ static const struct lmp_data lmp_table[] = {
 	{ 47, "LMP_timing_accuracy_req", timing_accuracy_req, 0, true },
 	{ 48, "LMP_timing_accuracy_res", timing_accuracy_res, 2, true },
 	{ 49, "LMP_setup_complete", setup_complete, 0, true },
-	{ 50, "LMP_use_semi_permanent_key" },
+	{ 50, "LMP_use_semi_permanent_key", use_semi_permanent_key, 0, true },
 	{ 51, "LMP_host_connection_req", host_connection_req, 0, true },
 	{ 52, "LMP_slot_offset" },
 	{ 53, "LMP_page_mode_req" },
 	{ 54, "LMP_page_scan_mode_req", page_scan_mode_req, 2, true },
 	{ 55, "LMP_supervision_timeout" },
-	{ 56, "LMP_test_activate" },
+	{ 56, "LMP_test_activate", test_activate, 0, true },
 	{ 57, "LMP_test_control" },
-	{ 58, "LMP_encryption_key_size_mask_req" },
+	{ 58, "LMP_encryption_key_size_mask_req", encryption_key_size_mask_req, 0, true },
 	{ 59, "LMP_encryption_key_size_mask_res" },
 	{ 60, "LMP_set_AFH", set_afh, 15, true },
 	{ 61, "LMP_encapsulated_header", encapsulated_header, 3, true },
@@ -650,18 +706,18 @@ static const struct lmp_data lmp_table[] = {
 	{ LMP_ESC4(17), "LMP_channel_classification", channel_classification, 10, true },
 	{ LMP_ESC4(21), "LMP_sniff_subrating_req" },
 	{ LMP_ESC4(22), "LMP_sniff_subrating_res" },
-	{ LMP_ESC4(23), "LMP_pause_encryption_req" },
-	{ LMP_ESC4(24), "LMP_resume_encryption_req" },
+	{ LMP_ESC4(23), "LMP_pause_encryption_req", pause_encryption_req, 0, true },
+	{ LMP_ESC4(24), "LMP_resume_encryption_req", resume_encryption_req, 0, true },
 	{ LMP_ESC4(25), "LMP_IO_capability_req", io_capability_req, 3, true },
 	{ LMP_ESC4(26), "LMP_IO_capability_res", io_capability_res, 3, true },
-	{ LMP_ESC4(27), "LMP_numeric_comparision_failed" },
-	{ LMP_ESC4(28), "LMP_passkey_failed" },
-	{ LMP_ESC4(29), "LMP_oob_failed" },
+	{ LMP_ESC4(27), "LMP_numeric_comparison_failed", numeric_comparison_failed, 0, true },
+	{ LMP_ESC4(28), "LMP_passkey_failed", passkey_failed, 0, true },
+	{ LMP_ESC4(29), "LMP_oob_failed", oob_failed, 0, true },
 	{ LMP_ESC4(30), "LMP_keypress_notification" },
 	{ LMP_ESC4(31), "LMP_power_control_req", power_control_req, 1, true },
 	{ LMP_ESC4(32), "LMP_power_control_res", power_control_res, 1, true },
-	{ LMP_ESC4(33), "LMP_ping_req" },
-	{ LMP_ESC4(34), "LMP_ping_res" },
+	{ LMP_ESC4(33), "LMP_ping_req", ping_req, 0, true },
+	{ LMP_ESC4(34), "LMP_ping_res", ping_res, 0, true },
 	{ }
 };