2 * Copyright (C) 2014 Intel Corporation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include "emulator/bthost.h"
22 #include "lib/bluetooth.h"
23 #include "android/utils.h"
24 #include "src/shared/tester.h"
25 #include "src/shared/queue.h"
26 #include "tester-main.h"
29 HDP_APP_SINK_RELIABLE,
31 HDP_APP_SOURCE_RELIABLE,
32 HDP_APP_SOURCE_STREAM,
35 #define hdp_rsp_pdu 0x07, \
39 0x36, 0x01, 0xc2, 0x36, 0x01, 0xbf, 0x09, 0x00, 0x00, \
40 0x0a, 0x00, 0x01, 0x00, 0x00, 0x09, 0x00, 0x01, 0x35, \
41 0x03, 0x19, 0x14, 0x01, 0x09, 0x00, 0x04, 0x35, 0x10, \
42 0x35, 0x06, 0x19, 0x01, 0x00, 0x09, 0x10, 0x01, 0x35, \
43 0x06, 0x19, 0x00, 0x1e, 0x09, 0x01, 0x00, 0x09, 0x00, \
44 0x09, 0x35, 0x08, 0x35, 0x06, 0x19, 0x14, 0x00, 0x09, \
45 0x01, 0x01, 0x09, 0x00, 0x0d, 0x35, 0x0f, 0x35, 0x0d, \
46 0x35, 0x06, 0x19, 0x01, 0x00, 0x09, 0x10, 0x03, 0x35, \
47 0x03, 0x19, 0x00, 0x1f, 0x09, 0x01, 0x00, 0x25, 0x03, \
48 0x48, 0x44, 0x50, 0x09, 0x01, 0x01, 0x25, 0x28, 0x43, \
49 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x2c, 0x20, 0x64, \
50 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x2c, 0x20, 0x61, \
51 0x6e, 0x64, 0x20, 0x72, 0x65, 0x8b, 0x6c, 0x61, 0x79, \
52 0x20, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x20, 0x64, \
53 0x61, 0x74, 0x61, 0x09, 0x01, 0x02, 0x25, 0x0d, 0x42, \
54 0x4c, 0x55, 0x45, 0x54, 0x4f, 0x4f, 0x54, 0x48, 0x20, \
55 0x53, 0x49, 0x47, 0x09, 0x02, 0x00, 0x36, 0x01, 0x22, \
56 0x35, 0x18, 0x08, 0x01, 0x09, 0x10, 0x04, 0x08, 0x00, \
57 0x25, 0x0f, 0x50, 0x75, 0x6c, 0x73, 0x65, 0x20, 0x4f, \
58 0x78, 0x69, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x0d, 0x35, \
59 0x20, 0x08, 0x02, 0x09, 0x10, 0x07, 0x08, 0x00, 0x25, \
60 0x17, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x20, 0x50, 0x72, \
61 0x65, 0x73, 0x73, 0x75, 0x72, 0x65, 0x20, 0x4d, 0x6f, \
62 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x0d, 0x35, 0x1a, 0x08, \
63 0x03, 0x09, 0x10, 0x08, 0x08, 0x00, 0x25, 0x11, 0x42, \
64 0x6f, 0x64, 0x79, 0x20, 0x54, 0x68, 0x65, 0x72, 0x6d, \
65 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x0d, 0x35, 0x1e, \
66 0x08, 0x04, 0x09, 0x10, 0x0f, 0x08, 0x00, 0x25, 0x15, \
67 0x42, 0x6f, 0x64, 0x79, 0x20, 0x57, 0x65, 0x69, 0x67, \
68 0x68, 0x74, 0x20, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x09, \
69 0x09, 0x09, 0x0d, 0x35, 0x17, 0x08, 0x05, 0x09, 0x10, \
70 0x11, 0x08, 0x00, 0x25, 0x0e, 0x47, 0x6c, 0x75, 0x63, \
71 0x6f, 0x73, 0x65, 0x20, 0x4d, 0x65, 0x74, 0x65, 0x72, \
72 0x0d, 0x35, 0x18, 0x08, 0x06, 0x09, 0x10, 0x04, 0x08, \
73 0x01, 0x25, 0x0f, 0x50, 0x75, 0x6c, 0x73, 0x65, 0x20, \
74 0x4f, 0x78, 0x69, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x0d, \
75 0x35, 0x20, 0x08, 0x07, 0x09, 0x10, 0x07, 0x08, 0x01, \
76 0x25, 0x17, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x20, 0x50, \
77 0x72, 0x65, 0x73, 0x73, 0x75, 0x72, 0x65, 0x20, 0x4d, \
78 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x0d, 0x35, 0x1a, \
79 0x08, 0x08, 0x09, 0x10, 0x08, 0x08, 0x01, 0x25, 0x11, \
80 0x42, 0x6f, 0x64, 0x79, 0x20, 0x54, 0x68, 0x65, 0x72, \
81 0x6d, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x0d, 0x35, \
82 0x1e, 0x08, 0x09, 0x09, 0x10, 0x0f, 0x08, 0x01, 0x25, \
83 0x15, 0x42, 0x6f, 0x64, 0x79, 0x20, 0x57, 0x65, 0x69, \
84 0x67, 0x68, 0x74, 0x20, 0x53, 0x63, 0x61, 0x6c, 0x65, \
85 0x09, 0x09, 0x09, 0x0d, 0x35, 0x17, 0x08, 0x0a, 0x09, \
86 0x10, 0x11, 0x08, 0x01, 0x25, 0x0e, 0x47, 0x6c, 0x75, \
87 0x63, 0x6f, 0x73, 0x65, 0x20, 0x4d, 0x65, 0x74, 0x65, \
88 0x72, 0x0d, 0x09, 0x03, 0x01, 0x08, 0x01, 0x09, 0x03, \
92 static const struct pdu_set sdp_pdus[] = {
93 { end_pdu, raw_pdu(hdp_rsp_pdu) },
97 static struct emu_l2cap_cid_data sdp_cid_data = {
102 static struct emu_l2cap_cid_data ctrl_cid_data;
103 static struct emu_l2cap_cid_data data_cid_data;
105 static struct queue *list; /* List of hdp test cases */
107 static bthl_reg_param_t *create_app(hdp_app_reg_type type)
109 bthl_reg_param_t *reg;
110 bthl_mdep_cfg_t mdep1, mdep2;
112 reg = malloc(sizeof(bthl_reg_param_t));
113 reg->application_name = "bluez-android";
114 reg->provider_name = "Bluez";
115 reg->srv_name = "bluez-hdp";
116 reg->srv_desp = "health-device-profile";
118 mdep1.data_type = 4100;
119 mdep1.mdep_description = "pulse-oximeter";
121 mdep2.data_type = 4100;
122 mdep2.mdep_description = "pulse-oximeter";
125 case HDP_APP_SINK_RELIABLE:
126 reg->number_of_mdeps = 1;
127 mdep1.mdep_role = BTHL_MDEP_ROLE_SINK;
128 mdep1.channel_type = BTHL_CHANNEL_TYPE_RELIABLE;
129 reg->mdep_cfg = malloc(reg->number_of_mdeps *
130 sizeof(bthl_mdep_cfg_t));
131 reg->mdep_cfg[0] = mdep1;
134 case HDP_APP_SINK_STREAM:
135 reg->number_of_mdeps = 2;
137 mdep1.mdep_role = BTHL_MDEP_ROLE_SINK;
138 mdep1.channel_type = BTHL_CHANNEL_TYPE_RELIABLE;
140 mdep2.mdep_role = BTHL_MDEP_ROLE_SINK;
141 mdep2.channel_type = BTHL_CHANNEL_TYPE_STREAMING;
143 reg->mdep_cfg = malloc(reg->number_of_mdeps *
144 sizeof(bthl_mdep_cfg_t));
145 reg->mdep_cfg[0] = mdep1;
146 reg->mdep_cfg[1] = mdep2;
149 case HDP_APP_SOURCE_RELIABLE:
150 reg->number_of_mdeps = 1;
152 mdep1.mdep_role = BTHL_MDEP_ROLE_SOURCE;
153 mdep1.channel_type = BTHL_CHANNEL_TYPE_RELIABLE;
155 reg->mdep_cfg = malloc(reg->number_of_mdeps *
156 sizeof(bthl_mdep_cfg_t));
157 reg->mdep_cfg[0] = mdep1;
160 case HDP_APP_SOURCE_STREAM:
161 reg->number_of_mdeps = 2;
163 mdep1.mdep_role = BTHL_MDEP_ROLE_SOURCE;
164 mdep1.channel_type = BTHL_CHANNEL_TYPE_RELIABLE;
166 mdep2.mdep_role = BTHL_MDEP_ROLE_SOURCE;
167 mdep2.channel_type = BTHL_CHANNEL_TYPE_STREAMING;
169 reg->mdep_cfg = malloc(reg->number_of_mdeps *
170 sizeof(bthl_mdep_cfg_t));
171 reg->mdep_cfg[0] = mdep1;
172 reg->mdep_cfg[1] = mdep2;
180 static void hdp_register_sink_reliable_app_action(void)
182 struct test_data *data = tester_get_data();
183 struct step *step = g_new0(struct step, 1);
185 bthl_reg_param_t *reg;
187 reg = create_app(HDP_APP_SINK_RELIABLE);
188 step->action_status = data->if_hdp->register_application(reg, &app_id);
190 schedule_action_verification(step);
195 static void hdp_register_sink_stream_app_action(void)
197 struct test_data *data = tester_get_data();
198 struct step *step = g_new0(struct step, 1);
200 bthl_reg_param_t *reg;
202 reg = create_app(HDP_APP_SINK_STREAM);
203 step->action_status = data->if_hdp->register_application(reg, &app_id);
205 schedule_action_verification(step);
210 static void hdp_register_source_reliable_app_action(void)
212 struct test_data *data = tester_get_data();
213 struct step *step = g_new0(struct step, 1);
215 bthl_reg_param_t *reg;
217 reg = create_app(HDP_APP_SOURCE_RELIABLE);
218 step->action_status = data->if_hdp->register_application(reg, &app_id);
220 schedule_action_verification(step);
225 static void hdp_register_source_stream_app_action(void)
227 struct test_data *data = tester_get_data();
228 struct step *step = g_new0(struct step, 1);
230 bthl_reg_param_t *reg;
232 reg = create_app(HDP_APP_SOURCE_STREAM);
233 step->action_status = data->if_hdp->register_application(reg, &app_id);
235 schedule_action_verification(step);
240 static void hdp_unregister_app_action(void)
242 struct test_data *data = tester_get_data();
243 struct step *step = g_new0(struct step, 1);
245 step->action_status = data->if_hdp->unregister_application(1);
247 schedule_action_verification(step);
250 static void mcap_ctrl_cid_hook_cb(const void *data, uint16_t len,
253 struct test_data *t_data = tester_get_data();
254 struct bthost *bthost = hciemu_client_get_host(t_data->hciemu);
255 struct emu_l2cap_cid_data *cid_data = user_data;
256 uint8_t crt_rsp[5], del_rsp[4], config;
257 uint8_t opcode = ((uint8_t *) data)[0];
258 static bool reliable = false;
261 case 0x01: /* MD_CREATE_MDL_REQ */
262 crt_rsp[0] = 0x02; /* MD_CREATE_MDL_RSP */
263 crt_rsp[1] = 0x00; /* Response code - Success */
264 crt_rsp[2] = ((uint8_t *) data)[1]; /* mdlid */
265 crt_rsp[3] = ((uint8_t *) data)[2];
266 config = ((uint8_t *) data)[4];
268 if (config == 0x00) {
280 bthost_send_cid(bthost, cid_data->handle,
282 crt_rsp, sizeof(crt_rsp));
284 case 0x03: /* MD_RECONNECT_MDL_REQ */
285 case 0x05: /* MD_ABORT_MDL_REQ */
287 case 0x07: /* MD_DELETE_MDL_REQ */
288 del_rsp[0] = 0x08; /* MD_DELETE_MDL_RSP */
289 del_rsp[1] = 0x00; /* Response code - Success */
290 del_rsp[2] = ((uint8_t *) data)[1]; /* mdlid */
291 del_rsp[3] = ((uint8_t *) data)[2];
292 bthost_send_cid(bthost, cid_data->handle,
294 del_rsp, sizeof(del_rsp));
299 static void mcap_ctrl_connect_cb(uint16_t handle, uint16_t cid, void *user_data)
301 struct test_data *data = tester_get_data();
302 struct bthost *bthost = hciemu_client_get_host(data->hciemu);
303 struct emu_l2cap_cid_data *cid_data = user_data;
305 cid_data->handle = handle;
308 bthost_add_cid_hook(bthost, handle, cid, mcap_ctrl_cid_hook_cb,
312 /* Emulate SDP (PSM = 1) */
313 static struct emu_set_l2cap_data l2cap_setup_sdp_data = {
315 .func = tester_generic_connect_cb,
316 .user_data = &sdp_cid_data,
319 /* Emulate Control Channel (PSM = 0x1001) */
320 static struct emu_set_l2cap_data l2cap_setup_cc_data = {
322 .func = mcap_ctrl_connect_cb,
323 .user_data = &ctrl_cid_data,
326 /* Emulate Data Channel (PSM = 0x1003) */
327 static struct emu_set_l2cap_data l2cap_setup_dc_data = {
329 .func = tester_generic_connect_cb,
330 .user_data = &data_cid_data,
333 static void hdp_connect_source_reliable_action(void)
335 struct test_data *data = tester_get_data();
336 const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu);
337 struct step *step = g_new0(struct step, 1);
339 int app_id, channel_id, mdep_cfg_index;
341 bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr);
345 step->action_status = data->if_hdp->connect_channel(app_id, &bdaddr,
346 mdep_cfg_index, &channel_id);
348 schedule_action_verification(step);
351 static void hdp_destroy_source_reliable_action(void)
353 struct test_data *data = tester_get_data();
354 struct step *step = g_new0(struct step, 1);
356 step->action_status = data->if_hdp->destroy_channel(1);
357 schedule_action_verification(step);
360 static void hdp_connect_sink_reliable_action(void)
362 struct test_data *data = tester_get_data();
363 const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu);
364 struct step *step = g_new0(struct step, 1);
366 int app_id, channel_id, mdep_cfg_index;
368 bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr);
372 step->action_status = data->if_hdp->connect_channel(app_id, &bdaddr,
373 mdep_cfg_index, &channel_id);
375 schedule_action_verification(step);
378 static void hdp_connect_sink_stream_action(void)
380 struct test_data *data = tester_get_data();
381 const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu);
382 struct step *step = g_new0(struct step, 1);
384 int app_id, channel_id, mdep_cfg_index;
386 bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr);
390 step->action_status = data->if_hdp->connect_channel(app_id, &bdaddr,
391 mdep_cfg_index, &channel_id);
393 schedule_action_verification(step);
396 static void hdp_destroy_sink_reliable_action(void)
398 struct test_data *data = tester_get_data();
399 struct step *step = g_new0(struct step, 1);
401 step->action_status = data->if_hdp->destroy_channel(1);
402 schedule_action_verification(step);
405 static void hdp_destroy_sink_stream_action(void)
407 struct test_data *data = tester_get_data();
408 struct step *step = g_new0(struct step, 1);
410 step->action_status = data->if_hdp->destroy_channel(2);
411 schedule_action_verification(step);
414 static struct test_case test_cases[] = {
415 TEST_CASE_BREDRLE("HDP Init",
416 ACTION_SUCCESS(dummy_action, NULL),
418 TEST_CASE_BREDRLE("HDP Register Sink Reliable Application",
419 ACTION_SUCCESS(hdp_register_sink_reliable_app_action, NULL),
420 CALLBACK_HDP_APP_REG_STATE(CB_HDP_APP_REG_STATE, 1,
421 BTHL_APP_REG_STATE_REG_SUCCESS),
423 TEST_CASE_BREDRLE("HDP Register Sink Stream Application",
424 ACTION_SUCCESS(hdp_register_sink_stream_app_action, NULL),
425 CALLBACK_HDP_APP_REG_STATE(CB_HDP_APP_REG_STATE, 1,
426 BTHL_APP_REG_STATE_REG_SUCCESS),
428 TEST_CASE_BREDRLE("HDP Register Source Reliable Application",
429 ACTION_SUCCESS(hdp_register_source_reliable_app_action, NULL),
430 CALLBACK_HDP_APP_REG_STATE(CB_HDP_APP_REG_STATE, 1,
431 BTHL_APP_REG_STATE_REG_SUCCESS),
433 TEST_CASE_BREDRLE("HDP Register Source Stream Application",
434 ACTION_SUCCESS(hdp_register_source_stream_app_action, NULL),
435 CALLBACK_HDP_APP_REG_STATE(CB_HDP_APP_REG_STATE, 1,
436 BTHL_APP_REG_STATE_REG_SUCCESS),
438 TEST_CASE_BREDRLE("HDP Unegister Application",
439 ACTION_SUCCESS(hdp_register_source_stream_app_action, NULL),
440 CALLBACK_HDP_APP_REG_STATE(CB_HDP_APP_REG_STATE, 1,
441 BTHL_APP_REG_STATE_REG_SUCCESS),
442 ACTION_SUCCESS(hdp_unregister_app_action, NULL),
443 CALLBACK_HDP_APP_REG_STATE(CB_HDP_APP_REG_STATE, 1,
444 BTHL_APP_REG_STATE_DEREG_SUCCESS),
446 TEST_CASE_BREDRLE("HDP Connect Source Reliable Channel",
447 ACTION_SUCCESS(set_default_ssp_request_handler, NULL),
448 ACTION_SUCCESS(bluetooth_enable_action, NULL),
449 CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
450 ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
451 ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
452 ACTION_SUCCESS(emu_add_l2cap_server_action,
453 &l2cap_setup_sdp_data),
454 ACTION_SUCCESS(emu_add_l2cap_server_action,
455 &l2cap_setup_cc_data),
456 ACTION_SUCCESS(emu_add_l2cap_server_action,
457 &l2cap_setup_dc_data),
458 ACTION_SUCCESS(hdp_register_source_reliable_app_action, NULL),
459 CALLBACK_HDP_APP_REG_STATE(CB_HDP_APP_REG_STATE, 1,
460 BTHL_APP_REG_STATE_REG_SUCCESS),
461 ACTION_SUCCESS(hdp_connect_source_reliable_action, NULL),
462 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 1, 0,
463 BTHL_CONN_STATE_CONNECTING),
464 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 1, 0,
465 BTHL_CONN_STATE_CONNECTED),
467 TEST_CASE_BREDRLE("HDP Destroy Source Reliable Channel",
468 ACTION_SUCCESS(set_default_ssp_request_handler, NULL),
469 ACTION_SUCCESS(bluetooth_enable_action, NULL),
470 CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
471 ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
472 ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
473 ACTION_SUCCESS(emu_add_l2cap_server_action,
474 &l2cap_setup_sdp_data),
475 ACTION_SUCCESS(emu_add_l2cap_server_action,
476 &l2cap_setup_cc_data),
477 ACTION_SUCCESS(emu_add_l2cap_server_action,
478 &l2cap_setup_dc_data),
479 ACTION_SUCCESS(hdp_register_source_reliable_app_action, NULL),
480 CALLBACK_HDP_APP_REG_STATE(CB_HDP_APP_REG_STATE, 1,
481 BTHL_APP_REG_STATE_REG_SUCCESS),
482 ACTION_SUCCESS(hdp_connect_source_reliable_action, NULL),
483 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 1, 0,
484 BTHL_CONN_STATE_CONNECTING),
485 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 1, 0,
486 BTHL_CONN_STATE_CONNECTED),
487 ACTION_SUCCESS(hdp_destroy_source_reliable_action, NULL),
488 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 1, 0,
489 BTHL_CONN_STATE_DESTROYED),
491 TEST_CASE_BREDRLE("HDP Connect Sink Streaming Channel",
492 ACTION_SUCCESS(set_default_ssp_request_handler, NULL),
493 ACTION_SUCCESS(bluetooth_enable_action, NULL),
494 CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
495 ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
496 ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
497 ACTION_SUCCESS(emu_add_l2cap_server_action,
498 &l2cap_setup_sdp_data),
499 ACTION_SUCCESS(emu_add_l2cap_server_action,
500 &l2cap_setup_cc_data),
501 ACTION_SUCCESS(emu_add_l2cap_server_action,
502 &l2cap_setup_dc_data),
503 ACTION_SUCCESS(hdp_register_sink_stream_app_action, NULL),
504 CALLBACK_HDP_APP_REG_STATE(CB_HDP_APP_REG_STATE, 1,
505 BTHL_APP_REG_STATE_REG_SUCCESS),
506 ACTION_SUCCESS(hdp_connect_sink_reliable_action, NULL),
507 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 1, 0,
508 BTHL_CONN_STATE_CONNECTING),
509 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 1, 0,
510 BTHL_CONN_STATE_CONNECTED),
511 ACTION_SUCCESS(hdp_connect_sink_stream_action, NULL),
512 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 2, 1,
513 BTHL_CONN_STATE_CONNECTED),
515 TEST_CASE_BREDRLE("HDP Destroy Sink Streaming Channel",
516 ACTION_SUCCESS(set_default_ssp_request_handler, NULL),
517 ACTION_SUCCESS(bluetooth_enable_action, NULL),
518 CALLBACK_STATE(CB_BT_ADAPTER_STATE_CHANGED, BT_STATE_ON),
519 ACTION_SUCCESS(emu_setup_powered_remote_action, NULL),
520 ACTION_SUCCESS(emu_set_ssp_mode_action, NULL),
521 ACTION_SUCCESS(emu_add_l2cap_server_action,
522 &l2cap_setup_sdp_data),
523 ACTION_SUCCESS(emu_add_l2cap_server_action,
524 &l2cap_setup_cc_data),
525 ACTION_SUCCESS(emu_add_l2cap_server_action,
526 &l2cap_setup_dc_data),
527 ACTION_SUCCESS(hdp_register_sink_stream_app_action, NULL),
528 CALLBACK_HDP_APP_REG_STATE(CB_HDP_APP_REG_STATE, 1,
529 BTHL_APP_REG_STATE_REG_SUCCESS),
530 ACTION_SUCCESS(hdp_connect_sink_reliable_action, NULL),
531 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 1, 0,
532 BTHL_CONN_STATE_CONNECTING),
533 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 1, 0,
534 BTHL_CONN_STATE_CONNECTED),
535 ACTION_SUCCESS(hdp_connect_sink_stream_action, NULL),
536 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 2, 1,
537 BTHL_CONN_STATE_CONNECTED),
538 ACTION_SUCCESS(hdp_destroy_sink_reliable_action, NULL),
539 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 1, 0,
540 BTHL_CONN_STATE_DESTROYED),
541 ACTION_SUCCESS(hdp_destroy_sink_stream_action, NULL),
542 CALLBACK_HDP_CHANNEL_STATE(CB_HDP_CHANNEL_STATE, 1, 2, 1,
543 BTHL_CONN_STATE_DESTROYED),
547 struct queue *get_hdp_tests(void)
553 for (; i < sizeof(test_cases) / sizeof(test_cases[0]); ++i)
554 queue_push_tail(list, &test_cases[i]);
559 void remove_hdp_tests(void)
561 queue_destroy(list, NULL);