From 3651a17f88b2da213c2f0482d3a7fb80e5dc4444 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 19 Sep 2013 21:25:58 +0300 Subject: [PATCH] tools/l2cap-tester: Add basic LE client test cases --- tools/l2cap-tester.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c index acfd7c340..9670a9a62 100644 --- a/tools/l2cap-tester.c +++ b/tools/l2cap-tester.c @@ -315,6 +315,16 @@ static const struct l2cap_server_data l2cap_server_nval_cid_test2 = { .expect_rsp_len = sizeof(l2cap_nval_cfg_rsp), }; +static const struct l2cap_client_data le_client_connect_success_test = { + .client_psm = 0x0080, + .server_psm = 0x0080, +}; + +static const struct l2cap_client_data le_client_connect_nval_psm_test = { + .client_psm = 0x0080, + .expect_err = ECONNREFUSED, +}; + static void client_connectable_complete(uint16_t opcode, uint8_t status, const void *param, uint8_t len, void *user_data) @@ -737,5 +747,12 @@ int main(int argc, char *argv[]) &l2cap_server_nval_cid_test2, setup_powered_server, test_server); + test_l2cap_le("L2CAP LE Client - Success", + &le_client_connect_success_test, + setup_powered_client, test_connect); + test_l2cap_le("L2CAP LE Client - Invalid PSM", + &le_client_connect_nval_psm_test, + setup_powered_client, test_connect); + return tester_run(); } -- 2.47.3