diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-12-21 11:32:51 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-12-21 12:49:57 -0800 |
commit | 32a006f92a0f3cd3ce95d4df61e887e0d702a151 (patch) | |
tree | 7896cb5ac2fa4148f1b6cbb5e1b395cebe9d8afe /unit | |
parent | b6061ea5b82fd0aa7dbf033fe40fc1235ec0f987 (diff) | |
download | bluez-32a006f92a0f3cd3ce95d4df61e887e0d702a151.tar.gz |
test-hog: Add monitor support
This adds monitor support so data can properly be decoded by the likes
of btmon:
= test-hog: /TP/HGRF/RH/BV-01-I - init
= test-hog: /TP/HGRF/RH/BV-01-I - setup
= test-hog: /TP/HGRF/RH/BV-01-I - setup complete
= test-hog: /TP/HGRF/RH/BV-01-I - run
> test-hog: User Data RX
ATT: Read By Group Type Request (0x10) len 6
Handle range: 0x0001-0xffff
Attribute group type: Primary Service (0x2800)
Diffstat (limited to 'unit')
-rw-r--r-- | unit/test-hog.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/unit/test-hog.c b/unit/test-hog.c index bc23b58ff..116a5cb07 100644 --- a/unit/test-hog.c +++ b/unit/test-hog.c @@ -79,13 +79,6 @@ struct context { tester_add(name, &data, NULL, function, NULL); \ } while (0) -static void test_debug(const char *str, void *user_data) -{ - const char *prefix = user_data; - - tester_debug("%s%s", prefix, str); -} - static gboolean context_quit(gpointer user_data) { struct context *context = user_data; @@ -117,7 +110,7 @@ static gboolean send_pdu(gpointer user_data) len = write(context->fd, pdu->data, pdu->size); - util_hexdump('<', pdu->data, len, test_debug, "hog: "); + tester_monitor('<', 0x0004, 0x0000, pdu->data, len); g_assert_cmpint(len, ==, pdu->size); @@ -152,7 +145,7 @@ static gboolean test_handler(GIOChannel *channel, GIOCondition cond, g_assert(len > 0); - util_hexdump('>', buf, len, test_debug, "hog: "); + tester_monitor('>', 0x0004, 0x0000, buf, len); g_assert_cmpint(len, ==, pdu->size); |