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"
39 #include "src/shared/queue.h"
40 #include "src/shared/tester.h"
43 #include "android/avdtp.h"
56 struct test_pdu *pdu_list;
59 #define data(args...) ((const unsigned char[]) { args })
61 #define raw_pdu(args...) \
65 .size = sizeof(data(args)), \
68 #define frg_pdu(args...) \
73 .size = sizeof(data(args)), \
76 #define define_test(name, function, args...) \
78 const struct test_pdu pdus[] = { \
81 static struct test_data data; \
82 data.test_name = g_strdup(name); \
83 data.pdu_list = g_memdup(pdus, sizeof(pdus)); \
84 tester_add(name, &data, NULL, function, NULL); \
88 struct avdtp *session;
89 struct avdtp_local_sep *sep;
90 struct avdtp_stream *stream;
96 gboolean pending_open;
97 gboolean pending_suspend;
98 unsigned int pdu_offset;
99 const struct test_data *data;
102 static void test_debug(const char *str, void *user_data)
104 const char *prefix = user_data;
106 tester_debug("%s%s", prefix, str);
109 static void test_free(gconstpointer user_data)
111 const struct test_data *data = user_data;
113 g_free(data->test_name);
114 g_free(data->pdu_list);
117 static void unregister_sep(void *data)
119 struct avdtp_local_sep *sep = data;
121 /* Removed from the queue by caller */
122 avdtp_unregister_sep(NULL, sep);
125 static void destroy_context(struct context *context)
127 if (context->source > 0)
128 g_source_remove(context->source);
129 avdtp_unref(context->session);
131 test_free(context->data);
132 queue_destroy(context->lseps, unregister_sep);
137 static gboolean context_quit(gpointer user_data)
139 struct context *context = user_data;
141 if (context->process > 0)
142 g_source_remove(context->process);
144 destroy_context(context);
146 tester_test_passed();
151 static gboolean send_pdu(gpointer user_data)
153 struct context *context = user_data;
154 const struct test_pdu *pdu;
157 pdu = &context->data->pdu_list[context->pdu_offset++];
159 len = write(context->fd, pdu->data, pdu->size);
161 util_hexdump('<', pdu->data, len, test_debug, "AVDTP: ");
163 g_assert_cmpint(len, ==, pdu->size);
165 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-02-C"))
166 g_timeout_add_seconds(1, context_quit, context);
169 return send_pdu(user_data);
171 context->process = 0;
175 static void context_process(struct context *context)
177 if (!context->data->pdu_list[context->pdu_offset].valid) {
178 context_quit(context);
182 context->process = g_idle_add(send_pdu, context);
185 static gboolean transport_open(struct avdtp_stream *stream)
189 fd = open("/dev/null", O_RDWR, 0);
191 g_assert_not_reached();
193 return avdtp_stream_set_transport(stream, fd, 672, 672);
196 static gboolean test_handler(GIOChannel *channel, GIOCondition cond,
199 struct context *context = user_data;
200 const struct test_pdu *pdu;
201 unsigned char buf[512];
205 pdu = &context->data->pdu_list[context->pdu_offset++];
207 if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) {
212 fd = g_io_channel_unix_get_fd(channel);
214 len = read(fd, buf, sizeof(buf));
218 util_hexdump('>', buf, len, test_debug, "AVDTP: ");
220 g_assert_cmpint(len, ==, pdu->size);
222 g_assert(memcmp(buf, pdu->data, pdu->size) == 0);
224 if (context->pending_open) {
225 context->pending_open = FALSE;
226 g_assert(transport_open(context->stream));
229 if (context->pending_suspend) {
232 context->pending_suspend = FALSE;
233 ret = avdtp_suspend(context->session, context->stream);
234 g_assert_cmpint(ret, ==, 0);
237 if (!pdu->fragmented)
238 context_process(context);
243 static struct context *context_new(uint16_t version, uint16_t imtu,
244 uint16_t omtu, gconstpointer data)
246 struct context *context = g_new0(struct context, 1);
250 err = socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sv);
253 context->lseps = queue_new();
254 g_assert(context->lseps);
256 context->session = avdtp_new(sv[0], imtu, omtu, version,
258 g_assert(context->session != NULL);
260 channel = g_io_channel_unix_new(sv[1]);
262 g_io_channel_set_close_on_unref(channel, TRUE);
263 g_io_channel_set_encoding(channel, NULL, NULL);
264 g_io_channel_set_buffered(channel, FALSE);
266 context->source = g_io_add_watch(channel,
267 G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
268 test_handler, context);
269 g_assert(context->source > 0);
271 g_io_channel_unref(channel);
274 context->data = data;
279 static struct context *create_context(uint16_t version, gconstpointer data)
281 return context_new(version, 672, 672, data);
284 static gboolean sep_getcap_ind(struct avdtp *session,
285 struct avdtp_local_sep *sep,
286 GSList **caps, uint8_t *err,
289 struct avdtp_service_capability *media_transport, *media_codec;
290 struct avdtp_media_codec_capability *codec_caps;
291 uint8_t cap[4] = { 0xff, 0xff, 2, 64 };
295 media_transport = avdtp_service_cap_new(AVDTP_MEDIA_TRANSPORT,
298 *caps = g_slist_append(*caps, media_transport);
300 codec_caps = g_malloc0(sizeof(*codec_caps) + sizeof(cap));
301 codec_caps->media_type = AVDTP_MEDIA_TYPE_AUDIO;
302 codec_caps->media_codec_type = 0x00;
303 memcpy(codec_caps->data, cap, sizeof(cap));
305 media_codec = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, codec_caps,
306 sizeof(*codec_caps) + sizeof(cap));
308 *caps = g_slist_append(*caps, media_codec);
314 static gboolean sep_open_ind(struct avdtp *session, struct avdtp_local_sep *sep,
315 struct avdtp_stream *stream, uint8_t *err,
318 struct context *context = user_data;
320 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-18-C")) {
325 context->pending_open = TRUE;
326 context->stream = stream;
331 static gboolean sep_setconf_ind(struct avdtp *session,
332 struct avdtp_local_sep *sep,
333 struct avdtp_stream *stream,
335 avdtp_set_configuration_cb cb,
338 struct context *context = user_data;
340 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-09-C"))
343 cb(session, stream, NULL);
348 static gboolean sep_start_ind(struct avdtp *session,
349 struct avdtp_local_sep *sep,
350 struct avdtp_stream *stream,
354 struct context *context = user_data;
356 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-21-C")) {
361 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-25-C"))
362 context->pending_suspend = TRUE;
367 static gboolean sep_close_ind(struct avdtp *session,
368 struct avdtp_local_sep *sep,
369 struct avdtp_stream *stream,
373 struct context *context = user_data;
375 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-24-C")) {
383 static gboolean sep_suspend_ind(struct avdtp *session,
384 struct avdtp_local_sep *sep,
385 struct avdtp_stream *stream,
389 struct context *context = user_data;
391 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-27-C")) {
399 static struct avdtp_sep_ind sep_ind = {
400 .get_capability = sep_getcap_ind,
401 .set_configuration = sep_setconf_ind,
402 .open = sep_open_ind,
403 .close = sep_close_ind,
404 .start = sep_start_ind,
405 .suspend = sep_suspend_ind,
408 static void sep_setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
409 struct avdtp_stream *stream,
410 struct avdtp_error *err, void *user_data)
412 struct context *context = user_data;
415 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-09-C")) {
416 context_quit(context);
420 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-07-C")) {
421 g_assert(err != NULL);
422 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x13);
423 context_quit(context);
427 g_assert(err == NULL);
429 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-11-C") ||
430 g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-10-C"))
431 ret = avdtp_get_configuration(session, stream);
432 else if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-23-C"))
433 ret = avdtp_abort(session, stream);
435 ret = avdtp_open(session, stream);
437 g_assert_cmpint(ret, ==, 0);
440 static void sep_getconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
441 struct avdtp_stream *stream,
442 struct avdtp_error *err, void *user_data)
444 struct context *context = user_data;
446 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-10-C")) {
447 g_assert(err != NULL);
448 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x12);
450 g_assert(err == NULL);
452 context_quit(context);
455 static void sep_open_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
456 struct avdtp_stream *stream, struct avdtp_error *err,
461 g_assert(err == NULL);
463 g_assert(transport_open(stream));
465 ret = avdtp_start(session, stream);
466 g_assert_cmpint(ret, ==, 0);
469 static void sep_start_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
470 struct avdtp_stream *stream, struct avdtp_error *err,
473 struct context *context = user_data;
476 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-19-C") ||
477 g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-22-C")) {
478 g_assert(err != NULL);
479 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x31);
480 context_quit(context);
484 g_assert(err == NULL);
486 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-19-C"))
487 ret = avdtp_close(session, stream, FALSE);
489 ret = avdtp_suspend(session, stream);
491 g_assert_cmpint(ret, ==, 0);
494 static void sep_suspend_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
495 struct avdtp_stream *stream, struct avdtp_error *err,
498 struct context *context = user_data;
500 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-25-C")) {
501 g_assert(err != NULL);
502 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x31);
503 context_quit(context);
507 static struct avdtp_sep_cfm sep_cfm = {
508 .set_configuration = sep_setconf_cfm,
509 .get_configuration = sep_getconf_cfm,
510 .open = sep_open_cfm,
511 .start = sep_start_cfm,
512 .suspend = sep_suspend_cfm,
515 static void test_server(gconstpointer data)
517 struct context *context = create_context(0x0100, data);
518 struct avdtp_local_sep *sep;
520 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SOURCE,
521 AVDTP_MEDIA_TYPE_AUDIO,
522 0x00, FALSE, &sep_ind, &sep_cfm,
526 g_idle_add(send_pdu, context);
529 static void test_server_1_3(gconstpointer data)
531 struct context *context = create_context(0x0103, data);
532 struct avdtp_local_sep *sep;
534 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SOURCE,
535 AVDTP_MEDIA_TYPE_AUDIO,
536 0x00, TRUE, &sep_ind, NULL, context);
539 g_idle_add(send_pdu, context);
542 static void test_server_1_3_sink(gconstpointer data)
544 struct context *context = create_context(0x0103, data);
545 struct avdtp_local_sep *sep;
547 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SINK,
548 AVDTP_MEDIA_TYPE_AUDIO,
549 0x00, TRUE, &sep_ind, NULL, context);
552 g_idle_add(send_pdu, context);
555 static void test_server_0_sep(gconstpointer data)
557 struct context *context = create_context(0x0100, data);
559 g_idle_add(send_pdu, context);
562 static void test_server_seid(gconstpointer data)
564 struct context *context = create_context(0x0103, data);
565 struct avdtp_local_sep *sep;
568 for (i = 0; i < sizeof(int) * 8; i++) {
569 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SINK,
570 AVDTP_MEDIA_TYPE_AUDIO,
571 0x00, TRUE, &sep_ind, NULL,
576 /* Now add (MAX_SEID + 1) SEP -> it shall fail */
577 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SINK,
578 AVDTP_MEDIA_TYPE_AUDIO,
579 0x00, TRUE, &sep_ind, NULL,
583 context_quit(context);
586 static void test_server_seid_duplicate(gconstpointer data)
588 struct context *context = create_context(0x0103, data);
589 struct avdtp_local_sep *sep;
592 for (i = 0; i < 2; i++) {
593 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SINK,
594 AVDTP_MEDIA_TYPE_AUDIO,
595 0x00, TRUE, &sep_ind, NULL,
600 /* Remove 1st element */
601 sep = queue_peek_head(context->lseps);
604 avdtp_unregister_sep(context->lseps, sep);
606 /* Now register new element */
607 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SINK,
608 AVDTP_MEDIA_TYPE_AUDIO,
609 0x00, TRUE, &sep_ind, NULL,
613 /* Check SEID ids with DISCOVER */
615 g_idle_add(send_pdu, context);
618 static gboolean sep_getcap_ind_frg(struct avdtp *session,
619 struct avdtp_local_sep *sep,
620 GSList **caps, uint8_t *err,
623 struct avdtp_service_capability *media_transport, *media_codec;
624 struct avdtp_service_capability *content_protection;
625 struct avdtp_media_codec_capability *codec_caps;
626 uint8_t cap[4] = { 0xff, 0xff, 2, 64 };
627 uint8_t frg_cap[96] = {};
631 media_transport = avdtp_service_cap_new(AVDTP_MEDIA_TRANSPORT,
634 *caps = g_slist_append(*caps, media_transport);
636 codec_caps = g_malloc0(sizeof(*codec_caps) + sizeof(cap));
637 codec_caps->media_type = AVDTP_MEDIA_TYPE_AUDIO;
638 codec_caps->media_codec_type = 0x00;
639 memcpy(codec_caps->data, cap, sizeof(cap));
641 media_codec = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, codec_caps,
642 sizeof(*codec_caps) + sizeof(cap));
644 *caps = g_slist_append(*caps, media_codec);
647 content_protection = avdtp_service_cap_new(AVDTP_CONTENT_PROTECTION,
648 frg_cap, sizeof(frg_cap));
649 *caps = g_slist_append(*caps, content_protection);
654 static struct avdtp_sep_ind sep_ind_frg = {
655 .get_capability = sep_getcap_ind_frg,
658 static void test_server_frg(gconstpointer data)
660 struct context *context = context_new(0x0100, 48, 48, data);
661 struct avdtp_local_sep *sep;
663 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SOURCE,
664 AVDTP_MEDIA_TYPE_AUDIO,
665 0x00, TRUE, &sep_ind_frg,
669 g_idle_add(send_pdu, context);
672 static void discover_cb(struct avdtp *session, GSList *seps,
673 struct avdtp_error *err, void *user_data)
675 struct context *context = user_data;
676 struct avdtp_stream *stream;
677 struct avdtp_remote_sep *rsep;
678 struct avdtp_service_capability *media_transport, *media_codec;
679 struct avdtp_media_codec_capability *cap;
681 uint8_t data[4] = { 0x21, 0x02, 2, 32 };
684 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-05-C") ||
685 g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-07-C") ||
686 g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-25-C"))
689 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-01-C")) {
690 g_assert(err != NULL);
691 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x01);
692 context_quit(context);
696 if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-04-C") ||
697 g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-32-C")) {
698 g_assert(err != NULL);
699 g_assert_cmpint(avdtp_error_error_code(err), ==, 0x11);
700 context_quit(context);
704 g_assert(err == NULL);
705 g_assert_cmpint(g_slist_length(seps), !=, 0);
707 if (g_str_equal(context->data->test_name, "/TP/SIG/FRA/BV-02-C")) {
708 g_assert(err == NULL);
709 context_quit(context);
713 rsep = avdtp_find_remote_sep(session, context->sep);
714 g_assert(rsep != NULL);
716 media_transport = avdtp_service_cap_new(AVDTP_MEDIA_TRANSPORT,
719 caps = g_slist_append(NULL, media_transport);
721 cap = g_malloc0(sizeof(*cap) + sizeof(data));
722 cap->media_type = AVDTP_MEDIA_TYPE_AUDIO;
723 cap->media_codec_type = 0x00;
724 memcpy(cap->data, data, sizeof(data));
726 media_codec = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, cap,
727 sizeof(*cap) + sizeof(data));
729 caps = g_slist_append(caps, media_codec);
732 ret = avdtp_set_configuration(session, rsep, context->sep, caps,
734 g_assert_cmpint(ret, ==, 0);
736 g_slist_free_full(caps, g_free);
739 static void test_client(gconstpointer data)
741 struct context *context = create_context(0x0100, data);
742 struct avdtp_local_sep *sep;
744 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SINK,
745 AVDTP_MEDIA_TYPE_AUDIO,
746 0x00, FALSE, NULL, &sep_cfm, context);
750 avdtp_discover(context->session, discover_cb, context);
753 static void test_client_1_3(gconstpointer data)
755 struct context *context = create_context(0x0103, data);
756 struct avdtp_local_sep *sep;
758 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SINK,
759 AVDTP_MEDIA_TYPE_AUDIO,
760 0x00, TRUE, NULL, &sep_cfm, context);
764 avdtp_discover(context->session, discover_cb, context);
767 static void test_client_frg(gconstpointer data)
769 struct context *context = context_new(0x0100, 48, 48, data);
770 struct avdtp_local_sep *sep;
772 sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SINK,
773 AVDTP_MEDIA_TYPE_AUDIO,
774 0x00, TRUE, NULL, &sep_cfm, context);
778 avdtp_discover(context->session, discover_cb, context);
781 int main(int argc, char *argv[])
783 tester_init(&argc, &argv);
785 __btd_log_init("*", 0);
788 * Stream Management Service
790 * To verify that the following procedures are implemented according to
791 * their specification in AVDTP.
793 define_test("/TP/SIG/SMG/BV-06-C-SEID-1", test_server_seid,
795 define_test("/TP/SIG/SMG/BV-06-C-SEID-2", test_server_seid_duplicate,
797 raw_pdu(0x02, 0x01, 0x08, 0x08, 0x04, 0x08));
798 define_test("/TP/SIG/SMG/BV-05-C", test_client,
799 raw_pdu(0x00, 0x01));
800 define_test("/TP/SIG/SMG/BV-06-C", test_server,
802 raw_pdu(0x02, 0x01, 0x04, 0x00));
803 define_test("/TP/SIG/SMG/BV-07-C", test_client,
805 raw_pdu(0x12, 0x01, 0x04, 0x00),
806 raw_pdu(0x20, 0x02, 0x04));
807 define_test("/TP/SIG/SMG/BV-08-C", test_server,
809 raw_pdu(0x02, 0x01, 0x04, 0x00),
810 raw_pdu(0x10, 0x02, 0x04),
811 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
812 0xff, 0xff, 0x02, 0x40));
813 define_test("/TP/SIG/SMG/BV-09-C", test_client,
815 raw_pdu(0x32, 0x01, 0x04, 0x00),
816 raw_pdu(0x40, 0x02, 0x04),
817 raw_pdu(0x42, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
818 0xff, 0xff, 0x02, 0x40),
819 raw_pdu(0x50, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
820 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
821 raw_pdu(0x52, 0x03));
822 define_test("/TP/SIG/SMG/BV-10-C", test_server,
824 raw_pdu(0x02, 0x01, 0x04, 0x00),
825 raw_pdu(0x10, 0x02, 0x04),
826 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
827 0xff, 0xff, 0x02, 0x40),
828 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
829 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
830 raw_pdu(0x22, 0x03));
831 define_test("/TP/SIG/SMG/BV-11-C", test_client,
833 raw_pdu(0x62, 0x01, 0x04, 0x00),
834 raw_pdu(0x70, 0x02, 0x04),
835 raw_pdu(0x72, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
836 0xff, 0xff, 0x02, 0x40),
837 raw_pdu(0x80, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
838 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
840 raw_pdu(0x90, 0x04, 0x04));
841 define_test("/TP/SIG/SMG/BV-12-C", test_server,
843 raw_pdu(0x02, 0x01, 0x04, 0x00),
844 raw_pdu(0x10, 0x02, 0x04),
845 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
846 0xff, 0xff, 0x02, 0x40),
847 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
848 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
850 raw_pdu(0x30, 0x04, 0x04),
851 raw_pdu(0x32, 0x04, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
852 0x21, 0x02, 0x02, 0x20));
853 define_test("/TP/SIG/SMG/BV-15-C", test_client,
855 raw_pdu(0xa2, 0x01, 0x04, 0x00),
856 raw_pdu(0xb0, 0x02, 0x04),
857 raw_pdu(0xb2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
858 0xff, 0xff, 0x02, 0x40),
859 raw_pdu(0xc0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
860 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
862 raw_pdu(0xd0, 0x06, 0x04));
863 define_test("/TP/SIG/SMG/BV-16-C", test_server,
865 raw_pdu(0x02, 0x01, 0x04, 0x00),
866 raw_pdu(0x10, 0x02, 0x04),
867 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
868 0xff, 0xff, 0x02, 0x40),
869 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
870 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
872 raw_pdu(0x30, 0x06, 0x04),
873 raw_pdu(0x32, 0x06));
874 define_test("/TP/SIG/SMG/BV-17-C", test_client,
876 raw_pdu(0xe2, 0x01, 0x04, 0x00),
877 raw_pdu(0xf0, 0x02, 0x04),
878 raw_pdu(0xf2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
879 0xff, 0xff, 0x02, 0x40),
880 raw_pdu(0x00, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
881 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
883 raw_pdu(0x10, 0x06, 0x04),
885 raw_pdu(0x20, 0x07, 0x04));
886 define_test("/TP/SIG/SMG/BV-18-C", test_server,
888 raw_pdu(0x02, 0x01, 0x04, 0x00),
889 raw_pdu(0x10, 0x02, 0x04),
890 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
891 0xff, 0xff, 0x02, 0x40),
892 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
893 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
895 raw_pdu(0x30, 0x06, 0x04),
897 raw_pdu(0x40, 0x07, 0x04),
898 raw_pdu(0x42, 0x07));
899 define_test("/TP/SIG/SMG/BV-19-C", test_client,
901 raw_pdu(0x32, 0x01, 0x04, 0x00),
902 raw_pdu(0x40, 0x02, 0x04),
903 raw_pdu(0x42, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
904 0xff, 0xff, 0x02, 0x40),
905 raw_pdu(0x50, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
906 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
908 raw_pdu(0x60, 0x06, 0x04),
910 raw_pdu(0x70, 0x07, 0x04),
912 raw_pdu(0x80, 0x08, 0x04));
913 define_test("/TP/SIG/SMG/BV-20-C", test_server,
915 raw_pdu(0x02, 0x01, 0x04, 0x00),
916 raw_pdu(0x10, 0x02, 0x04),
917 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
918 0xff, 0xff, 0x02, 0x40),
919 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
920 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
922 raw_pdu(0x30, 0x06, 0x04),
924 raw_pdu(0x40, 0x07, 0x04),
926 raw_pdu(0x50, 0x08, 0x04),
927 raw_pdu(0x52, 0x08));
928 define_test("/TP/SIG/SMG/BV-21-C", test_client,
930 raw_pdu(0x92, 0x01, 0x04, 0x00),
931 raw_pdu(0xa0, 0x02, 0x04),
932 raw_pdu(0xa2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
933 0xff, 0xff, 0x02, 0x40),
934 raw_pdu(0xb0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
935 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
937 raw_pdu(0xc0, 0x06, 0x04),
939 raw_pdu(0xd0, 0x07, 0x04),
941 raw_pdu(0xe0, 0x09, 0x04));
942 define_test("/TP/SIG/SMG/BV-22-C", test_server,
944 raw_pdu(0x02, 0x01, 0x04, 0x00),
945 raw_pdu(0x10, 0x02, 0x04),
946 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
947 0xff, 0xff, 0x02, 0x40),
948 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
949 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
951 raw_pdu(0x30, 0x06, 0x04),
953 raw_pdu(0x40, 0x07, 0x04),
955 raw_pdu(0x50, 0x09, 0x04),
956 raw_pdu(0x52, 0x09));
957 define_test("/TP/SIG/SMG/BV-23-C", test_client,
959 raw_pdu(0xf2, 0x01, 0x04, 0x00),
960 raw_pdu(0x00, 0x02, 0x04),
961 raw_pdu(0x02, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
962 0xff, 0xff, 0x02, 0x40),
963 raw_pdu(0x10, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
964 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
966 raw_pdu(0x20, 0x0a, 0x04));
967 define_test("/TP/SIG/SMG/BV-24-C", test_server,
969 raw_pdu(0x02, 0x01, 0x04, 0x00),
970 raw_pdu(0x10, 0x02, 0x04),
971 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
972 0xff, 0xff, 0x02, 0x40),
973 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
974 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
976 raw_pdu(0x30, 0x0a, 0x04),
977 raw_pdu(0x32, 0x0a));
978 define_test("/TP/SIG/SMG/BV-25-C", test_client_1_3,
980 raw_pdu(0x32, 0x01, 0x04, 0x00),
981 raw_pdu(0x40, 0x0c, 0x04));
982 define_test("/TP/SIG/SMG/BV-26-C", test_server_1_3,
984 raw_pdu(0x02, 0x01, 0x04, 0x00),
985 raw_pdu(0x10, 0x0c, 0x04),
986 raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
987 0xff, 0xff, 0x02, 0x40, 0x08, 0x00));
988 define_test("/TP/SIG/SMG/BV-27-C", test_server_1_3,
990 raw_pdu(0x02, 0x01, 0x04, 0x00),
991 raw_pdu(0x10, 0x02, 0x04),
992 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
993 0xff, 0xff, 0x02, 0x40));
994 define_test("/TP/SIG/SMG/BV-28-C", test_client_1_3,
996 raw_pdu(0x52, 0x01, 0x04, 0x00),
997 raw_pdu(0x60, 0x0c, 0x04),
998 raw_pdu(0x62, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
999 0xff, 0xff, 0x02, 0x40, 0x0f, 0x00),
1000 raw_pdu(0x70, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1001 0x00, 0x00, 0x21, 0x02, 0x02, 0x20));
1002 define_test("/TP/SIG/SMG/BV-31-C", test_client_1_3,
1003 raw_pdu(0x80, 0x01),
1004 raw_pdu(0x82, 0x01, 0x04, 0x00),
1005 raw_pdu(0x90, 0x0c, 0x04),
1006 raw_pdu(0x92, 0x0c, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00,
1007 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x06,
1008 0x00, 0x00, 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
1009 raw_pdu(0xa0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1010 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1012 define_test("/TP/SIG/SMG/BI-01-C", test_client,
1013 raw_pdu(0xb0, 0x01),
1014 raw_pdu(0xb3, 0x01, 0x01));
1015 define_test("/TP/SIG/SMG/BI-02-C", test_server,
1016 raw_pdu(0x01, 0x01));
1017 define_test("/TP/SIG/SMG/BI-03-C", test_server_0_sep,
1018 raw_pdu(0x00, 0x01),
1019 raw_pdu(0x03, 0x01, 0x19));
1020 define_test("/TP/SIG/SMG/BI-04-C", test_client,
1021 raw_pdu(0xc0, 0x01),
1022 raw_pdu(0xc2, 0x01, 0x04, 0x00),
1023 raw_pdu(0xd0, 0x02, 0x04),
1024 raw_pdu(0xd3, 0x02, 0x11));
1025 define_test("/TP/SIG/SMG/BI-05-C", test_server,
1026 raw_pdu(0x00, 0x01),
1027 raw_pdu(0x02, 0x01, 0x04, 0x00),
1028 raw_pdu(0x10, 0x02),
1029 raw_pdu(0x13, 0x02, 0x11));
1030 define_test("/TP/SIG/SMG/BI-06-C", test_server,
1031 raw_pdu(0x00, 0x01),
1032 raw_pdu(0x02, 0x01, 0x04, 0x00),
1033 raw_pdu(0x10, 0x02, 0x00),
1034 raw_pdu(0x13, 0x02, 0x12));
1035 define_test("/TP/SIG/SMG/BI-07-C", test_client,
1036 raw_pdu(0xe0, 0x01),
1037 raw_pdu(0xe2, 0x01, 0x04, 0x00),
1038 raw_pdu(0xf0, 0x02, 0x04),
1039 raw_pdu(0xf2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1040 0xff, 0xff, 0x02, 0x40),
1041 raw_pdu(0x00, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1042 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1043 raw_pdu(0x03, 0x03, 0x00, 0x13));
1044 define_test("/TP/SIG/SMG/BI-08-C", test_server,
1045 raw_pdu(0x00, 0x01),
1046 raw_pdu(0x02, 0x01, 0x04, 0x00),
1047 raw_pdu(0x10, 0x02, 0x04),
1048 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1049 0xff, 0xff, 0x02, 0x40),
1050 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1051 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1052 raw_pdu(0x22, 0x03),
1053 raw_pdu(0x30, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1054 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1055 raw_pdu(0x33, 0x03, 0x00, 0x13));
1056 define_test("/TP/SIG/SMG/BI-09-C", test_server,
1057 raw_pdu(0x00, 0x01),
1058 raw_pdu(0x02, 0x01, 0x04, 0x00),
1059 raw_pdu(0x10, 0x02, 0x04),
1060 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1061 0xff, 0xff, 0x02, 0x40),
1062 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1063 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1064 raw_pdu(0x23, 0x03, 0x00, 0x29));
1065 define_test("/TP/SIG/SMG/BI-10-C", test_client,
1066 raw_pdu(0x10, 0x01),
1067 raw_pdu(0x12, 0x01, 0x04, 0x00),
1068 raw_pdu(0x20, 0x02, 0x04),
1069 raw_pdu(0x22, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1070 0xff, 0xff, 0x02, 0x40),
1071 raw_pdu(0x30, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1072 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1073 raw_pdu(0x32, 0x03),
1074 raw_pdu(0x40, 0x04, 0x04),
1075 raw_pdu(0x43, 0x04, 0x12));
1076 define_test("/TP/SIG/SMG/BI-11-C", test_server,
1077 raw_pdu(0x00, 0x01),
1078 raw_pdu(0x02, 0x01, 0x04, 0x00),
1079 raw_pdu(0x10, 0x02, 0x04),
1080 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1081 0xff, 0xff, 0x02, 0x40),
1082 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1083 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1084 raw_pdu(0x22, 0x03),
1085 raw_pdu(0x30, 0x04, 0x00),
1086 raw_pdu(0x33, 0x04, 0x12));
1087 define_test("/TP/SIG/SMG/BI-17-C", test_server,
1088 raw_pdu(0x00, 0x01),
1089 raw_pdu(0x02, 0x01, 0x04, 0x00),
1090 raw_pdu(0x10, 0x02, 0x04),
1091 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1092 0xff, 0xff, 0x02, 0x40),
1093 raw_pdu(0x30, 0x06, 0x04),
1094 raw_pdu(0x33, 0x06, 0x31));
1095 define_test("/TP/SIG/SMG/BI-18-C", test_server,
1096 raw_pdu(0x00, 0x01),
1097 raw_pdu(0x02, 0x01, 0x04, 0x00),
1098 raw_pdu(0x10, 0x02, 0x04),
1099 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1100 0xff, 0xff, 0x02, 0x40),
1101 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1102 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1103 raw_pdu(0x22, 0x03),
1104 raw_pdu(0x30, 0x06, 0x04),
1105 raw_pdu(0x33, 0x06, 0xc0));
1106 define_test("/TP/SIG/SMG/BI-19-C", test_client,
1107 raw_pdu(0x50, 0x01),
1108 raw_pdu(0x52, 0x01, 0x04, 0x00),
1109 raw_pdu(0x60, 0x02, 0x04),
1110 raw_pdu(0x62, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1111 0xff, 0xff, 0x02, 0x40),
1112 raw_pdu(0x70, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1113 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1114 raw_pdu(0x72, 0x03),
1115 raw_pdu(0x80, 0x06, 0x04),
1116 raw_pdu(0x82, 0x06),
1117 raw_pdu(0x90, 0x07, 0x04),
1118 raw_pdu(0x93, 0x07, 0x04, 0x31));
1119 define_test("/TP/SIG/SMG/BI-20-C", test_server,
1120 raw_pdu(0x00, 0x01),
1121 raw_pdu(0x02, 0x01, 0x04, 0x00),
1122 raw_pdu(0x10, 0x02, 0x04),
1123 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1124 0xff, 0xff, 0x02, 0x40),
1125 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1126 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1127 raw_pdu(0x22, 0x03),
1128 raw_pdu(0x30, 0x07, 0x04),
1129 raw_pdu(0x33, 0x07, 0x04, 0x31));
1130 define_test("/TP/SIG/SMG/BI-21-C", test_server,
1131 raw_pdu(0x00, 0x01),
1132 raw_pdu(0x02, 0x01, 0x04, 0x00),
1133 raw_pdu(0x10, 0x02, 0x04),
1134 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1135 0xff, 0xff, 0x02, 0x40),
1136 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1137 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1138 raw_pdu(0x22, 0x03),
1139 raw_pdu(0x30, 0x06, 0x04),
1140 raw_pdu(0x32, 0x06),
1141 raw_pdu(0x40, 0x07, 0x04),
1142 raw_pdu(0x43, 0x07, 0x04, 0xc0));
1143 define_test("/TP/SIG/SMG/BI-22-C", test_client,
1144 raw_pdu(0xa0, 0x01),
1145 raw_pdu(0xa2, 0x01, 0x04, 0x00),
1146 raw_pdu(0xb0, 0x02, 0x04),
1147 raw_pdu(0xb2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1148 0xff, 0xff, 0x02, 0x40),
1149 raw_pdu(0xc0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1150 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1151 raw_pdu(0xc2, 0x03),
1152 raw_pdu(0xd0, 0x06, 0x04),
1153 raw_pdu(0xd2, 0x06),
1154 raw_pdu(0xe0, 0x07, 0x04),
1155 raw_pdu(0xe3, 0x07, 0x04, 0x31));
1156 define_test("/TP/SIG/SMG/BI-23-C", test_server,
1157 raw_pdu(0x00, 0x01),
1158 raw_pdu(0x02, 0x01, 0x04, 0x00),
1159 raw_pdu(0x10, 0x02, 0x04),
1160 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1161 0xff, 0xff, 0x02, 0x40),
1162 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1163 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1164 raw_pdu(0x22, 0x03),
1165 raw_pdu(0x30, 0x06, 0x04),
1166 raw_pdu(0x32, 0x06),
1167 raw_pdu(0x40, 0x08, 0x00),
1168 raw_pdu(0x43, 0x08, 0x12));
1169 define_test("/TP/SIG/SMG/BI-24-C", test_server,
1170 raw_pdu(0x00, 0x01),
1171 raw_pdu(0x02, 0x01, 0x04, 0x00),
1172 raw_pdu(0x10, 0x02, 0x04),
1173 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1174 0xff, 0xff, 0x02, 0x40),
1175 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1176 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1177 raw_pdu(0x22, 0x03),
1178 raw_pdu(0x30, 0x06, 0x04),
1179 raw_pdu(0x32, 0x06),
1180 raw_pdu(0x40, 0x08, 0x04),
1181 raw_pdu(0x43, 0x08, 0xc0));
1182 define_test("/TP/SIG/SMG/BI-25-C", test_server,
1183 raw_pdu(0x00, 0x01),
1184 raw_pdu(0x02, 0x01, 0x04, 0x00),
1185 raw_pdu(0x10, 0x02, 0x04),
1186 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1187 0xff, 0xff, 0x02, 0x40),
1188 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1189 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1190 raw_pdu(0x22, 0x03),
1191 raw_pdu(0x30, 0x06, 0x04),
1192 raw_pdu(0x32, 0x06),
1193 raw_pdu(0x40, 0x07, 0x04),
1194 raw_pdu(0x42, 0x07),
1195 raw_pdu(0xf0, 0x09, 0x04),
1196 raw_pdu(0xf3, 0x09, 0x04, 0x31));
1197 define_test("/TP/SIG/SMG/BI-26-C", test_server,
1198 raw_pdu(0x00, 0x01),
1199 raw_pdu(0x02, 0x01, 0x04, 0x00),
1200 raw_pdu(0x10, 0x02, 0x04),
1201 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1202 0xff, 0xff, 0x02, 0x40),
1203 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1204 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1205 raw_pdu(0x22, 0x03),
1206 raw_pdu(0x30, 0x06, 0x04),
1207 raw_pdu(0x32, 0x06),
1208 raw_pdu(0x40, 0x09, 0x04),
1209 raw_pdu(0x43, 0x09, 0x04, 0x31));
1210 define_test("/TP/SIG/SMG/BI-27-C", test_server,
1211 raw_pdu(0x00, 0x01),
1212 raw_pdu(0x02, 0x01, 0x04, 0x00),
1213 raw_pdu(0x10, 0x02, 0x04),
1214 raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1215 0xff, 0xff, 0x02, 0x40),
1216 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1217 0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
1218 raw_pdu(0x22, 0x03),
1219 raw_pdu(0x30, 0x06, 0x04),
1220 raw_pdu(0x32, 0x06),
1221 raw_pdu(0x40, 0x07, 0x04),
1222 raw_pdu(0x42, 0x07),
1223 raw_pdu(0x50, 0x09, 0x04),
1224 raw_pdu(0x53, 0x09, 0x04, 0xc0));
1225 define_test("/TP/SIG/SMG/BI-28-C", test_server,
1226 raw_pdu(0x00, 0xff),
1227 raw_pdu(0x01, 0x3f));
1228 define_test("/TP/SIG/SMG/BI-30-C", test_client,
1229 raw_pdu(0x00, 0x01),
1230 raw_pdu(0x02, 0x01, 0x04, 0x00),
1231 raw_pdu(0x10, 0x02, 0x04),
1232 raw_pdu(0x12, 0x02, 0xee, 0x01, 0x00, 0x01, 0x00, 0x07,
1233 0x06, 0x00, 0x00, 0xff, 0xff, 0x02, 0x40),
1234 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1235 0x00, 0x00, 0x21, 0x02, 0x02, 0x20));
1236 define_test("/TP/SIG/SMG/ESR04/BI-28-C", test_server,
1237 raw_pdu(0x00, 0x3f),
1238 raw_pdu(0x01, 0x3f));
1239 define_test("/TP/SIG/SMG/BI-32-C", test_client_1_3,
1240 raw_pdu(0x30, 0x01),
1241 raw_pdu(0x32, 0x01, 0x04, 0x00),
1242 raw_pdu(0x40, 0x0c, 0x04),
1243 raw_pdu(0x43, 0x0c, 0x11));
1244 define_test("/TP/SIG/SMG/BI-33-C", test_server_1_3,
1245 raw_pdu(0x00, 0x01),
1246 raw_pdu(0x02, 0x01, 0x04, 0x00),
1247 raw_pdu(0x10, 0x0c),
1248 raw_pdu(0x13, 0x0c, 0x11));
1249 define_test("/TP/SIG/SMG/BI-35-C", test_client_1_3,
1250 raw_pdu(0x50, 0x01),
1251 raw_pdu(0x52, 0x01, 0x04, 0x00),
1252 raw_pdu(0x60, 0x0c, 0x04),
1253 raw_pdu(0x62, 0x0c, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00,
1254 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x06,
1255 0x00, 0x00, 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
1256 raw_pdu(0x70, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1257 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1259 define_test("/TP/SIG/SMG/BI-36-C", test_client_1_3,
1260 raw_pdu(0x80, 0x01),
1261 raw_pdu(0x82, 0x01, 0x04, 0x00),
1262 raw_pdu(0x90, 0x0c, 0x04),
1263 raw_pdu(0x92, 0x0c, 0xee, 0x01, 0x00, 0x01, 0x00, 0x07,
1264 0x06, 0x00, 0x00, 0xff, 0xff, 0x02, 0x40),
1265 raw_pdu(0xa0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1266 0x00, 0x00, 0x21, 0x02, 0x02, 0x20));
1269 * Signaling Message Fragmentation Service
1271 * verify that the IUT (INT and ACP) fragments the signaling messages
1272 * that cannot fit in a single L2CAP packet.
1274 define_test("/TP/SIG/FRA/BV-01-C", test_server_frg,
1275 raw_pdu(0x00, 0x01),
1276 raw_pdu(0x02, 0x01, 0x04, 0x00),
1277 raw_pdu(0x10, 0x02, 0x04),
1278 frg_pdu(0x16, 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00,
1279 0x00, 0xff, 0xff, 0x02, 0x40, 0x04, 0x60, 0x00,
1280 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1281 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1282 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1283 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1285 frg_pdu(0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1286 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1287 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1288 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1289 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1290 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1292 raw_pdu(0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1293 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1295 define_test("/TP/SIG/FRA/BV-02-C", test_client_frg,
1296 raw_pdu(0xb0, 0x01),
1297 raw_pdu(0xb2, 0x01, 0x04, 0x00),
1298 raw_pdu(0xc0, 0x02, 0x04),
1299 frg_pdu(0xc6, 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00,
1300 0x00, 0xff, 0xff, 0x02, 0x40, 0x04, 0x60, 0x00,
1301 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1302 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1303 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1304 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1306 frg_pdu(0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1307 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1308 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1309 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1310 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1311 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1313 raw_pdu(0xce, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1314 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1320 * Verify that the stream management signaling procedure of delay
1321 * reporting is implemented according to its specification in AVDTP.
1323 define_test("/TP/SIG/SYN/BV-01-C", test_server_1_3_sink,
1324 raw_pdu(0x00, 0x01),
1325 raw_pdu(0x02, 0x01, 0x04, 0x08),
1326 raw_pdu(0x10, 0x0c, 0x04),
1327 raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1328 0xff, 0xff, 0x02, 0x40, 0x08, 0x00));
1329 define_test("/TP/SIG/SYN/BV-02-C", test_client_1_3,
1330 raw_pdu(0xd0, 0x01),
1331 raw_pdu(0xd2, 0x01, 0x04, 0x00),
1332 raw_pdu(0xe0, 0x0c, 0x04),
1333 raw_pdu(0xe2, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1334 0xff, 0xff, 0x02, 0x40, 0x0f, 0x00, 0x08, 0x00),
1335 raw_pdu(0xf0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1336 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1338 define_test("/TP/SIG/SYN/BV-03-C", test_server_1_3_sink,
1339 raw_pdu(0x00, 0x01),
1340 raw_pdu(0x02, 0x01, 0x04, 0x08),
1341 raw_pdu(0x10, 0x0c, 0x04),
1342 raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1343 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
1344 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1345 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1347 raw_pdu(0x22, 0x03),
1348 raw_pdu(0x00, 0x0d, 0x04, 0x00, 0x00));
1349 define_test("/TP/SIG/SYN/BV-04-C", test_client_1_3,
1350 raw_pdu(0x10, 0x01),
1351 raw_pdu(0x12, 0x01, 0x04, 0x00),
1352 raw_pdu(0x20, 0x0c, 0x04),
1353 raw_pdu(0x22, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1354 0xff, 0xff, 0x02, 0x40, 0x0f, 0x00, 0x08, 0x00),
1355 raw_pdu(0x30, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1356 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1358 raw_pdu(0x32, 0x03),
1359 raw_pdu(0x40, 0x0d, 0x04, 0x00, 0x00));
1360 define_test("/TP/SIG/SYN/BV-05-C", test_server_1_3,
1361 raw_pdu(0x00, 0x01),
1362 raw_pdu(0x02, 0x01, 0x04, 0x00),
1363 raw_pdu(0x10, 0x0c, 0x04),
1364 raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1365 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
1366 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1367 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1369 raw_pdu(0x22, 0x03),
1370 raw_pdu(0x30, 0x06, 0x04),
1371 raw_pdu(0x32, 0x06),
1372 raw_pdu(0x40, 0x0d, 0x04, 0x00, 0x00),
1373 raw_pdu(0x42, 0x0d));
1374 define_test("/TP/SIG/SYN/BV-06-C", test_server_1_3,
1375 raw_pdu(0x00, 0x01),
1376 raw_pdu(0x02, 0x01, 0x04, 0x00),
1377 raw_pdu(0x10, 0x0c, 0x04),
1378 raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
1379 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
1380 raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
1381 0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
1383 raw_pdu(0x22, 0x03),
1384 raw_pdu(0x30, 0x06, 0x04),
1385 raw_pdu(0x32, 0x06),
1386 raw_pdu(0x40, 0x07, 0x04),
1387 raw_pdu(0x42, 0x07),
1388 raw_pdu(0x50, 0x0d, 0x04, 0x00, 0x00),
1389 raw_pdu(0x52, 0x0d));
1391 return tester_run();