test/hid_parser: prepare for console hci dump

This commit is contained in:
Matthias Ringwald 2023-11-13 17:18:53 +01:00
parent 14685fd34e
commit 6707c7a1ba
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.13)
project(hid_parser)
project(BTstack-test-hid_parser)
set (BTSTACK_ROOT ${CMAKE_SOURCE_DIR}/../../)
@ -9,7 +9,7 @@ include_directories(../../3rd-party/rijndael)
include_directories(../../platform/embedded)
include_directories(../../platform/posix)
include_directories(../../src)
include_directories(..)
include_directories(.)
# Enable ASAN
add_compile_options( -g -fsanitize=address)
@ -30,6 +30,7 @@ add_executable(hid_parser_test
${BTSTACK_ROOT}/src/btstack_hid_parser.c
${BTSTACK_ROOT}/src/hci_dump.c
${BTSTACK_ROOT}/platform/posix/hci_dump_posix_fs.c
${BTSTACK_ROOT}/platform/posix/hci_dump_posix_stdout.c
)

View File

@ -16,6 +16,7 @@
#include "btstack_hid_parser.h"
#include "hci_dump_posix_fs.h"
#include "hci_dump_posix_stdout.h"
const uint8_t mouse_descriptor_without_report_id[] = {
0x05, 0x01, /* Usage Page (Desktop), */
@ -413,11 +414,14 @@ TEST(HID, GetReportSize){
int main (int argc, const char * argv[]){
#if 1
// log into file using HCI_DUMP_PACKETLOGGER format
const char * pklg_path = "hci_dump.pklg";
hci_dump_posix_fs_open(pklg_path, HCI_DUMP_PACKETLOGGER);
hci_dump_init(hci_dump_posix_fs_get_instance());
printf("Packet Log: %s\n", pklg_path);
#else
hci_dump_init(hci_dump_posix_stdout_get_instance());
#endif
return CommandLineTestRunner::RunAllTests(argc, argv);
}