Add mesh testing support
Subsystems (3)
v2 cover Add mesh testing support
This patch set reserves MGMT events and opcodes for Mesh, and adds a new unit tester for those features: mesh-tester
v2: Fix whitespace
Brian Gix (2):
lib: Add mgmt opcodes and events for Mesh
tools: Add mesh-tester to test Kernel mesh support
Makefile.tools | 12 +- lib/mgmt.h | 47 ++ tools/mesh-tester.c | 1435 +++++++++++++++++++++++++++++++++++++++++++ tools/test-runner.c | 2 + 4 files changed, 1495 insertions(+), 1 deletion(-) create mode 100644 tools/mesh-tester.c
Signature · 1 line
2.37.2
PATCH v2 1/2 lib: Add mgmt opcodes and events for Mesh
--- lib/mgmt.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
lib/mgmt.h +47 -0
@@ -760,6 +760,38 @@ struct mgmt_cp_add_adv_patterns_monitor_rssi {struct mgmt_adv_pattern patterns[0 ]; } __packed; +#define MGMT_OP_SET_MESH_RECEIVER 0x0057 +struct mgmt_cp_set_mesh { +uint8_t enable; +uint16_t window; +uint16_t period; +uint8_t num_ad_types; +uint8_t ad_types[]; +} __packed; + +#define MGMT_OP_MESH_READ_FEATURES 0x0058 +struct mgmt_rp_mesh_read_features { +uint16_t index; +uint8_t max_handles; +uint8_t used_handles; +uint8_t handles[]; +} __packed; + +#define MGMT_OP_MESH_SEND 0x0059 +struct mgmt_cp_mesh_send { +struct mgmt_addr_info addr; +uint64_t instant; +uint16_t delay; +uint8_t cnt; +uint8_t adv_data_len; +uint8_t adv_data[]; +} __packed; + +#define MGMT_OP_MESH_SEND_CANCEL 0x005A +struct mgmt_cp_mesh_send_cancel { +uint8_t handle; +} __packed; +#define MGMT_EV_CMD_COMPLETE 0x0001struct mgmt_ev_cmd_complete {uint16_t opcode;
@@ -1035,6 +1067,21 @@ struct mgmt_ev_adv_monitor_device_lost {struct mgmt_addr_info addr; } __packed; +#define MGMT_EV_MESH_DEVICE_FOUND 0x0031 +struct mgmt_ev_mesh_device_found { +struct mgmt_addr_info addr; +int8_t rssi; +uint64_t instant; +uint32_t flags; +uint16_t eir_len; +uint8_t eir[]; +} __packed; + +#define MGMT_EV_MESH_PACKET_CMPLT 0x0032 +struct mgmt_ev_mesh_pkt_cmplt { +uint8_t handle; +} __packed; +static const char *mgmt_op[] = {"<0x0000>" ,"Read Version" ,
Signature · 1 line
2.37.2
PATCH v2 2/2 tools: Add mesh-tester to test Kernel mesh support
In reply to Brian GixEver growing set of tests for Mesh kernel support
--- Makefile.tools | 12 +- tools/mesh-tester.c | 1435 +++++++++++++++++++++++++++++++++++++++++++ tools/test-runner.c | 2 + 3 files changed, 1448 insertions(+), 1 deletion(-) create mode 100644 tools/mesh-tester.c
Makefile.tools +11 -1
@@ -86,7 +86,8 @@ noinst_PROGRAMS += emulator/btvirt emulator/b1ee emulator/hfp \ tools/l2cap-tester tools/sco-tester \ tools/smp-tester tools/hci-tester \ tools/rfcomm-tester tools/bnep-tester \ - tools/userchan-tester tools/iso-tester + tools/userchan-tester tools/iso-tester \ + tools/mesh-tester emulator_btvirt_SOURCES = emulator/main.c monitor/bt.h \ emulator/serial.h emulator/serial.c \
@@ -127,6 +128,15 @@ tools_mgmt_tester_SOURCES = tools/mgmt-tester.c monitor/bt.h \ tools_mgmt_tester_LDADD = lib/libbluetooth-internal.la \ src/libshared-glib.la $(GLIB_LIBS) +tools_mesh_tester_SOURCES = tools/mesh-tester.c monitor/bt.h \ + emulator/hciemu.h emulator/hciemu.c \ + emulator/vhci.h emulator/vhci.c \ + emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c \ + emulator/smp.c +tools_mesh_tester_LDADD = lib/libbluetooth-internal.la \ + src/libshared-glib.la $(GLIB_LIBS) + tools_l2cap_tester_SOURCES = tools/l2cap-tester.c monitor/bt.h \ emulator/hciemu.h emulator/hciemu.c \ emulator/vhci.h emulator/vhci.c \
tools/mesh-tester.c new file +1435 -0
1,435 lines not on this page · raw message
tools/test-runner.c +2 -0
@@ -614,6 +614,7 @@ static const char *test_table[] = {"rfcomm-tester" ,"sco-tester" ,"iso-tester" , +"mesh-tester" ,"bnep-tester" ,"check-selftest" , "tools/mgmt-tester",
@@ -622,6 +623,7 @@ static const char *test_table[] = {"tools/rfcomm-tester" ,"tools/sco-tester" ,"tools/iso-tester" , +"tools/mesh-tester" ,"tools/bnep-tester" ,"tools/check-selftest" ,NULL
Signature · 1 line
2.37.2