diff --git a/unit/test-eir.c b/unit/test-eir.c
index 8fc7af8..4d557a8 100644
--- a/unit/test-eir.c
+++ b/unit/test-eir.c
#include "lib/hci.h"
#include "lib/sdp.h"
#include "src/shared/tester.h"
+#include "src/shared/util.h"
#include "src/eir.h"
struct test_data {
tester_test_passed();
}
+static void print_debug(const char *str, void *user_data)
+{
+ char *prefix = user_data;
+
+ tester_debug("%s%s", prefix, str);
+}
+
static void test_parsing(gconstpointer data)
{
const struct test_data *test = data;
g_assert(eir.services == NULL);
}
+ for (list = eir.msd_list; list; list = list->next) {
+ struct eir_msd *msd = list->data;
+
+ tester_debug("Manufacturer ID: 0x%04x", msd->company);
+ util_hexdump(' ', msd->data, msd->data_len, print_debug,
+ "Manufacturer Data:");
+ }
+
eir_data_free(&eir);
tester_test_passed();
}
+static const unsigned char gigaset_gtag_data[] = {
+ 0x02, 0x01, 0x06, 0x0d, 0xff, 0x80, 0x01, 0x02,
+ 0x15, 0x12, 0x34, 0x80, 0x91, 0xd0, 0xf2, 0xbb,
+ 0xc5, 0x03, 0x02, 0x0f, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static const char *gigaset_gtag_uuid[] = {
+ "0000180f-0000-1000-8000-00805f9b34fb",
+ NULL
+};
+
+static const struct test_data gigaset_gtag_test = {
+ .eir_data = gigaset_gtag_data,
+ .eir_size = sizeof(gigaset_gtag_data),
+ .flags = 0x06,
+ .tx_power = 127,
+ .uuid = gigaset_gtag_uuid,
+};
+
int main(int argc, char *argv[])
{
tester_init(&argc, &argv);
tester_add("/ad/citizen1", &citizen_adv_test, NULL, test_parsing, NULL);
tester_add("/ad/citizen2", &citizen_scan_test, NULL, test_parsing,
NULL);
+ tester_add("ad/g-tag", &gigaset_gtag_test, NULL, test_parsing, NULL);
return tester_run();
}