2013-11-20 23:42:48 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* BlueZ - Bluetooth protocol stack for Linux
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Intel Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <string.h>
|
2013-11-24 20:33:03 +08:00
|
|
|
#include <fcntl.h>
|
2013-11-20 23:42:48 +08:00
|
|
|
#include <sys/socket.h>
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include "src/shared/util.h"
|
|
|
|
#include "src/log.h"
|
|
|
|
#include "android/avdtp.h"
|
|
|
|
|
|
|
|
struct test_pdu {
|
|
|
|
bool valid;
|
2013-11-21 23:37:03 +08:00
|
|
|
const uint8_t *data;
|
2013-11-20 23:42:48 +08:00
|
|
|
size_t size;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct test_data {
|
2013-11-24 21:35:52 +08:00
|
|
|
char *test_name;
|
2013-11-20 23:42:48 +08:00
|
|
|
struct test_pdu *pdu_list;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define data(args...) ((const unsigned char[]) { args })
|
|
|
|
|
|
|
|
#define raw_pdu(args...) \
|
|
|
|
{ \
|
|
|
|
.valid = true, \
|
|
|
|
.data = data(args), \
|
|
|
|
.size = sizeof(data(args)), \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define define_test(name, function, args...) \
|
|
|
|
do { \
|
|
|
|
const struct test_pdu pdus[] = { \
|
|
|
|
args, { }, { } \
|
|
|
|
}; \
|
|
|
|
static struct test_data data; \
|
2013-11-24 21:35:52 +08:00
|
|
|
data.test_name = g_strdup(name); \
|
2013-11-20 23:42:48 +08:00
|
|
|
data.pdu_list = g_malloc(sizeof(pdus)); \
|
|
|
|
memcpy(data.pdu_list, pdus, sizeof(pdus)); \
|
2013-11-27 18:43:01 +08:00
|
|
|
g_test_add_data_func(name, &data, function); \
|
2013-11-20 23:42:48 +08:00
|
|
|
} while (0)
|
|
|
|
|
|
|
|
struct context {
|
|
|
|
GMainLoop *main_loop;
|
|
|
|
struct avdtp *session;
|
2013-11-21 21:06:48 +08:00
|
|
|
struct avdtp_local_sep *sep;
|
2013-11-24 21:35:52 +08:00
|
|
|
struct avdtp_stream *stream;
|
2013-11-20 23:42:48 +08:00
|
|
|
guint source;
|
|
|
|
int fd;
|
|
|
|
int mtu;
|
2013-11-24 21:35:52 +08:00
|
|
|
gboolean pending_open;
|
2013-11-20 23:42:48 +08:00
|
|
|
unsigned int pdu_offset;
|
2013-11-24 21:35:52 +08:00
|
|
|
const struct test_data *data;
|
2013-11-20 23:42:48 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static void test_debug(const char *str, void *user_data)
|
|
|
|
{
|
|
|
|
const char *prefix = user_data;
|
|
|
|
|
|
|
|
g_print("%s%s\n", prefix, str);
|
|
|
|
}
|
|
|
|
|
2013-11-27 18:43:01 +08:00
|
|
|
static void test_free(gconstpointer user_data)
|
2013-11-24 21:35:52 +08:00
|
|
|
{
|
2013-11-27 18:43:01 +08:00
|
|
|
const struct test_data *data = user_data;
|
2013-11-24 21:35:52 +08:00
|
|
|
|
|
|
|
g_free(data->test_name);
|
|
|
|
g_free(data->pdu_list);
|
|
|
|
}
|
|
|
|
|
2013-11-28 21:28:54 +08:00
|
|
|
static gboolean context_quit(gpointer user_data)
|
2013-11-20 23:42:48 +08:00
|
|
|
{
|
2013-11-28 21:28:54 +08:00
|
|
|
struct context *context = user_data;
|
|
|
|
|
2013-11-20 23:42:48 +08:00
|
|
|
g_main_loop_quit(context->main_loop);
|
2013-11-28 21:28:54 +08:00
|
|
|
|
|
|
|
return FALSE;
|
2013-11-20 23:42:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean send_pdu(gpointer user_data)
|
|
|
|
{
|
|
|
|
struct context *context = user_data;
|
|
|
|
const struct test_pdu *pdu;
|
|
|
|
ssize_t len;
|
|
|
|
|
2013-11-24 21:35:52 +08:00
|
|
|
pdu = &context->data->pdu_list[context->pdu_offset++];
|
2013-11-20 23:42:48 +08:00
|
|
|
|
|
|
|
len = write(context->fd, pdu->data, pdu->size);
|
|
|
|
|
|
|
|
if (g_test_verbose())
|
|
|
|
util_hexdump('<', pdu->data, len, test_debug, "AVDTP: ");
|
|
|
|
|
|
|
|
g_assert(len == (ssize_t) pdu->size);
|
|
|
|
|
2013-11-28 21:28:54 +08:00
|
|
|
if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-02-C"))
|
|
|
|
g_timeout_add_seconds(1, context_quit, context);
|
|
|
|
|
2013-11-20 23:42:48 +08:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void context_process(struct context *context)
|
|
|
|
{
|
2013-11-24 21:35:52 +08:00
|
|
|
if (!context->data->pdu_list[context->pdu_offset].valid) {
|
2013-11-20 23:42:48 +08:00
|
|
|
context_quit(context);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_idle_add(send_pdu, context);
|
|
|
|
}
|
|
|
|
|
2013-11-24 21:35:52 +08:00
|
|
|
static gboolean transport_open(struct avdtp_stream *stream)
|
|
|
|
{
|
|
|
|
int fd;
|
|
|
|
|
|
|
|
fd = open("/dev/null", O_RDWR, 0);
|
|
|
|
if (fd < 0)
|
|
|
|
g_assert_not_reached();
|
|
|
|
|
|
|
|
return avdtp_stream_set_transport(stream, fd, 672, 672);
|
|
|
|
}
|
|
|
|
|
2013-11-20 23:42:48 +08:00
|
|
|
static gboolean test_handler(GIOChannel *channel, GIOCondition cond,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
struct context *context = user_data;
|
|
|
|
const struct test_pdu *pdu;
|
|
|
|
unsigned char buf[512];
|
|
|
|
ssize_t len;
|
|
|
|
int fd;
|
|
|
|
|
2013-11-24 21:35:52 +08:00
|
|
|
pdu = &context->data->pdu_list[context->pdu_offset++];
|
2013-11-20 23:42:48 +08:00
|
|
|
|
|
|
|
if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
fd = g_io_channel_unix_get_fd(channel);
|
|
|
|
|
|
|
|
len = read(fd, buf, sizeof(buf));
|
|
|
|
|
|
|
|
g_assert(len > 0);
|
|
|
|
|
|
|
|
if (g_test_verbose())
|
|
|
|
util_hexdump('>', buf, len, test_debug, "AVDTP: ");
|
|
|
|
|
|
|
|
g_assert((size_t) len == pdu->size);
|
|
|
|
|
|
|
|
g_assert(memcmp(buf, pdu->data, pdu->size) == 0);
|
|
|
|
|
2013-11-24 21:35:52 +08:00
|
|
|
if (context->pending_open) {
|
|
|
|
context->pending_open = FALSE;
|
|
|
|
g_assert(transport_open(context->stream));
|
|
|
|
}
|
|
|
|
|
2013-11-20 23:42:48 +08:00
|
|
|
context_process(context);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2013-11-24 21:35:52 +08:00
|
|
|
static struct context *create_context(uint16_t version, gconstpointer data)
|
2013-11-20 23:42:48 +08:00
|
|
|
{
|
|
|
|
struct context *context = g_new0(struct context, 1);
|
|
|
|
GIOChannel *channel;
|
|
|
|
int err, sv[2];
|
|
|
|
|
|
|
|
context->main_loop = g_main_loop_new(NULL, FALSE);
|
|
|
|
g_assert(context->main_loop);
|
|
|
|
|
|
|
|
err = socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sv);
|
|
|
|
g_assert(err == 0);
|
|
|
|
|
|
|
|
context->session = avdtp_new(sv[0], 672, 672, version);
|
|
|
|
g_assert(context->session != NULL);
|
|
|
|
|
|
|
|
channel = g_io_channel_unix_new(sv[1]);
|
|
|
|
|
|
|
|
g_io_channel_set_close_on_unref(channel, TRUE);
|
|
|
|
g_io_channel_set_encoding(channel, NULL, NULL);
|
|
|
|
g_io_channel_set_buffered(channel, FALSE);
|
|
|
|
|
|
|
|
context->source = g_io_add_watch(channel,
|
|
|
|
G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
|
|
|
|
test_handler, context);
|
|
|
|
g_assert(context->source > 0);
|
|
|
|
|
|
|
|
g_io_channel_unref(channel);
|
|
|
|
|
|
|
|
context->fd = sv[1];
|
2013-11-24 21:35:52 +08:00
|
|
|
context->data = data;
|
2013-11-20 23:42:48 +08:00
|
|
|
|
|
|
|
return context;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void execute_context(struct context *context)
|
|
|
|
{
|
|
|
|
g_main_loop_run(context->main_loop);
|
|
|
|
|
|
|
|
g_source_remove(context->source);
|
|
|
|
avdtp_unref(context->session);
|
|
|
|
|
|
|
|
g_main_loop_unref(context->main_loop);
|
|
|
|
|
2013-11-27 18:43:01 +08:00
|
|
|
test_free(context->data);
|
2013-11-20 23:42:48 +08:00
|
|
|
g_free(context);
|
|
|
|
}
|
|
|
|
|
2013-11-21 17:18:32 +08:00
|
|
|
static gboolean sep_getcap_ind(struct avdtp *session,
|
|
|
|
struct avdtp_local_sep *sep,
|
|
|
|
gboolean get_all, GSList **caps,
|
|
|
|
uint8_t *err, void *user_data)
|
|
|
|
{
|
|
|
|
struct avdtp_service_capability *media_transport, *media_codec;
|
|
|
|
struct avdtp_media_codec_capability *codec_caps;
|
|
|
|
uint8_t cap[4] = { 0xff, 0xff, 2, 64 };
|
|
|
|
|
|
|
|
*caps = NULL;
|
|
|
|
|
|
|
|
media_transport = avdtp_service_cap_new(AVDTP_MEDIA_TRANSPORT,
|
|
|
|
NULL, 0);
|
|
|
|
|
|
|
|
*caps = g_slist_append(*caps, media_transport);
|
|
|
|
|
|
|
|
codec_caps = g_malloc0(sizeof(*codec_caps) + sizeof(cap));
|
|
|
|
codec_caps->media_type = AVDTP_MEDIA_TYPE_AUDIO;
|
|
|
|
codec_caps->media_codec_type = 0x00;
|
|
|
|
memcpy(codec_caps->data, cap, sizeof(cap));
|
|
|
|
|
|
|
|
media_codec = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, codec_caps,
|
|
|
|
sizeof(*codec_caps) + sizeof(cap));
|
|
|
|
|
|
|
|
*caps = g_slist_append(*caps, media_codec);
|
|
|
|
g_free(codec_caps);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2013-11-24 21:35:52 +08:00
|
|
|
static gboolean sep_open_ind(struct avdtp *session, struct avdtp_local_sep *sep,
|
|
|
|
struct avdtp_stream *stream, uint8_t *err,
|
|
|
|
void *user_data)
|
|
|
|
{
|
|
|
|
struct context *context = user_data;
|
|
|
|
|
|
|
|
context->pending_open = TRUE;
|
|
|
|
context->stream = stream;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2013-11-21 17:18:32 +08:00
|
|
|
static struct avdtp_sep_ind sep_ind = {
|
|
|
|
.get_capability = sep_getcap_ind,
|
2013-11-24 21:35:52 +08:00
|
|
|
.open = sep_open_ind,
|
2013-11-21 17:18:32 +08:00
|
|
|
};
|
|
|
|
|
2013-11-21 21:30:38 +08:00
|
|
|
static void sep_setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
|
|
|
|
struct avdtp_stream *stream,
|
|
|
|
struct avdtp_error *err, void *user_data)
|
|
|
|
{
|
2013-11-21 23:37:03 +08:00
|
|
|
struct context *context = user_data;
|
2013-11-21 21:30:38 +08:00
|
|
|
int ret;
|
|
|
|
|
2013-11-28 23:19:09 +08:00
|
|
|
if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-07-C")) {
|
|
|
|
g_assert(err != NULL);
|
|
|
|
g_assert_cmpint(avdtp_error_error_code(err), ==, 0x13);
|
|
|
|
context_quit(context);
|
2013-11-21 23:37:03 +08:00
|
|
|
return;
|
2013-11-28 23:19:09 +08:00
|
|
|
}
|
2013-11-21 23:37:03 +08:00
|
|
|
|
2013-11-28 23:19:09 +08:00
|
|
|
g_assert(err == NULL);
|
2013-11-21 23:37:03 +08:00
|
|
|
|
2013-11-24 21:35:52 +08:00
|
|
|
if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-11-C"))
|
2013-11-21 23:37:03 +08:00
|
|
|
ret = avdtp_get_configuration(session, stream);
|
2013-11-28 23:19:09 +08:00
|
|
|
else if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-23-C"))
|
2013-11-25 19:15:55 +08:00
|
|
|
ret = avdtp_abort(session, stream);
|
2013-11-24 21:35:52 +08:00
|
|
|
else
|
2013-11-25 17:56:33 +08:00
|
|
|
ret = avdtp_open(session, stream);
|
2013-11-21 23:37:03 +08:00
|
|
|
|
2013-11-21 21:30:38 +08:00
|
|
|
g_assert_cmpint(ret, ==, 0);
|
|
|
|
}
|
|
|
|
|
2013-11-24 20:33:03 +08:00
|
|
|
static void sep_open_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
|
|
|
|
struct avdtp_stream *stream, struct avdtp_error *err,
|
|
|
|
void *user_data)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
g_assert(err == NULL);
|
|
|
|
|
2013-11-24 21:35:52 +08:00
|
|
|
g_assert(transport_open(stream));
|
2013-11-24 20:33:03 +08:00
|
|
|
|
|
|
|
ret = avdtp_start(session, stream);
|
|
|
|
g_assert_cmpint(ret, ==, 0);
|
|
|
|
}
|
|
|
|
|
2013-11-25 17:56:33 +08:00
|
|
|
static void sep_start_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
|
|
|
|
struct avdtp_stream *stream, struct avdtp_error *err,
|
|
|
|
void *user_data)
|
|
|
|
{
|
2013-11-25 18:17:28 +08:00
|
|
|
struct context *context = user_data;
|
2013-11-25 17:56:33 +08:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
g_assert(err == NULL);
|
|
|
|
|
2013-11-25 18:17:28 +08:00
|
|
|
if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-19-C"))
|
|
|
|
ret = avdtp_close(session, stream, FALSE);
|
|
|
|
else
|
|
|
|
ret = avdtp_suspend(session, stream);
|
2013-11-25 17:56:33 +08:00
|
|
|
|
|
|
|
g_assert_cmpint(ret, ==, 0);
|
|
|
|
}
|
|
|
|
|
2013-11-21 21:30:38 +08:00
|
|
|
static struct avdtp_sep_cfm sep_cfm = {
|
|
|
|
.set_configuration = sep_setconf_cfm,
|
2013-11-24 20:33:03 +08:00
|
|
|
.open = sep_open_cfm,
|
2013-11-25 17:56:33 +08:00
|
|
|
.start = sep_start_cfm,
|
2013-11-21 21:30:38 +08:00
|
|
|
};
|
|
|
|
|
2013-11-25 19:49:53 +08:00
|
|
|
static void test_server(gconstpointer data)
|
|
|
|
{
|
2013-11-24 21:35:52 +08:00
|
|
|
struct context *context = create_context(0x0100, data);
|
2013-11-21 17:18:32 +08:00
|
|
|
struct avdtp_local_sep *sep;
|
2013-11-25 19:49:53 +08:00
|
|
|
|
2013-11-27 22:35:39 +08:00
|
|
|
sep = avdtp_register_sep(AVDTP_SEP_TYPE_SOURCE, AVDTP_MEDIA_TYPE_AUDIO,
|
|
|
|
0x00, FALSE, &sep_ind, NULL, context);
|
|
|
|
|
|
|
|
g_idle_add(send_pdu, context);
|
|
|
|
|
|
|
|
execute_context(context);
|
|
|
|
|
|
|
|
avdtp_unregister_sep(sep);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_server_1_3(gconstpointer data)
|
|
|
|
{
|
|
|
|
struct context *context = create_context(0x0103, data);
|
|
|
|
struct avdtp_local_sep *sep;
|
|
|
|
|
2013-11-21 17:18:32 +08:00
|
|
|
sep = avdtp_register_sep(AVDTP_SEP_TYPE_SOURCE, AVDTP_MEDIA_TYPE_AUDIO,
|
2013-11-24 21:35:52 +08:00
|
|
|
0x00, TRUE, &sep_ind, NULL, context);
|
2013-11-25 19:49:53 +08:00
|
|
|
|
|
|
|
g_idle_add(send_pdu, context);
|
|
|
|
|
|
|
|
execute_context(context);
|
|
|
|
|
2013-11-21 17:18:32 +08:00
|
|
|
avdtp_unregister_sep(sep);
|
2013-11-25 19:49:53 +08:00
|
|
|
}
|
|
|
|
|
2013-11-28 21:41:50 +08:00
|
|
|
static void test_server_0_sep(gconstpointer data)
|
|
|
|
{
|
|
|
|
struct context *context = create_context(0x0100, data);
|
|
|
|
|
|
|
|
g_idle_add(send_pdu, context);
|
|
|
|
|
|
|
|
execute_context(context);
|
|
|
|
}
|
|
|
|
|
2013-11-20 23:42:48 +08:00
|
|
|
static void discover_cb(struct avdtp *session, GSList *seps,
|
|
|
|
struct avdtp_error *err, void *user_data)
|
|
|
|
{
|
2013-11-21 21:06:48 +08:00
|
|
|
struct context *context = user_data;
|
|
|
|
struct avdtp_stream *stream;
|
|
|
|
struct avdtp_remote_sep *rsep;
|
|
|
|
struct avdtp_service_capability *media_transport, *media_codec;
|
|
|
|
struct avdtp_media_codec_capability *cap;
|
|
|
|
GSList *caps;
|
|
|
|
uint8_t data[4] = { 0x21, 0x02, 2, 32 };
|
|
|
|
int ret;
|
|
|
|
|
2013-11-25 18:17:28 +08:00
|
|
|
if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-05-C") ||
|
2013-11-27 22:25:06 +08:00
|
|
|
g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-07-C") ||
|
|
|
|
g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-25-C"))
|
2013-11-21 21:06:48 +08:00
|
|
|
return;
|
|
|
|
|
2013-11-28 20:24:22 +08:00
|
|
|
if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-01-C")) {
|
|
|
|
g_assert(err != NULL);
|
|
|
|
g_assert_cmpint(avdtp_error_error_code(err), ==, 0x01);
|
|
|
|
context_quit(context);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-11-28 21:58:59 +08:00
|
|
|
if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-04-C")) {
|
|
|
|
g_assert(err != NULL);
|
|
|
|
g_assert_cmpint(avdtp_error_error_code(err), ==, 0x11);
|
|
|
|
context_quit(context);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-11-21 21:06:48 +08:00
|
|
|
g_assert(err == NULL);
|
|
|
|
g_assert_cmpint(g_slist_length(seps), !=, 0);
|
|
|
|
|
|
|
|
rsep = avdtp_find_remote_sep(session, context->sep);
|
|
|
|
g_assert(rsep != NULL);
|
|
|
|
|
|
|
|
media_transport = avdtp_service_cap_new(AVDTP_MEDIA_TRANSPORT,
|
|
|
|
NULL, 0);
|
|
|
|
|
|
|
|
caps = g_slist_append(NULL, media_transport);
|
|
|
|
|
|
|
|
cap = g_malloc0(sizeof(*cap) + sizeof(data));
|
|
|
|
cap->media_type = AVDTP_MEDIA_TYPE_AUDIO;
|
|
|
|
cap->media_codec_type = 0x00;
|
|
|
|
memcpy(cap->data, data, sizeof(data));
|
2013-11-21 17:18:32 +08:00
|
|
|
|
2013-11-21 21:06:48 +08:00
|
|
|
media_codec = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, cap,
|
|
|
|
sizeof(*cap) + sizeof(data));
|
|
|
|
|
|
|
|
caps = g_slist_append(caps, media_codec);
|
|
|
|
g_free(cap);
|
|
|
|
|
|
|
|
ret = avdtp_set_configuration(session, rsep, context->sep, caps,
|
|
|
|
&stream);
|
|
|
|
g_assert_cmpint(ret, ==, 0);
|
|
|
|
|
|
|
|
g_slist_free_full(caps, g_free);
|
2013-11-20 23:42:48 +08:00
|
|
|
}
|
|
|
|
|
2013-11-25 18:17:28 +08:00
|
|
|
static void test_client(gconstpointer data)
|
2013-11-25 17:56:33 +08:00
|
|
|
{
|
|
|
|
struct context *context = create_context(0x0100, data);
|
|
|
|
struct avdtp_local_sep *sep;
|
|
|
|
|
|
|
|
sep = avdtp_register_sep(AVDTP_SEP_TYPE_SINK, AVDTP_MEDIA_TYPE_AUDIO,
|
|
|
|
0x00, FALSE, NULL, &sep_cfm,
|
|
|
|
context);
|
|
|
|
context->sep = sep;
|
|
|
|
|
|
|
|
avdtp_discover(context->session, discover_cb, context);
|
|
|
|
|
|
|
|
execute_context(context);
|
|
|
|
|
|
|
|
avdtp_unregister_sep(sep);
|
|
|
|
}
|
|
|
|
|
2013-11-27 22:25:06 +08:00
|
|
|
static void test_client_1_3(gconstpointer data)
|
|
|
|
{
|
|
|
|
struct context *context = create_context(0x0103, data);
|
|
|
|
struct avdtp_local_sep *sep;
|
|
|
|
|
|
|
|
sep = avdtp_register_sep(AVDTP_SEP_TYPE_SINK, AVDTP_MEDIA_TYPE_AUDIO,
|
|
|
|
0x00, TRUE, NULL, &sep_cfm,
|
|
|
|
context);
|
|
|
|
context->sep = sep;
|
|
|
|
|
|
|
|
avdtp_discover(context->session, discover_cb, context);
|
|
|
|
|
|
|
|
execute_context(context);
|
|
|
|
|
|
|
|
avdtp_unregister_sep(sep);
|
|
|
|
}
|
|
|
|
|
2013-11-20 23:42:48 +08:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
g_test_init(&argc, &argv, NULL);
|
|
|
|
|
|
|
|
if (g_test_verbose())
|
|
|
|
__btd_log_init("*", 0);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Stream Management Service
|
|
|
|
*
|
|
|
|
* To verify that the following procedures are implemented according to
|
|
|
|
* their specification in AVDTP.
|
|
|
|
*/
|
2013-11-25 18:17:28 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-05-C", test_client,
|
2013-11-20 23:42:48 +08:00
|
|
|
raw_pdu(0x00, 0x01));
|
2013-11-25 19:49:53 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-06-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00));
|
2013-11-25 18:17:28 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-07-C", test_client,
|
2013-11-21 17:15:01 +08:00
|
|
|
raw_pdu(0x10, 0x01),
|
|
|
|
raw_pdu(0x12, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x20, 0x02, 0x04));
|
2013-11-21 17:18:32 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-08-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x04),
|
|
|
|
raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40));
|
2013-11-25 18:17:28 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-09-C", test_client,
|
2013-11-21 21:06:48 +08:00
|
|
|
raw_pdu(0x30, 0x01),
|
|
|
|
raw_pdu(0x32, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x40, 0x02, 0x04),
|
|
|
|
raw_pdu(0x42, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x50, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20));
|
2013-11-21 21:07:38 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-10-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x04),
|
|
|
|
raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x22, 0x03));
|
2013-11-25 18:17:28 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-11-C", test_client,
|
2013-11-21 21:30:38 +08:00
|
|
|
raw_pdu(0x60, 0x01),
|
|
|
|
raw_pdu(0x62, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x70, 0x02, 0x04),
|
|
|
|
raw_pdu(0x72, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x80, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x82, 0x03),
|
|
|
|
raw_pdu(0x90, 0x04, 0x04));
|
2013-11-21 21:38:41 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-12-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x04),
|
|
|
|
raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x22, 0x03),
|
|
|
|
raw_pdu(0x30, 0x04, 0x04),
|
|
|
|
raw_pdu(0x32, 0x04, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0x21, 0x02, 0x02, 0x20));
|
2013-11-25 18:17:28 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-15-C", test_client,
|
2013-11-21 23:37:03 +08:00
|
|
|
raw_pdu(0xa0, 0x01),
|
|
|
|
raw_pdu(0xa2, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0xb0, 0x02, 0x04),
|
|
|
|
raw_pdu(0xb2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0xc0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0xc2, 0x03),
|
|
|
|
raw_pdu(0xd0, 0x06, 0x04));
|
2013-11-21 23:44:45 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-16-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x04),
|
|
|
|
raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x22, 0x03),
|
|
|
|
raw_pdu(0x30, 0x06, 0x04),
|
|
|
|
raw_pdu(0x32, 0x06));
|
2013-11-25 18:17:28 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-17-C", test_client,
|
2013-11-24 20:33:03 +08:00
|
|
|
raw_pdu(0xe0, 0x01),
|
|
|
|
raw_pdu(0xe2, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0xf0, 0x02, 0x04),
|
|
|
|
raw_pdu(0xf2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x00, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x02, 0x03),
|
|
|
|
raw_pdu(0x10, 0x06, 0x04),
|
|
|
|
raw_pdu(0x12, 0x06),
|
|
|
|
raw_pdu(0x20, 0x07, 0x04));
|
2013-11-24 21:35:52 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-18-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x04),
|
|
|
|
raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x22, 0x03),
|
|
|
|
raw_pdu(0x30, 0x06, 0x04),
|
|
|
|
raw_pdu(0x32, 0x06),
|
|
|
|
raw_pdu(0x40, 0x07, 0x04),
|
|
|
|
raw_pdu(0x42, 0x07));
|
2013-11-25 18:17:28 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-19-C", test_client,
|
2013-11-25 17:56:33 +08:00
|
|
|
raw_pdu(0x30, 0x01),
|
|
|
|
raw_pdu(0x32, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x40, 0x02, 0x04),
|
|
|
|
raw_pdu(0x42, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x50, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x52, 0x03),
|
|
|
|
raw_pdu(0x60, 0x06, 0x04),
|
|
|
|
raw_pdu(0x62, 0x06),
|
|
|
|
raw_pdu(0x70, 0x07, 0x04),
|
|
|
|
raw_pdu(0x72, 0x07),
|
|
|
|
raw_pdu(0x80, 0x08, 0x04));
|
2013-11-25 17:58:08 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-20-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x04),
|
|
|
|
raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x22, 0x03),
|
|
|
|
raw_pdu(0x30, 0x06, 0x04),
|
|
|
|
raw_pdu(0x32, 0x06),
|
|
|
|
raw_pdu(0x40, 0x07, 0x04),
|
|
|
|
raw_pdu(0x42, 0x07),
|
|
|
|
raw_pdu(0x50, 0x08, 0x04),
|
|
|
|
raw_pdu(0x52, 0x08));
|
2013-11-25 18:17:28 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-21-C", test_client,
|
|
|
|
raw_pdu(0x90, 0x01),
|
|
|
|
raw_pdu(0x92, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0xa0, 0x02, 0x04),
|
|
|
|
raw_pdu(0xa2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0xb0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0xb2, 0x03),
|
|
|
|
raw_pdu(0xc0, 0x06, 0x04),
|
|
|
|
raw_pdu(0xc2, 0x06),
|
|
|
|
raw_pdu(0xd0, 0x07, 0x04),
|
|
|
|
raw_pdu(0xd2, 0x07),
|
|
|
|
raw_pdu(0xe0, 0x09, 0x04));
|
2013-11-25 18:20:16 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-22-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x04),
|
|
|
|
raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x22, 0x03),
|
|
|
|
raw_pdu(0x30, 0x06, 0x04),
|
|
|
|
raw_pdu(0x32, 0x06),
|
|
|
|
raw_pdu(0x40, 0x07, 0x04),
|
|
|
|
raw_pdu(0x42, 0x07),
|
|
|
|
raw_pdu(0x50, 0x09, 0x04),
|
|
|
|
raw_pdu(0x52, 0x09));
|
2013-11-25 19:15:55 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-23-C", test_client,
|
|
|
|
raw_pdu(0xf0, 0x01),
|
|
|
|
raw_pdu(0xf2, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x00, 0x02, 0x04),
|
|
|
|
raw_pdu(0x02, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x10, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x12, 0x03),
|
|
|
|
raw_pdu(0x20, 0x0a, 0x04));
|
2013-11-25 19:23:18 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-24-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x04),
|
|
|
|
raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x22, 0x03),
|
|
|
|
raw_pdu(0x30, 0x0a, 0x04),
|
|
|
|
raw_pdu(0x32, 0x0a));
|
2013-11-27 22:25:06 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-25-C", test_client_1_3,
|
|
|
|
raw_pdu(0x30, 0x01),
|
|
|
|
raw_pdu(0x32, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x40, 0x0c, 0x04));
|
2013-11-27 22:35:39 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-26-C", test_server_1_3,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x0c, 0x04),
|
|
|
|
raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40));
|
2013-11-28 17:29:37 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-27-C", test_server_1_3,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x04),
|
|
|
|
raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40));
|
2013-11-28 17:50:50 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-28-C", test_client_1_3,
|
|
|
|
raw_pdu(0x50, 0x01),
|
|
|
|
raw_pdu(0x52, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x60, 0x0c, 0x04),
|
|
|
|
raw_pdu(0x62, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40, 0x0f, 0x00),
|
|
|
|
raw_pdu(0x70, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20));
|
2013-11-28 18:29:27 +08:00
|
|
|
define_test("/TP/SIG/SMG/BV-31-C", test_client_1_3,
|
|
|
|
raw_pdu(0x80, 0x01),
|
|
|
|
raw_pdu(0x82, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x90, 0x0c, 0x04),
|
|
|
|
raw_pdu(0x92, 0x0c, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00,
|
|
|
|
0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
|
|
|
|
raw_pdu(0xa0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
|
|
|
|
0x00));
|
2013-11-28 20:24:22 +08:00
|
|
|
define_test("/TP/SIG/SMG/BI-01-C", test_client,
|
|
|
|
raw_pdu(0xb0, 0x01),
|
|
|
|
raw_pdu(0xb3, 0x01, 0x01));
|
2013-11-28 21:28:54 +08:00
|
|
|
define_test("/TP/SIG/SMG/BI-02-C", test_server,
|
|
|
|
raw_pdu(0x01, 0x01));
|
2013-11-28 21:41:50 +08:00
|
|
|
define_test("/TP/SIG/SMG/BI-03-C", test_server_0_sep,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x03, 0x01, 0x19));
|
2013-11-28 21:58:59 +08:00
|
|
|
define_test("/TP/SIG/SMG/BI-04-C", test_client,
|
|
|
|
raw_pdu(0xc0, 0x01),
|
|
|
|
raw_pdu(0xc2, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0xd0, 0x02, 0x04),
|
|
|
|
raw_pdu(0xd3, 0x02, 0x11));
|
2013-11-28 22:14:48 +08:00
|
|
|
define_test("/TP/SIG/SMG/BI-05-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02),
|
|
|
|
raw_pdu(0x13, 0x02, 0x11));
|
2013-11-28 22:36:25 +08:00
|
|
|
define_test("/TP/SIG/SMG/BI-06-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x00),
|
|
|
|
raw_pdu(0x13, 0x02, 0x12));
|
2013-11-28 23:19:09 +08:00
|
|
|
define_test("/TP/SIG/SMG/BI-07-C", test_client,
|
|
|
|
raw_pdu(0xe0, 0x01),
|
|
|
|
raw_pdu(0xe2, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0xf0, 0x02, 0x04),
|
|
|
|
raw_pdu(0xf2, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x00, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x03, 0x03, 0x00, 0x13));
|
2013-11-28 23:26:41 +08:00
|
|
|
define_test("/TP/SIG/SMG/BI-08-C", test_server,
|
|
|
|
raw_pdu(0x00, 0x01),
|
|
|
|
raw_pdu(0x02, 0x01, 0x04, 0x00),
|
|
|
|
raw_pdu(0x10, 0x02, 0x04),
|
|
|
|
raw_pdu(0x12, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
|
|
|
|
0xff, 0xff, 0x02, 0x40),
|
|
|
|
raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x22, 0x03),
|
|
|
|
raw_pdu(0x30, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
|
|
|
|
0x00, 0x00, 0x21, 0x02, 0x02, 0x20),
|
|
|
|
raw_pdu(0x33, 0x03, 0x00, 0x13));
|
2013-11-20 23:42:48 +08:00
|
|
|
|
|
|
|
return g_test_run();
|
|
|
|
}
|