3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2012 Intel Corporation. All rights reserved.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34 #include <sys/socket.h>
38 #include "src/shared/util.h"
40 #include "android/avdtp.h"
51 struct test_pdu *pdu_list;
54 #define data(args...) ((const unsigned char[]) { args })
56 #define raw_pdu(args...) \
60 .size = sizeof(data(args)), \
63 #define frg_pdu(args...) \
68 .size = sizeof(data(args)), \
71 #define define_test(name, function, args...) \
73 const struct test_pdu pdus[] = { \
76 static struct test_data data; \
77 data.test_name = g_strdup(name); \
78 data.pdu_list = g_malloc(sizeof(pdus)); \
79 memcpy(data.pdu_list, pdus, sizeof(pdus)); \
80 g_test_add_data_func(name, &data, function); \
85 struct avdtp *session;
86 struct avdtp_local_sep *sep;
87 struct avdtp_stream *stream;
92 gboolean pending_open;
93 gboolean pending_suspend;
94 unsigned int pdu_offset;
95 const struct test_data *data;
98 static void test_debug(const char *str, void *user_data)
100 const char *prefix = user_data;
102 g_print("%s%s\n", prefix, str);
105 static void test_free(gconstpointer user_data)
107 const struct test_data *data = user_data;
109 g_free(data->test_name);
110 g_free(data->pdu_list);
113 static gboolean context_quit(gpointer user_data)
115 struct context *context = user_data;
117 if (context->process > 0)
118 g_source_remove(context->process);
120 g_main_loop_quit(context->main_loop);
125 static gboolean send_pdu(gpointer user_data)
127 struct context *context = user_data;
128 const struct test_pdu *pdu;
131 pdu = &context->data->pdu_list[context->pdu_offset++];
133 len = write(context->fd, pdu->data, pdu->size);
135 if (g_test_verbose())
136 util_hexdump('<', pdu->data, len, test_debug, "AVDTP: ");
138 g_assert_cmpint(len, ==, pdu->size);
140 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-02-C"))
141 g_timeout_add_seconds(1, context_quit, context);
144 return send_pdu(user_data);
146 context->process = 0;
150 static void context_process(struct context *context)
152 if (!context->data->pdu_list[context->pdu_offset].valid) {
153 context_quit(context);
157 context->process = g_idle_add(send_pdu, context);
160 static gboolean transport_open(struct avdtp_stream *stream)
164 fd = open("/dev/null", O_RDWR, 0);
166 g_assert_not_reached();
168 return avdtp_stream_set_transport(stream, fd, 672, 672);
171 static gboolean test_handler(GIOChannel *channel, GIOCondition cond,
174 struct context *context = user_data;
175 const struct test_pdu *pdu;
176 unsigned char buf[512];
180 pdu = &context->data->pdu_list[context->pdu_offset++];
182 if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) {
187 fd = g_io_channel_unix_get_fd(channel);
189 len = read(fd, buf, sizeof(buf));
193 if (g_test_verbose())
194 util_hexdump('>', buf, len, test_debug, "AVDTP: ");
196 g_assert_cmpint(len, ==, pdu->size);
198 g_assert(memcmp(buf, pdu->data, pdu->size) == 0);
200 if (context->pending_open) {
201 context->pending_open = FALSE;
202 g_assert(transport_open(context->stream));
205 if (context->pending_suspend) {
208 context->pending_suspend = FALSE;
209 ret = avdtp_suspend(context->session, context->stream);
210 g_assert_cmpint(ret, ==, 0);
213 if (!pdu->fragmented)
214 context_process(context);
219 static struct context *context_new(uint16_t version, uint16_t imtu,
220 uint16_t omtu, gconstpointer data)
222 struct context *context = g_new0(struct context, 1);
226 context->main_loop = g_main_loop_new(NULL, FALSE);
227 g_assert(context->main_loop);
229 err = socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sv);
232 context->session = avdtp_new(sv[0], imtu, omtu, version);
233 g_assert(context->session != NULL);
235 channel = g_io_channel_unix_new(sv[1]);
237 g_io_channel_set_close_on_unref(channel, TRUE);
238 g_io_channel_set_encoding(channel, NULL, NULL);
239 g_io_channel_set_buffered(channel, FALSE);
241 context->source = g_io_add_watch(channel,
242 G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
243 test_handler, context);
244 g_assert(context->source > 0);
246 g_io_channel_unref(channel);
249 context->data = data;
254 static struct context *create_context(uint16_t version, gconstpointer data)
256 return context_new(version, 672, 672, data);
259 static void execute_context(struct context *context)
261 g_main_loop_run(context->main_loop);
263 if (context->source > 0)
264 g_source_remove(context->source);
265 avdtp_unref(context->session);
267 g_main_loop_unref(context->main_loop);
269 test_free(context->data);
273 static gboolean sep_getcap_ind(struct avdtp *session,
274 struct avdtp_local_sep *sep,
275 GSList **caps, uint8_t *err,
278 struct avdtp_service_capability *media_transport, *media_codec;
279 struct avdtp_media_codec_capability *codec_caps;
280 uint8_t cap[4] = { 0xff, 0xff, 2, 64 };
284 media_transport = avdtp_service_cap_new(AVDTP_MEDIA_TRANSPORT,
287 *caps = g_slist_append(*caps, media_transport);
289 codec_caps = g_malloc0(sizeof(*codec_caps) + sizeof(cap));
290 codec_caps->media_type = AVDTP_MEDIA_TYPE_AUDIO;
291 codec_caps->media_codec_type = 0x00;
292 memcpy(codec_caps->data, cap, sizeof(cap));
294 media_codec = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, codec_caps,
295 sizeof(*codec_caps) + sizeof(cap));
297 *caps = g_slist_append(*caps, media_codec);
303 static gboolean sep_open_ind(struct avdtp *session, struct avdtp_local_sep *sep,
304 struct avdtp_stream *stream, uint8_t *err,
307 struct context *context = user_data;
309 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-18-C")) {
314 context->pending_open = TRUE;
315 context->stream = stream;
320 static gboolean sep_setconf_ind(struct avdtp *session,
321 struct avdtp_local_sep *sep,
322 struct avdtp_stream *stream,
324 avdtp_set_configuration_cb cb,
327 struct context *context = user_data;
329 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-09-C"))
332 cb(session, stream, NULL);
337 static gboolean sep_start_ind(struct avdtp *session,
338 struct avdtp_local_sep *sep,
339 struct avdtp_stream *stream,
343 struct context *context = user_data;
345 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-21-C")) {
350 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-25-C"))
351 context->pending_suspend = TRUE;
356 static gboolean sep_close_ind(struct avdtp *session,
357 struct avdtp_local_sep *sep,
358 struct avdtp_stream *stream,
362 struct context *context = user_data;
364 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-24-C")) {
372 static gboolean sep_suspend_ind(struct avdtp *session,
373 struct avdtp_local_sep *sep,
374 struct avdtp_stream *stream,
378 struct context *context = user_data;
380 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-27-C")) {
388 static struct avdtp_sep_ind sep_ind = {
389 .get_capability = sep_getcap_ind,
390 .set_configuration = sep_setconf_ind,
391 .open = sep_open_ind,
392 .close = sep_close_ind,
393 .start = sep_start_ind,
394 .suspend = sep_suspend_ind,
397 static void sep_setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
398 struct avdtp_stream *stream,
399 struct avdtp_error *err, void *user_data)
401 struct context *context = user_data;
404 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-07-C")) {
405 g_assert(err != NULL);
406 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x13);
407 context_quit(context);
411 g_assert(err == NULL);
413 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-11-C") ||
414 g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-10-C"))
415 ret = avdtp_get_configuration(session, stream);
416 else if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-23-C"))
417 ret = avdtp_abort(session, stream);
419 ret = avdtp_open(session, stream);
421 g_assert_cmpint(ret, ==, 0);
424 static void sep_getconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
425 struct avdtp_stream *stream,
426 struct avdtp_error *err, void *user_data)
428 struct context *context = user_data;
430 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-10-C")) {
431 g_assert(err != NULL);
432 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x12);
434 g_assert(err == NULL);
436 context_quit(context);
439 static void sep_open_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
440 struct avdtp_stream *stream, struct avdtp_error *err,
445 g_assert(err == NULL);
447 g_assert(transport_open(stream));
449 ret = avdtp_start(session, stream);
450 g_assert_cmpint(ret, ==, 0);
453 static void sep_start_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
454 struct avdtp_stream *stream, struct avdtp_error *err,
457 struct context *context = user_data;
460 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-19-C") ||
461 g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-22-C")) {
462 g_assert(err != NULL);
463 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x31);
464 context_quit(context);
468 g_assert(err == NULL);
470 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-19-C"))
471 ret = avdtp_close(session, stream, FALSE);
473 ret = avdtp_suspend(session, stream);
475 g_assert_cmpint(ret, ==, 0);
478 static void sep_suspend_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
479 struct avdtp_stream *stream, struct avdtp_error *err,
482 struct context *context = user_data;
484 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-25-C")) {
485 g_assert(err != NULL);
486 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x31);
487 context_quit(context);
491 static struct avdtp_sep_cfm sep_cfm = {
492 .set_configuration = sep_setconf_cfm,
493 .get_configuration = sep_getconf_cfm,
494 .open = sep_open_cfm,
495 .start = sep_start_cfm,
496 .suspend = sep_suspend_cfm,
499 static void test_server(gconstpointer data)
501 struct context *context = create_context(0x0100, data);
502 struct avdtp_local_sep *sep;
504 sep = avdtp_register_sep(AVDTP_SEP_TYPE_SOURCE, AVDTP_MEDIA_TYPE_AUDIO,
505 0x00, FALSE, &sep_ind, &sep_cfm,
508 g_idle_add(send_pdu, context);
510 execute_context(context);
512 avdtp_unregister_sep(sep);
515 static void test_server_1_3(gconstpointer data)
517 struct context *context = create_context(0x0103, data);
518 struct avdtp_local_sep *sep;
520 sep = avdtp_register_sep(AVDTP_SEP_TYPE_SOURCE, AVDTP_MEDIA_TYPE_AUDIO,
521 0x00, TRUE, &sep_ind, NULL, context);
523 g_idle_add(send_pdu, context);
525 execute_context(context);
527 avdtp_unregister_sep(sep);
530 static void test_server_1_3_sink(gconstpointer data)
532 struct context *context = create_context(0x0103, data);
533 struct avdtp_local_sep *sep;
535 sep = avdtp_register_sep(AVDTP_SEP_TYPE_SINK, AVDTP_MEDIA_TYPE_AUDIO,
536 0x00, TRUE, &sep_ind, NULL, context);
538 g_idle_add(send_pdu, context);
540 execute_context(context);
542 avdtp_unregister_sep(sep);
545 static void test_server_0_sep(gconstpointer data)
547 struct context *context = create_context(0x0100, data);
549 g_idle_add(send_pdu, context);
551 execute_context(context);
554 static gboolean sep_getcap_ind_frg(struct avdtp *session,
555 struct avdtp_local_sep *sep,
556 GSList **caps, uint8_t *err,
559 struct avdtp_service_capability *media_transport, *media_codec;
560 struct avdtp_service_capability *content_protection;
561 struct avdtp_media_codec_capability *codec_caps;
562 uint8_t cap[4] = { 0xff, 0xff, 2, 64 };
563 uint8_t frg_cap[96] = {};
567 media_transport = avdtp_service_cap_new(AVDTP_MEDIA_TRANSPORT,
570 *caps = g_slist_append(*caps, media_transport);
572 codec_caps = g_malloc0(sizeof(*codec_caps) + sizeof(cap));
573 codec_caps->media_type = AVDTP_MEDIA_TYPE_AUDIO;
574 codec_caps->media_codec_type = 0x00;
575 memcpy(codec_caps->data, cap, sizeof(cap));
577 media_codec = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, codec_caps,
578 sizeof(*codec_caps) + sizeof(cap));
580 *caps = g_slist_append(*caps, media_codec);
583 content_protection = avdtp_service_cap_new(AVDTP_CONTENT_PROTECTION,
584 frg_cap, sizeof(frg_cap));
585 *caps = g_slist_append(*caps, content_protection);
590 static struct avdtp_sep_ind sep_ind_frg = {
591 .get_capability = sep_getcap_ind_frg,
594 static void test_server_frg(gconstpointer data)
596 struct context *context = context_new(0x0100, 48, 48, data);
597 struct avdtp_local_sep *sep;
599 sep = avdtp_register_sep(AVDTP_SEP_TYPE_SOURCE, AVDTP_MEDIA_TYPE_AUDIO,
600 0x00, TRUE, &sep_ind_frg,
603 g_idle_add(send_pdu, context);
605 execute_context(context);
607 avdtp_unregister_sep(sep);
610 static void discover_cb(struct avdtp *session, GSList *seps,
611 struct avdtp_error *err, void *user_data)
613 struct context *context = user_data;
614 struct avdtp_stream *stream;
615 struct avdtp_remote_sep *rsep;
616 struct avdtp_service_capability *media_transport, *media_codec;
617 struct avdtp_media_codec_capability *cap;
619 uint8_t data[4] = { 0x21, 0x02, 2, 32 };
622 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-05-C") ||
623 g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-07-C") ||
624 g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-25-C"))
627 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-01-C")) {
628 g_assert(err != NULL);
629 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x01);
630 context_quit(context);
634 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-04-C") ||
635 g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-32-C")) {
636 g_assert(err != NULL);
637 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x11);
638 context_quit(context);
642 g_assert(err == NULL);
643 g_assert_cmpint(g_slist_length(seps), !=, 0);
645 if (g_str_equal(context->data->test_name, "/TP/SIG/FRA/BV-02-C")) {
646 g_assert(err == NULL);
647 context_quit(context);
651 rsep = avdtp_find_remote_sep(session, context->sep);
652 g_assert(rsep != NULL);
654 media_transport = avdtp_service_cap_new(AVDTP_MEDIA_TRANSPORT,
657 caps = g_slist_append(NULL, media_transport);
659 cap = g_malloc0(sizeof(*cap) + sizeof(data));
660 cap->media_type = AVDTP_MEDIA_TYPE_AUDIO;
661 cap->media_codec_type = 0x00;
662 memcpy(cap->data, data, sizeof(data));
664 media_codec = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, cap,
665 sizeof(*cap) + sizeof(data));
667 caps = g_slist_append(caps, media_codec);
670 ret = avdtp_set_configuration(session, rsep, context->sep, caps,
672 g_assert_cmpint(ret, ==, 0);
674 g_slist_free_full(caps, g_free);
677 static void test_client(gconstpointer data)
679 struct context *context = create_context(0x0100, data);
680 struct avdtp_local_sep *sep;
682 sep = avdtp_register_sep(AVDTP_SEP_TYPE_SINK, AVDTP_MEDIA_TYPE_AUDIO,
683 0x00, FALSE, NULL, &sep_cfm,
687 avdtp_discover(context->session, discover_cb, context);
689 execute_context(context);
691 avdtp_unregister_sep(sep);
694 static void test_client_1_3(gconstpointer data)
696 struct context *context = create_context(0x0103, data);
697 struct avdtp_local_sep *sep;
699 sep = avdtp_register_sep(AVDTP_SEP_TYPE_SINK, AVDTP_MEDIA_TYPE_AUDIO,
700 0x00, TRUE, NULL, &sep_cfm,
704 avdtp_discover(context->session, discover_cb, context);
706 execute_context(context);
708 avdtp_unregister_sep(sep);
711 static void test_client_frg(gconstpointer data)
713 struct context *context = context_new(0x0100, 48, 48, data);
714 struct avdtp_local_sep *sep;
716 sep = avdtp_register_sep(AVDTP_SEP_TYPE_SINK, AVDTP_MEDIA_TYPE_AUDIO,
717 0x00, TRUE, NULL, &sep_cfm,
721 avdtp_discover(context->session, discover_cb, context);
723 execute_context(context);
725 avdtp_unregister_sep(sep);
728 int main(int argc, char *argv[])
730 g_test_init(&argc, &argv, NULL);
732 if (g_test_verbose())
733 __btd_log_init("*", 0);
736 * Stream Management Service
738 * To verify that the following procedures are implemented according to
739 * their specification in AVDTP.
741 define_test("/TP/SIG/SMG/BV-05-C", test_client,
742 raw_pdu(0x00, 0x01));
743 define_test("/TP/SIG/SMG/BV-06-C", test_server,
745 raw_pdu(0x02, 0x01, 0x04, 0x00));
746 define_test("/TP/SIG/SMG/BV-07-C", test_client,
748 raw_pdu(0x12, 0x01, 0x04, 0x00),
749 raw_pdu(0x20, 0x02, 0x04));
750 define_test("/TP/SIG/SMG/BV-08-C", test_server,
752 raw_pdu(0x02, 0x01, 0x04, 0x00),
753 raw_pdu(0x10, 0x02, 0x04),
754 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
755 0xff, 0xff, 0x02, 0x40));
756 define_test("/TP/SIG/SMG/BV-09-C", test_client,
758 raw_pdu(0x32, 0x01, 0x04, 0x00),
759 raw_pdu(0x40, 0x02, 0x04),
760 raw_pdu(0x42, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
761 0xff, 0xff, 0x02, 0x40),
762 raw_pdu(0x50, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
763 0x00, 0x00, 0x21, 0x02, 0x02, 0x20));
764 define_test("/TP/SIG/SMG/BV-10-C", test_server,
766 raw_pdu(0x02, 0x01, 0x04, 0x00),
767 raw_pdu(0x10, 0x02, 0x04),
768 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
769 0xff, 0xff, 0x02, 0x40),
770 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
771 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
772 raw_pdu(0x22, 0x03));
773 define_test("/TP/SIG/SMG/BV-11-C", test_client,
775 raw_pdu(0x62, 0x01, 0x04, 0x00),
776 raw_pdu(0x70, 0x02, 0x04),
777 raw_pdu(0x72, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
778 0xff, 0xff, 0x02, 0x40),
779 raw_pdu(0x80, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
780 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
782 raw_pdu(0x90, 0x04, 0x04));
783 define_test("/TP/SIG/SMG/BV-12-C", test_server,
785 raw_pdu(0x02, 0x01, 0x04, 0x00),
786 raw_pdu(0x10, 0x02, 0x04),
787 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
788 0xff, 0xff, 0x02, 0x40),
789 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
790 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
792 raw_pdu(0x30, 0x04, 0x04),
793 raw_pdu(0x32, 0x04, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
794 0x21, 0x02, 0x02, 0x20));
795 define_test("/TP/SIG/SMG/BV-15-C", test_client,
797 raw_pdu(0xa2, 0x01, 0x04, 0x00),
798 raw_pdu(0xb0, 0x02, 0x04),
799 raw_pdu(0xb2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
800 0xff, 0xff, 0x02, 0x40),
801 raw_pdu(0xc0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
802 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
804 raw_pdu(0xd0, 0x06, 0x04));
805 define_test("/TP/SIG/SMG/BV-16-C", test_server,
807 raw_pdu(0x02, 0x01, 0x04, 0x00),
808 raw_pdu(0x10, 0x02, 0x04),
809 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
810 0xff, 0xff, 0x02, 0x40),
811 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
812 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
814 raw_pdu(0x30, 0x06, 0x04),
815 raw_pdu(0x32, 0x06));
816 define_test("/TP/SIG/SMG/BV-17-C", test_client,
818 raw_pdu(0xe2, 0x01, 0x04, 0x00),
819 raw_pdu(0xf0, 0x02, 0x04),
820 raw_pdu(0xf2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
821 0xff, 0xff, 0x02, 0x40),
822 raw_pdu(0x00, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
823 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
825 raw_pdu(0x10, 0x06, 0x04),
827 raw_pdu(0x20, 0x07, 0x04));
828 define_test("/TP/SIG/SMG/BV-18-C", test_server,
830 raw_pdu(0x02, 0x01, 0x04, 0x00),
831 raw_pdu(0x10, 0x02, 0x04),
832 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
833 0xff, 0xff, 0x02, 0x40),
834 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
835 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
837 raw_pdu(0x30, 0x06, 0x04),
839 raw_pdu(0x40, 0x07, 0x04),
840 raw_pdu(0x42, 0x07));
841 define_test("/TP/SIG/SMG/BV-19-C", test_client,
843 raw_pdu(0x32, 0x01, 0x04, 0x00),
844 raw_pdu(0x40, 0x02, 0x04),
845 raw_pdu(0x42, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
846 0xff, 0xff, 0x02, 0x40),
847 raw_pdu(0x50, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
848 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
850 raw_pdu(0x60, 0x06, 0x04),
852 raw_pdu(0x70, 0x07, 0x04),
854 raw_pdu(0x80, 0x08, 0x04));
855 define_test("/TP/SIG/SMG/BV-20-C", test_server,
857 raw_pdu(0x02, 0x01, 0x04, 0x00),
858 raw_pdu(0x10, 0x02, 0x04),
859 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
860 0xff, 0xff, 0x02, 0x40),
861 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
862 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
864 raw_pdu(0x30, 0x06, 0x04),
866 raw_pdu(0x40, 0x07, 0x04),
868 raw_pdu(0x50, 0x08, 0x04),
869 raw_pdu(0x52, 0x08));
870 define_test("/TP/SIG/SMG/BV-21-C", test_client,
872 raw_pdu(0x92, 0x01, 0x04, 0x00),
873 raw_pdu(0xa0, 0x02, 0x04),
874 raw_pdu(0xa2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
875 0xff, 0xff, 0x02, 0x40),
876 raw_pdu(0xb0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
877 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
879 raw_pdu(0xc0, 0x06, 0x04),
881 raw_pdu(0xd0, 0x07, 0x04),
883 raw_pdu(0xe0, 0x09, 0x04));
884 define_test("/TP/SIG/SMG/BV-22-C", test_server,
886 raw_pdu(0x02, 0x01, 0x04, 0x00),
887 raw_pdu(0x10, 0x02, 0x04),
888 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
889 0xff, 0xff, 0x02, 0x40),
890 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
891 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
893 raw_pdu(0x30, 0x06, 0x04),
895 raw_pdu(0x40, 0x07, 0x04),
897 raw_pdu(0x50, 0x09, 0x04),
898 raw_pdu(0x52, 0x09));
899 define_test("/TP/SIG/SMG/BV-23-C", test_client,
901 raw_pdu(0xf2, 0x01, 0x04, 0x00),
902 raw_pdu(0x00, 0x02, 0x04),
903 raw_pdu(0x02, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
904 0xff, 0xff, 0x02, 0x40),
905 raw_pdu(0x10, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
906 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
908 raw_pdu(0x20, 0x0a, 0x04));
909 define_test("/TP/SIG/SMG/BV-24-C", test_server,
911 raw_pdu(0x02, 0x01, 0x04, 0x00),
912 raw_pdu(0x10, 0x02, 0x04),
913 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
914 0xff, 0xff, 0x02, 0x40),
915 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
916 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
918 raw_pdu(0x30, 0x0a, 0x04),
919 raw_pdu(0x32, 0x0a));
920 define_test("/TP/SIG/SMG/BV-25-C", test_client_1_3,
922 raw_pdu(0x32, 0x01, 0x04, 0x00),
923 raw_pdu(0x40, 0x0c, 0x04));
924 define_test("/TP/SIG/SMG/BV-26-C", test_server_1_3,
926 raw_pdu(0x02, 0x01, 0x04, 0x00),
927 raw_pdu(0x10, 0x0c, 0x04),
928 raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
929 0xff, 0xff, 0x02, 0x40, 0x08, 0x00));
930 define_test("/TP/SIG/SMG/BV-27-C", test_server_1_3,
932 raw_pdu(0x02, 0x01, 0x04, 0x00),
933 raw_pdu(0x10, 0x02, 0x04),
934 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
935 0xff, 0xff, 0x02, 0x40));
936 define_test("/TP/SIG/SMG/BV-28-C", test_client_1_3,
938 raw_pdu(0x52, 0x01, 0x04, 0x00),
939 raw_pdu(0x60, 0x0c, 0x04),
940 raw_pdu(0x62, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
941 0xff, 0xff, 0x02, 0x40, 0x0f, 0x00),
942 raw_pdu(0x70, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
943 0x00, 0x00, 0x21, 0x02, 0x02, 0x20));
944 define_test("/TP/SIG/SMG/BV-31-C", test_client_1_3,
946 raw_pdu(0x82, 0x01, 0x04, 0x00),
947 raw_pdu(0x90, 0x0c, 0x04),
948 raw_pdu(0x92, 0x0c, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00,
949 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x06,
950 0x00, 0x00, 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
951 raw_pdu(0xa0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
952 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
954 define_test("/TP/SIG/SMG/BI-01-C", test_client,
956 raw_pdu(0xb3, 0x01, 0x01));
957 define_test("/TP/SIG/SMG/BI-02-C", test_server,
958 raw_pdu(0x01, 0x01));
959 define_test("/TP/SIG/SMG/BI-03-C", test_server_0_sep,
961 raw_pdu(0x03, 0x01, 0x19));
962 define_test("/TP/SIG/SMG/BI-04-C", test_client,
964 raw_pdu(0xc2, 0x01, 0x04, 0x00),
965 raw_pdu(0xd0, 0x02, 0x04),
966 raw_pdu(0xd3, 0x02, 0x11));
967 define_test("/TP/SIG/SMG/BI-05-C", test_server,
969 raw_pdu(0x02, 0x01, 0x04, 0x00),
971 raw_pdu(0x13, 0x02, 0x11));
972 define_test("/TP/SIG/SMG/BI-06-C", test_server,
974 raw_pdu(0x02, 0x01, 0x04, 0x00),
975 raw_pdu(0x10, 0x02, 0x00),
976 raw_pdu(0x13, 0x02, 0x12));
977 define_test("/TP/SIG/SMG/BI-07-C", test_client,
979 raw_pdu(0xe2, 0x01, 0x04, 0x00),
980 raw_pdu(0xf0, 0x02, 0x04),
981 raw_pdu(0xf2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
982 0xff, 0xff, 0x02, 0x40),
983 raw_pdu(0x00, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
984 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
985 raw_pdu(0x03, 0x03, 0x00, 0x13));
986 define_test("/TP/SIG/SMG/BI-08-C", test_server,
988 raw_pdu(0x02, 0x01, 0x04, 0x00),
989 raw_pdu(0x10, 0x02, 0x04),
990 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
991 0xff, 0xff, 0x02, 0x40),
992 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
993 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
995 raw_pdu(0x30, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
996 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
997 raw_pdu(0x33, 0x03, 0x00, 0x13));
998 define_test("/TP/SIG/SMG/BI-09-C", test_server,
1000 raw_pdu(0x02, 0x01, 0x04, 0x00),
1001 raw_pdu(0x10, 0x02, 0x04),
1002 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1003 0xff, 0xff, 0x02, 0x40),
1004 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1005 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1006 raw_pdu(0x23, 0x03, 0x00, 0x29));
1007 define_test("/TP/SIG/SMG/BI-10-C", test_client,
1008 raw_pdu(0x10, 0x01),
1009 raw_pdu(0x12, 0x01, 0x04, 0x00),
1010 raw_pdu(0x20, 0x02, 0x04),
1011 raw_pdu(0x22, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1012 0xff, 0xff, 0x02, 0x40),
1013 raw_pdu(0x30, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1014 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1015 raw_pdu(0x32, 0x03),
1016 raw_pdu(0x40, 0x04, 0x04),
1017 raw_pdu(0x43, 0x04, 0x12));
1018 define_test("/TP/SIG/SMG/BI-11-C", test_server,
1019 raw_pdu(0x00, 0x01),
1020 raw_pdu(0x02, 0x01, 0x04, 0x00),
1021 raw_pdu(0x10, 0x02, 0x04),
1022 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1023 0xff, 0xff, 0x02, 0x40),
1024 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1025 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1026 raw_pdu(0x22, 0x03),
1027 raw_pdu(0x30, 0x04, 0x00),
1028 raw_pdu(0x33, 0x04, 0x12));
1029 define_test("/TP/SIG/SMG/BI-17-C", test_server,
1030 raw_pdu(0x00, 0x01),
1031 raw_pdu(0x02, 0x01, 0x04, 0x00),
1032 raw_pdu(0x10, 0x02, 0x04),
1033 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1034 0xff, 0xff, 0x02, 0x40),
1035 raw_pdu(0x30, 0x06, 0x04),
1036 raw_pdu(0x33, 0x06, 0x31));
1037 define_test("/TP/SIG/SMG/BI-18-C", test_server,
1038 raw_pdu(0x00, 0x01),
1039 raw_pdu(0x02, 0x01, 0x04, 0x00),
1040 raw_pdu(0x10, 0x02, 0x04),
1041 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1042 0xff, 0xff, 0x02, 0x40),
1043 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1044 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1045 raw_pdu(0x22, 0x03),
1046 raw_pdu(0x30, 0x06, 0x04),
1047 raw_pdu(0x33, 0x06, 0xc0));
1048 define_test("/TP/SIG/SMG/BI-19-C", test_client,
1049 raw_pdu(0x50, 0x01),
1050 raw_pdu(0x52, 0x01, 0x04, 0x00),
1051 raw_pdu(0x60, 0x02, 0x04),
1052 raw_pdu(0x62, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1053 0xff, 0xff, 0x02, 0x40),
1054 raw_pdu(0x70, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1055 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1056 raw_pdu(0x72, 0x03),
1057 raw_pdu(0x80, 0x06, 0x04),
1058 raw_pdu(0x82, 0x06),
1059 raw_pdu(0x90, 0x07, 0x04),
1060 raw_pdu(0x93, 0x07, 0x04, 0x31));
1061 define_test("/TP/SIG/SMG/BI-20-C", test_server,
1062 raw_pdu(0x00, 0x01),
1063 raw_pdu(0x02, 0x01, 0x04, 0x00),
1064 raw_pdu(0x10, 0x02, 0x04),
1065 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1066 0xff, 0xff, 0x02, 0x40),
1067 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1068 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1069 raw_pdu(0x22, 0x03),
1070 raw_pdu(0x30, 0x07, 0x04),
1071 raw_pdu(0x33, 0x07, 0x04, 0x31));
1072 define_test("/TP/SIG/SMG/BI-21-C", test_server,
1073 raw_pdu(0x00, 0x01),
1074 raw_pdu(0x02, 0x01, 0x04, 0x00),
1075 raw_pdu(0x10, 0x02, 0x04),
1076 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1077 0xff, 0xff, 0x02, 0x40),
1078 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1079 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1080 raw_pdu(0x22, 0x03),
1081 raw_pdu(0x30, 0x06, 0x04),
1082 raw_pdu(0x32, 0x06),
1083 raw_pdu(0x40, 0x07, 0x04),
1084 raw_pdu(0x43, 0x07, 0x04, 0xc0));
1085 define_test("/TP/SIG/SMG/BI-22-C", test_client,
1086 raw_pdu(0xa0, 0x01),
1087 raw_pdu(0xa2, 0x01, 0x04, 0x00),
1088 raw_pdu(0xb0, 0x02, 0x04),
1089 raw_pdu(0xb2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1090 0xff, 0xff, 0x02, 0x40),
1091 raw_pdu(0xc0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1092 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1093 raw_pdu(0xc2, 0x03),
1094 raw_pdu(0xd0, 0x06, 0x04),
1095 raw_pdu(0xd2, 0x06),
1096 raw_pdu(0xe0, 0x07, 0x04),
1097 raw_pdu(0xe3, 0x07, 0x04, 0x31));
1098 define_test("/TP/SIG/SMG/BI-23-C", test_server,
1099 raw_pdu(0x00, 0x01),
1100 raw_pdu(0x02, 0x01, 0x04, 0x00),
1101 raw_pdu(0x10, 0x02, 0x04),
1102 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1103 0xff, 0xff, 0x02, 0x40),
1104 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1105 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1106 raw_pdu(0x22, 0x03),
1107 raw_pdu(0x30, 0x06, 0x04),
1108 raw_pdu(0x32, 0x06),
1109 raw_pdu(0x40, 0x08, 0x00),
1110 raw_pdu(0x43, 0x08, 0x12));
1111 define_test("/TP/SIG/SMG/BI-24-C", test_server,
1112 raw_pdu(0x00, 0x01),
1113 raw_pdu(0x02, 0x01, 0x04, 0x00),
1114 raw_pdu(0x10, 0x02, 0x04),
1115 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1116 0xff, 0xff, 0x02, 0x40),
1117 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1118 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1119 raw_pdu(0x22, 0x03),
1120 raw_pdu(0x30, 0x06, 0x04),
1121 raw_pdu(0x32, 0x06),
1122 raw_pdu(0x40, 0x08, 0x04),
1123 raw_pdu(0x43, 0x08, 0xc0));
1124 define_test("/TP/SIG/SMG/BI-25-C", test_server,
1125 raw_pdu(0x00, 0x01),
1126 raw_pdu(0x02, 0x01, 0x04, 0x00),
1127 raw_pdu(0x10, 0x02, 0x04),
1128 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1129 0xff, 0xff, 0x02, 0x40),
1130 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1131 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1132 raw_pdu(0x22, 0x03),
1133 raw_pdu(0x30, 0x06, 0x04),
1134 raw_pdu(0x32, 0x06),
1135 raw_pdu(0x40, 0x07, 0x04),
1136 raw_pdu(0x42, 0x07),
1137 raw_pdu(0xf0, 0x09, 0x04),
1138 raw_pdu(0xf3, 0x09, 0x04, 0x31));
1139 define_test("/TP/SIG/SMG/BI-26-C", test_server,
1140 raw_pdu(0x00, 0x01),
1141 raw_pdu(0x02, 0x01, 0x04, 0x00),
1142 raw_pdu(0x10, 0x02, 0x04),
1143 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1144 0xff, 0xff, 0x02, 0x40),
1145 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1146 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1147 raw_pdu(0x22, 0x03),
1148 raw_pdu(0x30, 0x06, 0x04),
1149 raw_pdu(0x32, 0x06),
1150 raw_pdu(0x40, 0x09, 0x04),
1151 raw_pdu(0x43, 0x09, 0x04, 0x31));
1152 define_test("/TP/SIG/SMG/BI-27-C", test_server,
1153 raw_pdu(0x00, 0x01),
1154 raw_pdu(0x02, 0x01, 0x04, 0x00),
1155 raw_pdu(0x10, 0x02, 0x04),
1156 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1157 0xff, 0xff, 0x02, 0x40),
1158 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1159 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1160 raw_pdu(0x22, 0x03),
1161 raw_pdu(0x30, 0x06, 0x04),
1162 raw_pdu(0x32, 0x06),
1163 raw_pdu(0x40, 0x07, 0x04),
1164 raw_pdu(0x42, 0x07),
1165 raw_pdu(0x50, 0x09, 0x04),
1166 raw_pdu(0x53, 0x09, 0x04, 0xc0));
1167 define_test("/TP/SIG/SMG/BI-28-C", test_server,
1168 raw_pdu(0x00, 0xff),
1169 raw_pdu(0x01, 0x3f));
1170 define_test("/TP/SIG/SMG/BI-30-C", test_client,
1171 raw_pdu(0x00, 0x01),
1172 raw_pdu(0x02, 0x01, 0x04, 0x00),
1173 raw_pdu(0x10, 0x02, 0x04),
1174 raw_pdu(0x12, 0x02, 0xee, 0x01, 0x00, 0x01, 0x00, 0x07,
1175 0x06, 0x00, 0x00, 0xff, 0xff, 0x02, 0x40),
1176 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1177 0x00, 0x00, 0x21, 0x02, 0x02, 0x20));
1178 define_test("/TP/SIG/SMG/ESR04/BI-28-C", test_server,
1179 raw_pdu(0x00, 0x3f),
1180 raw_pdu(0x01, 0x3f));
1181 define_test("/TP/SIG/SMG/BI-32-C", test_client_1_3,
1182 raw_pdu(0x30, 0x01),
1183 raw_pdu(0x32, 0x01, 0x04, 0x00),
1184 raw_pdu(0x40, 0x0c, 0x04),
1185 raw_pdu(0x43, 0x0c, 0x11));
1186 define_test("/TP/SIG/SMG/BI-33-C", test_server_1_3,
1187 raw_pdu(0x00, 0x01),
1188 raw_pdu(0x02, 0x01, 0x04, 0x00),
1189 raw_pdu(0x10, 0x0c),
1190 raw_pdu(0x13, 0x0c, 0x11));
1191 define_test("/TP/SIG/SMG/BI-35-C", test_client_1_3,
1192 raw_pdu(0x50, 0x01),
1193 raw_pdu(0x52, 0x01, 0x04, 0x00),
1194 raw_pdu(0x60, 0x0c, 0x04),
1195 raw_pdu(0x62, 0x0c, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00,
1196 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x06,
1197 0x00, 0x00, 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
1198 raw_pdu(0x70, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1199 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1201 define_test("/TP/SIG/SMG/BI-36-C", test_client_1_3,
1202 raw_pdu(0x80, 0x01),
1203 raw_pdu(0x82, 0x01, 0x04, 0x00),
1204 raw_pdu(0x90, 0x0c, 0x04),
1205 raw_pdu(0x92, 0x0c, 0xee, 0x01, 0x00, 0x01, 0x00, 0x07,
1206 0x06, 0x00, 0x00, 0xff, 0xff, 0x02, 0x40),
1207 raw_pdu(0xa0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1208 0x00, 0x00, 0x21, 0x02, 0x02, 0x20));
1211 * Signaling Message Fragmentation Service
1213 * verify that the IUT (INT and ACP) fragments the signaling messages
1214 * that cannot fit in a single L2CAP packet.
1216 define_test("/TP/SIG/FRA/BV-01-C", test_server_frg,
1217 raw_pdu(0x00, 0x01),
1218 raw_pdu(0x02, 0x01, 0x04, 0x00),
1219 raw_pdu(0x10, 0x02, 0x04),
1220 frg_pdu(0x16, 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00,
1221 0x00, 0xff, 0xff, 0x02, 0x40, 0x04, 0x60, 0x00,
1222 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1223 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1224 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1225 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1227 frg_pdu(0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1228 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1229 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1230 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1231 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1232 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1234 raw_pdu(0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1235 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1237 define_test("/TP/SIG/FRA/BV-02-C", test_client_frg,
1238 raw_pdu(0xb0, 0x01),
1239 raw_pdu(0xb2, 0x01, 0x04, 0x00),
1240 raw_pdu(0xc0, 0x02, 0x04),
1241 frg_pdu(0xc6, 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00,
1242 0x00, 0xff, 0xff, 0x02, 0x40, 0x04, 0x60, 0x00,
1243 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1244 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1245 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1246 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1248 frg_pdu(0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1249 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1250 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1251 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1252 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1253 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1255 raw_pdu(0xce, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1256 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1262 * Verify that the stream management signaling procedure of delay
1263 * reporting is implemented according to its specification in AVDTP.
1265 define_test("/TP/SIG/SYN/BV-01-C", test_server_1_3_sink,
1266 raw_pdu(0x00, 0x01),
1267 raw_pdu(0x02, 0x01, 0x04, 0x08),
1268 raw_pdu(0x10, 0x0c, 0x04),
1269 raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1270 0xff, 0xff, 0x02, 0x40, 0x08, 0x00));
1271 define_test("/TP/SIG/SYN/BV-02-C", test_client_1_3,
1272 raw_pdu(0xd0, 0x01),
1273 raw_pdu(0xd2, 0x01, 0x04, 0x00),
1274 raw_pdu(0xe0, 0x0c, 0x04),
1275 raw_pdu(0xe2, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1276 0xff, 0xff, 0x02, 0x40, 0x0f, 0x00, 0x08, 0x00),
1277 raw_pdu(0xf0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1278 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1280 define_test("/TP/SIG/SYN/BV-03-C", test_server_1_3_sink,
1281 raw_pdu(0x00, 0x01),
1282 raw_pdu(0x02, 0x01, 0x04, 0x08),
1283 raw_pdu(0x10, 0x0c, 0x04),
1284 raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1285 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
1286 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1287 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1289 raw_pdu(0x22, 0x03),
1290 raw_pdu(0x00, 0x0d, 0x04, 0x00, 0x00));
1291 define_test("/TP/SIG/SYN/BV-04-C", test_client_1_3,
1292 raw_pdu(0x10, 0x01),
1293 raw_pdu(0x12, 0x01, 0x04, 0x00),
1294 raw_pdu(0x20, 0x0c, 0x04),
1295 raw_pdu(0x22, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1296 0xff, 0xff, 0x02, 0x40, 0x0f, 0x00, 0x08, 0x00),
1297 raw_pdu(0x30, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1298 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1300 raw_pdu(0x32, 0x03),
1301 raw_pdu(0x40, 0x0d, 0x04, 0x00, 0x00));
1302 define_test("/TP/SIG/SYN/BV-05-C", test_server_1_3,
1303 raw_pdu(0x00, 0x01),
1304 raw_pdu(0x02, 0x01, 0x04, 0x00),
1305 raw_pdu(0x10, 0x0c, 0x04),
1306 raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1307 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
1308 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1309 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1311 raw_pdu(0x22, 0x03),
1312 raw_pdu(0x30, 0x06, 0x04),
1313 raw_pdu(0x32, 0x06),
1314 raw_pdu(0x40, 0x0d, 0x04, 0x00, 0x00),
1315 raw_pdu(0x42, 0x0d));
1316 define_test("/TP/SIG/SYN/BV-06-C", test_server_1_3,
1317 raw_pdu(0x00, 0x01),
1318 raw_pdu(0x02, 0x01, 0x04, 0x00),
1319 raw_pdu(0x10, 0x0c, 0x04),
1320 raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1321 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
1322 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1323 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1325 raw_pdu(0x22, 0x03),
1326 raw_pdu(0x30, 0x06, 0x04),
1327 raw_pdu(0x32, 0x06),
1328 raw_pdu(0x40, 0x07, 0x04),
1329 raw_pdu(0x42, 0x07),
1330 raw_pdu(0x50, 0x0d, 0x04, 0x00, 0x00),
1331 raw_pdu(0x52, 0x0d));
1333 return g_test_run();