diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-11-02 14:17:57 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-11-02 14:31:30 +0200 |
commit | 56821b7ceddfed525112f5e9d1aaa910eb393ec0 (patch) | |
tree | fcdd44a90224ffbfd63b010e1e4b0739a5e5813e /tools/l2cap-tester.c | |
parent | 6ada5d5b03acc383ae33e773782d8c725c5df78d (diff) | |
download | bluez-56821b7ceddfed525112f5e9d1aaa910eb393ec0.tar.gz |
tools/l2cap-tester: Add invalid LE SCID test case
Diffstat (limited to 'tools/l2cap-tester.c')
-rw-r--r-- | tools/l2cap-tester.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c index 2b8904536..808e155d2 100644 --- a/tools/l2cap-tester.c +++ b/tools/l2cap-tester.c @@ -462,12 +462,45 @@ static const uint8_t le_connect_req[] = { 0x80, 0x00, /* PSM */ 0x05, 0x00, /* Credits */ }; +static const uint8_t le_connect_rsp[] = { 0x41, 0x00, /* DCID */ + 0x20, 0x00, /* MTU */ + 0x20, 0x00, /* MPS */ + 0x05, 0x00, /* Credits */ + 0x00, 0x00, /* Result */ +}; + static const struct l2cap_data le_server_success_test = { .server_psm = 0x0080, .send_cmd_code = BT_L2CAP_PDU_LE_CONN_REQ, .send_cmd = le_connect_req, .send_cmd_len = sizeof(le_connect_req), .expect_cmd_code = BT_L2CAP_PDU_LE_CONN_RSP, + .expect_cmd = le_connect_rsp, + .expect_cmd_len = sizeof(le_connect_rsp), +}; + +static const uint8_t nval_le_connect_req[] = { 0x80, 0x00, /* PSM */ + 0x01, 0x00, /* SCID */ + 0x20, 0x00, /* MTU */ + 0x20, 0x00, /* MPS */ + 0x05, 0x00, /* Credits */ +}; + +static const uint8_t nval_le_connect_rsp[] = { 0x00, 0x00, /* DCID */ + 0x00, 0x00, /* MTU */ + 0x00, 0x00, /* MPS */ + 0x00, 0x00, /* Credits */ + 0x09, 0x00, /* Result */ +}; + +static const struct l2cap_data le_server_nval_scid_test = { + .server_psm = 0x0080, + .send_cmd_code = BT_L2CAP_PDU_LE_CONN_REQ, + .send_cmd = nval_le_connect_req, + .send_cmd_len = sizeof(nval_le_connect_req), + .expect_cmd_code = BT_L2CAP_PDU_LE_CONN_RSP, + .expect_cmd = nval_le_connect_rsp, + .expect_cmd_len = sizeof(nval_le_connect_rsp), }; static const struct l2cap_data le_att_client_connect_success_test_1 = { @@ -1442,6 +1475,8 @@ int main(int argc, char *argv[]) setup_powered_client, test_connect); test_l2cap_le("L2CAP LE Server - Success", &le_server_success_test, setup_powered_server, test_server); + test_l2cap_le("L2CAP LE Server - Nval SCID", &le_server_nval_scid_test, + setup_powered_server, test_server); test_l2cap_le("L2CAP LE ATT Client - Success", |