mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-10 06:44:32 +00:00
test/avdtp: partial fix for cmake build
This commit is contained in:
parent
8f4649e3ba
commit
db6cafabbb
@ -1,6 +1,9 @@
|
||||
cmake_minimum_required (VERSION 3.5)
|
||||
project(test-hfp)
|
||||
|
||||
# pkgconfig required to link cpputest
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
# libusb
|
||||
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
|
||||
include_directories(${LIBUSB_INCLUDE_DIRS})
|
||||
@ -14,18 +17,19 @@ link_directories(${CPPUTEST_LIBRARY_DIRS})
|
||||
link_libraries(${CPPUTEST_LIBRARIES})
|
||||
|
||||
include_directories(.)
|
||||
include_directories(..)
|
||||
include_directories(../../3rd-party/micro-ecc)
|
||||
include_directories(../../3rd-party/bluedroid/decoder/include)
|
||||
include_directories(../../3rd-party/bluedroid/encoder/include)
|
||||
include_directories(../../3rd-party/md5)
|
||||
include_directories(../../3rd-party/hxcmod-player)
|
||||
include_directories(../../3rd-party/hxcmod-player/mod)
|
||||
include_directories(../../3rd-party/lc3-google/include)
|
||||
include_directories(../../3rd-party/rijndael)
|
||||
include_directories(../../3rd-party/yxml)
|
||||
include_directories(../../3rd-party/tinydir)
|
||||
include_directories(../../src)
|
||||
include_directories(../../chipset/zephyr)
|
||||
include_directories(../../chipset/realtek)
|
||||
include_directories(../../platform/posix)
|
||||
include_directories(../../platform/embedded)
|
||||
include_directories(../../port/libusb)
|
||||
@ -42,6 +46,9 @@ file(GLOB SOURCES_HXCMOD "../../3rd-party/hxcmod-player/*.c" "../../3rd-part
|
||||
file(GLOB SOURCES_RIJNDAEL "../../3rd-party/rijndael/rijndael.c")
|
||||
file(GLOB SOURCES_POSIX "../../platform/posix/*.c")
|
||||
file(GLOB SOURCES_LIBUSB "../../port/libusb/*.c" "../../platform/libusb/*.c")
|
||||
file(GLOB SOURCES_ZEPHYR "../../chipset/zephyr/*.c")
|
||||
file(GLOB SOURCES_REALTEK "../../chipset/realtek/*.c")
|
||||
file(GLOB SOURCES_LC3_GOOGLE "../../3rd-party/lc3-google/src/*.c")
|
||||
|
||||
file(GLOB SOURCES_BLE_OFF "../../src/ble/le_device_db_memory.c")
|
||||
list(REMOVE_ITEM SOURCES_BLE ${SOURCES_BLE_OFF})
|
||||
@ -62,7 +69,9 @@ set(SOURCES
|
||||
${SOURCES_CLASSIC}
|
||||
${SOURCES_UECC}
|
||||
${SOURCES_HXCMOD}
|
||||
${SOURCES_REALTEK}
|
||||
${SOURCES_ZEPHYR}
|
||||
${SOURCES_LC3_GOOGLE}
|
||||
)
|
||||
list(SORT SOURCES)
|
||||
|
||||
@ -71,6 +80,16 @@ set_source_files_properties(../../src/classic/hfp_ag.c PROPERTIES LANGUAGE CXX )
|
||||
# create static lib
|
||||
add_library(btstack STATIC ${SOURCES})
|
||||
|
||||
# portaudio
|
||||
pkg_check_modules(PORTAUDIO portaudio-2.0)
|
||||
if(PORTAUDIO_FOUND)
|
||||
message("HAVE_PORTAUDIO")
|
||||
include_directories(${PORTAUDIO_INCLUDE_DIRS})
|
||||
link_directories(${PORTAUDIO_LIBRARY_DIRS})
|
||||
link_libraries(${PORTAUDIO_LIBRARIES})
|
||||
add_compile_definitions(HAVE_PORTAUDIO)
|
||||
endif()
|
||||
|
||||
# create targets for all examples
|
||||
file(GLOB EXAMPLES_C "*.c")
|
||||
list(SORT EXAMPLES_C)
|
||||
|
@ -67,7 +67,7 @@ static uint8_t ring_buffer_storage[3*FRAMES_PER_BUFFER*BYTES_PER_FRAME];
|
||||
static btstack_ring_buffer_t ring_buffer;
|
||||
|
||||
static int total_num_samples = 0;
|
||||
static char * wav_filename = "portaudio_sine.wav";
|
||||
static const char * wav_filename = "portaudio_sine.wav";
|
||||
|
||||
static void write_wav_data(int16_t * data, int num_frames, int num_channels, int sample_rate){
|
||||
(void)sample_rate;
|
||||
@ -112,7 +112,7 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
|
||||
int bytes_per_buffer = framesPerBuffer * BYTES_PER_FRAME;
|
||||
|
||||
if (btstack_ring_buffer_bytes_available(&ring_buffer) >= bytes_per_buffer){
|
||||
btstack_ring_buffer_read(&ring_buffer, outputBuffer, bytes_per_buffer, &bytes_read);
|
||||
btstack_ring_buffer_read(&ring_buffer, (uint8_t *) outputBuffer, bytes_per_buffer, &bytes_read);
|
||||
} else {
|
||||
printf("NOT ENOUGH DATA!\n");
|
||||
memset(outputBuffer, 0, bytes_per_buffer);
|
||||
|
@ -41,9 +41,9 @@
|
||||
#include <string.h>
|
||||
#include <portaudio.h>
|
||||
|
||||
#include "btstack_sbc.h"
|
||||
#include "avdtp.h"
|
||||
#include "avdtp_source.h"
|
||||
#include "classic/btstack_sbc.h"
|
||||
#include "classic/avdtp.h"
|
||||
#include "classic/avdtp_source.h"
|
||||
#include "btstack_stdin.h"
|
||||
|
||||
#define NUM_CHANNELS 2
|
||||
|
@ -42,10 +42,10 @@
|
||||
#include <portaudio.h>
|
||||
|
||||
#include "btstack_ring_buffer.h"
|
||||
#include "btstack_sbc.h"
|
||||
#include "classic/btstack_sbc.h"
|
||||
#include "wav_util.h"
|
||||
#include "avdtp.h"
|
||||
#include "avdtp_source.h"
|
||||
#include "classic/avdtp.h"
|
||||
#include "classic/avdtp_source.h"
|
||||
#include "btstack_stdin.h"
|
||||
|
||||
#define NUM_CHANNELS 2
|
||||
@ -68,7 +68,7 @@ static uint32_t fill_audio_ring_buffer_timeout = 50; //ms
|
||||
static paTestData sin_data;
|
||||
// static int total_num_samples = 0;
|
||||
|
||||
static char * output_wav_filename = "test_output_ring_sine.wav";
|
||||
static const char * output_wav_filename = "test_output_ring_sine.wav";
|
||||
// static char * input_wav_filename = "test_input_sine.wav";
|
||||
|
||||
static btstack_sbc_decoder_state_t state;
|
||||
|
Loading…
x
Reference in New Issue
Block a user