move avdtp_source_test to pts

This commit is contained in:
Milanka Ringwald 2017-04-04 11:28:51 +02:00
parent 6959beff72
commit 6501960148
5 changed files with 41 additions and 19 deletions

View File

@ -397,7 +397,10 @@ void avdtp_source_stream_data_stop(uint16_t con_handle){
log_error("no stream_endpoint found");
return;
}
if (stream_endpoint->state != AVDTP_STREAM_ENDPOINT_STREAMING) return;
if (stream_endpoint->state != AVDTP_STREAM_ENDPOINT_STREAMING) {
printf("stream_endpoint in wrong state %d\n", stream_endpoint->state);
return;
}
// TODO: initialize randomly sequence number
stream_endpoint->sequence_number = 0;
test_fill_audio_ring_buffer_timer_stop(stream_endpoint);

View File

@ -1,4 +1,4 @@
avdtp_source_test
avdtp_source_demo
avdtp_sink_test
portaudio_test
sine_encode_decode_test

View File

@ -71,7 +71,7 @@ AVDTP_SINK += \
avdtp_sink.c \
btstack_ring_buffer.c \
AVDTP_TESTS = avdtp_source_test avdtp_sink_test portaudio_test sine_encode_decode_ring_buffer_test sine_encode_decode_test sine_encode_decode_performance_test
AVDTP_TESTS = avdtp_source_demo avdtp_sink_test portaudio_test sine_encode_decode_ring_buffer_test sine_encode_decode_test sine_encode_decode_performance_test
CORE_OBJ = $(CORE:.c=.o)
COMMON_OBJ = $(COMMON:.c=.o)
@ -84,7 +84,7 @@ all: ${AVDTP_TESTS}
avdtp_sink_test: ${CORE_OBJ} ${COMMON_OBJ} ${SBC_DECODER_OBJ} ${SBC_ENCODER_OBJ} ${AVDTP_SINK_OBJ} avdtp_sink_test.o
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
avdtp_source_test: ${CORE_OBJ} ${COMMON_OBJ} ${SBC_DECODER_OBJ} ${SBC_ENCODER_OBJ} ${AVDTP_SINK_OBJ} avdtp_source_test.o
avdtp_source_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SBC_DECODER_OBJ} ${SBC_ENCODER_OBJ} ${AVDTP_SINK_OBJ} avdtp_source_demo.o
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
portaudio_test: btstack_util.o hci_dump.o wav_util.o btstack_ring_buffer.o portaudio_test.c

View File

@ -1,6 +1,7 @@
# Makefile for libusb based PTS tests
BTSTACK_ROOT = ../..
CORE += \
btstack_memory.c \
btstack_linked_list.c \
@ -10,7 +11,6 @@ CORE += \
main.c \
stdin_support.c \
COMMON += \
hci.c \
hci_cmd.c \
@ -44,29 +44,46 @@ VPATH += ${BTSTACK_ROOT}/src/classic
VPATH += ${BTSTACK_ROOT}/platform/posix
VPATH += ${BTSTACK_ROOT}/platform/libusb
VPATH += ${BTSTACK_ROOT}/port/libusb
# VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce
# VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce
VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce
VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce
# use pkg-config for libusb
CFLAGS += $(shell pkg-config libusb-1.0 --cflags)
LDFLAGS += $(shell pkg-config libusb-1.0 --libs)
# hard coded flags for libusb in /usr/local/lib
# CFLAGS += -I/usr/local/include
# LDFLAGS += -L/usr/local/lib -lusb-1.0
# use pkg-config for portaudio
# CFLAGS += $(shell pkg-config portaudio-2.0 --cflags)
# LDFLAGS += $(shell pkg-config portaudio-2.0 --libs)
# hard coded flags for portaudio in /usr/local/lib
# CFLAGS += -I/usr/local/include
# LDFLAGS += -L/sw/lib -lportaudio -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,Carbon
CFLAGS += $(shell pkg-config portaudio-2.0 --cflags) -DHAVE_PORTAUDIO
LDFLAGS += $(shell pkg-config portaudio-2.0 --libs)
include ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc
include ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc
SBC_DECODER += \
${BTSTACK_ROOT}/src/classic/btstack_sbc_plc.c \
${BTSTACK_ROOT}/src/classic/btstack_sbc_bludroid.c \
SBC_ENCODER += \
${BTSTACK_ROOT}/src/classic/btstack_sbc_bludroid.c \
${BTSTACK_ROOT}/src/classic/hfp_msbc.c \
AVDTP_SINK += \
avdtp_util.c \
avdtp.c \
avdtp_initiator.c \
avdtp_acceptor.c \
avdtp_source.c \
avdtp_sink.c \
btstack_ring_buffer.c \
EXAMPLES = iopt ble_peripheral_test ble_central_test l2cap_test classic_test bnep_test hsp_ag_test hsp_hs_test sco_loopback le_data_channel
EXAMPLES = le_data_channel
EXAMPLES = avdtp_source_test le_data_channel
all: ${EXAMPLES}
# compile .gatt descriptions
avdtp_source_test: ${CORE_OBJ} ${COMMON_OBJ} ${SBC_DECODER_OBJ} ${SBC_ENCODER_OBJ} ${AVDTP_SINK_OBJ} avdtp_source_test.o
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
ble_peripheral_test.h: ble_peripheral_test.gatt
python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
ble_central_test.h: ble_central_test.gatt
@ -101,4 +118,6 @@ sco_loopback: ${CORE_OBJ} ${COMMON_OBJ} sco_loopback.c
iopt: ${CORE_OBJ} ${COMMON_OBJ} pan.o hsp_ag.o hsp_hs.o hfp_ag.o hfp_hf.o hfp_gsm_model.o iopt.c hfp.o ${SDP_CLIENT}
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
clean:
rm -rf *.pyc *.o $(AVDTP_TESTS) *.dSYM *_test *.wav *.sbc ${BTSTACK_ROOT}/port/libusb/*.o

View File

@ -112,7 +112,7 @@ static const char * avdtp_si_name[] = {
"AVDTP_SI_GET_CAPABILITIES",
"AVDTP_SI_SET_CONFIGURATION",
"AVDTP_SI_GET_CONFIGURATION",
"AVDTP_SI_RECONFIGURE,"
"AVDTP_SI_RECONFIGURE",
"AVDTP_SI_OPEN",
"AVDTP_SI_START",
"AVDTP_SI_CLOSE",