OSDN Git Service

unit: Add advertising data from Wahoo BlueSC for testing
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 9 Jan 2013 06:30:01 +0000 (22:30 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 9 Jan 2013 06:30:01 +0000 (22:30 -0800)
unit/test-eir.c

index e7c742c..be2282c 100644 (file)
@@ -153,7 +153,7 @@ static const unsigned char ipadmini_data[] = {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const struct test_data ipadmini_test = {
@@ -194,7 +194,7 @@ static const unsigned char fuelband_data[] = {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const struct test_data fuelband_test = {
@@ -205,6 +205,21 @@ static const struct test_data fuelband_test = {
        .name_complete = TRUE,
 };
 
+static const unsigned char bluesc_data[] = {
+               0x02, 0x01, 0x06, 0x03, 0x02, 0x16, 0x18, 0x12,
+               0x09, 0x57, 0x61, 0x68, 0x6f, 0x6f, 0x20, 0x42,
+               0x6c, 0x75, 0x65, 0x53, 0x43, 0x20, 0x76, 0x31,
+               0x2e, 0x34,
+};
+
+static const struct test_data bluesc_test = {
+       .eir_data = bluesc_data,
+       .eir_size = sizeof(bluesc_data),
+       .flags = 0x06,
+       .name = "Wahoo BlueSC v1.4",
+       .name_complete = TRUE,
+};
+
 static void test_basic(void)
 {
        struct eir_data data;
@@ -256,6 +271,7 @@ int main(int argc, char *argv[])
        g_test_add_data_func("/eir/iphone5", &iphone5_test, test_parsing);
        g_test_add_data_func("/eir/ipadmini", &ipadmini_test, test_parsing);
        g_test_add_data_func("/eir/fuelband", &fuelband_test, test_parsing);
+       g_test_add_data_func("/ad/bluesc", &bluesc_test, test_parsing);
 
        return g_test_run();
 }