mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-10 06:44:32 +00:00
pts: fix compile
This commit is contained in:
parent
3f2e561446
commit
a4f7d0a0d8
@ -28,7 +28,7 @@
|
||||
|
||||
// BTstack configuration. buffers, sizes, ...
|
||||
#define HCI_ACL_PAYLOAD_SIZE 1024
|
||||
#define HCI_INCOMING_PRE_BUFFER_SIZE 4
|
||||
#define HCI_INCOMING_PRE_BUFFER_SIZE 6
|
||||
|
||||
#define NVM_NUM_LINK_KEYS 2
|
||||
#define NVM_NUM_DEVICE_DB_ENTRIES 4
|
||||
|
@ -10,14 +10,17 @@ CORE += \
|
||||
btstack_util.c \
|
||||
main.c \
|
||||
btstack_stdin_posix.c \
|
||||
btstack_tlv.c \
|
||||
btstack_tlv_posix.c \
|
||||
|
||||
COMMON += \
|
||||
hci.c \
|
||||
ad_parser.c \
|
||||
hci_cmd.c \
|
||||
hci_dump.c \
|
||||
l2cap.c \
|
||||
l2cap_signaling.c \
|
||||
rfcomm.c \
|
||||
hci_transport_h2_libusb.c \
|
||||
btstack_run_loop_posix.c \
|
||||
btstack_link_key_db_fs.c \
|
||||
@ -26,9 +29,23 @@ COMMON += \
|
||||
sdp_util.c \
|
||||
sdp_server.c \
|
||||
sdp_client.c \
|
||||
sdp_client_rfcomm.c \
|
||||
sm.c \
|
||||
uECC.c \
|
||||
spp_server.c \
|
||||
|
||||
ATT += \
|
||||
att_dispatch.c \
|
||||
|
||||
GATT_SERVER += \
|
||||
att_db.c \
|
||||
att_server.c \
|
||||
|
||||
GATT_CLIENT += \
|
||||
gatt_client.c \
|
||||
|
||||
SM += \
|
||||
sm.c \
|
||||
|
||||
SBC_DECODER += \
|
||||
${BTSTACK_ROOT}/src/classic/btstack_sbc_plc.c \
|
||||
@ -39,35 +56,43 @@ SBC_ENCODER += \
|
||||
${BTSTACK_ROOT}/src/classic/hfp_msbc.c \
|
||||
|
||||
AVDTP += \
|
||||
avdtp_util.c \
|
||||
avdtp.c \
|
||||
avdtp_initiator.c \
|
||||
avdtp_acceptor.c \
|
||||
avdtp_source.c \
|
||||
btstack_ring_buffer.c \
|
||||
avdtp_util.c \
|
||||
avdtp.c \
|
||||
avdtp_initiator.c \
|
||||
avdtp_acceptor.c \
|
||||
avdtp_source.c \
|
||||
avdtp_sink.c \
|
||||
a2dp_source.c \
|
||||
a2dp_sink.c \
|
||||
btstack_ring_buffer.c \
|
||||
|
||||
include ${BTSTACK_ROOT}/example/Makefile.inc
|
||||
# include ${BTSTACK_ROOT}/example/Makefile.inc
|
||||
include ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc
|
||||
include ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc
|
||||
|
||||
CFLAGS += -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wunused-variable -Wunused-parameter -Werror
|
||||
CFLAGS += -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wunused-variable -Wunused-parameter
|
||||
# -Werror
|
||||
CFLAGS += -I..
|
||||
CFLAGS += -I${BTSTACK_ROOT}/src
|
||||
CFLAGS += -I${BTSTACK_ROOT}/src/classic
|
||||
CFLAGS += -I${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include -D OI_DEBUG
|
||||
CFLAGS += -I${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include
|
||||
CFLAGS += -I${BTSTACK_ROOT}/3rd-party/eCC
|
||||
CFLAGS += -I${BTSTACK_ROOT}/platform/posix
|
||||
CFLAGS += -I${BTSTACK_ROOT}/platform/embedded
|
||||
CFLAGS += -I${BTSTACK_ROOT}/port/libusb
|
||||
CFLAGS += -D ENABLE_LE_DATA_CHANNELS
|
||||
|
||||
VPATH += ${BTSTACK_ROOT}/src
|
||||
VPATH += ${BTSTACK_ROOT}/src/ble
|
||||
VPATH += ${BTSTACK_ROOT}/src/ble/mesh
|
||||
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/micro-ecc
|
||||
|
||||
# use pkg-config for libusb
|
||||
CFLAGS += $(shell pkg-config libusb-1.0 --cflags)
|
||||
@ -78,12 +103,16 @@ LDFLAGS += $(shell pkg-config portaudio-2.0 --libs)
|
||||
|
||||
CORE_OBJ = $(CORE:.c=.o)
|
||||
COMMON_OBJ = $(COMMON:.c=.o)
|
||||
ATT_OBJ = $(ATT:.c=.o)
|
||||
SM_OBJ = $(SM:.c=.o) $(MICROECC:.c=.o)
|
||||
GATT_CLIENT_OBJ = $(GATT_CLIENT:.c=.o)
|
||||
GATT_SERVER_OBJ = $(GATT_SERVER:.c=.o)
|
||||
SBC_DECODER_OBJ = $(SBC_DECODER:.c=.o)
|
||||
SBC_ENCODER_OBJ = $(SBC_ENCODER:.c=.o)
|
||||
AVDTP_OBJ = $(AVDTP:.c=.o)
|
||||
|
||||
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 = avdtp_source_test avdtp_sink_test le_data_channel avrcp_controller_test
|
||||
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 += avdtp_source_test avdtp_sink_test le_data_channel avrcp_controller_test
|
||||
|
||||
all: ${EXAMPLES}
|
||||
|
||||
@ -124,7 +153,7 @@ l2cap_test: ${CORE_OBJ} ${COMMON_OBJ} l2cap_test.c
|
||||
classic_test: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} classic_test.c
|
||||
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
||||
|
||||
bnep_test: ${CORE_OBJ} ${COMMON_OBJ} pan.o bnep_test.c
|
||||
bnep_test: ${CORE_OBJ} ${COMMON_OBJ} bnep.o pan.o bnep_test.c
|
||||
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
|
||||
|
||||
sco_loopback: ${CORE_OBJ} ${COMMON_OBJ} sco_loopback.c
|
||||
|
@ -674,7 +674,7 @@ static void handle_gatt_client_event(uint8_t packet_type, uint16_t channel, uint
|
||||
break;
|
||||
case CENTRAL_W4_RECONNECTION_ADDRESS_QUERY_COMPLETE:
|
||||
central_state = CENTRAL_IDLE;
|
||||
gap_advertisements_get_address(&address_type, our_private_address);
|
||||
gap_le_get_own_address(&address_type, our_private_address);
|
||||
printf("Our private address: %s\n", bd_addr_to_str(our_private_address));
|
||||
reverse_bd_addr(our_private_address, flipped_address);
|
||||
gatt_client_write_value_of_characteristic(handle_gatt_client_event, handle, gap_reconnection_address_characteristic.value_handle, 6, flipped_address);
|
||||
@ -863,7 +863,7 @@ static void print_screen(void){
|
||||
static void show_usage(void){
|
||||
uint8_t iut_address_type;
|
||||
bd_addr_t iut_address;
|
||||
gap_advertisements_get_address(&iut_address_type, iut_address);
|
||||
gap_le_get_own_address(&iut_address_type, iut_address);
|
||||
|
||||
reset_screen();
|
||||
|
||||
|
@ -301,6 +301,7 @@ static void app_run(void){
|
||||
// @param offset defines start of attribute value
|
||||
static uint16_t att_read_callback(hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size){
|
||||
|
||||
UNUSED(con_handle);
|
||||
printf("READ Callback, handle %04x, offset %u, buffer size %u\n", attribute_handle, offset, buffer_size);
|
||||
uint16_t att_value_len;
|
||||
|
||||
@ -379,6 +380,7 @@ static uint16_t att_read_callback(hci_con_handle_t con_handle, uint16_t attribut
|
||||
|
||||
// write requests
|
||||
static int att_write_callback(hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size){
|
||||
UNUSED(con_handle);
|
||||
printf("WRITE Callback, handle %04x, mode %u, offset %u, data: ", attribute_handle, transaction_mode, offset);
|
||||
printf_hexdump(buffer, buffer_size);
|
||||
|
||||
@ -540,6 +542,8 @@ static void gap_run(void){
|
||||
}
|
||||
|
||||
static void app_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||
UNUSED(channel);
|
||||
UNUSED(size);
|
||||
bd_addr_t event_address;
|
||||
switch (packet_type) {
|
||||
|
||||
@ -930,7 +934,9 @@ static void stdin_process(char c){
|
||||
return;
|
||||
}
|
||||
|
||||
static int get_oob_data_callback(uint8_t addres_type, bd_addr_t addr, uint8_t * oob_data){
|
||||
static int get_oob_data_callback(uint8_t address_type, bd_addr_t addr, uint8_t * oob_data){
|
||||
UNUSED(address_type);
|
||||
(void)addr;
|
||||
if(!sm_have_oob_data) return 0;
|
||||
memcpy(oob_data, sm_oob_data, 16);
|
||||
return 1;
|
||||
@ -938,7 +944,9 @@ static int get_oob_data_callback(uint8_t addres_type, bd_addr_t addr, uint8_t *
|
||||
|
||||
int btstack_main(int argc, const char * argv[]);
|
||||
int btstack_main(int argc, const char * argv[]){
|
||||
|
||||
(void) argv;
|
||||
(void) argc;
|
||||
|
||||
printf("BTstack LE Peripheral starting up...\n");
|
||||
|
||||
// set up l2cap_le
|
||||
@ -983,4 +991,4 @@ int btstack_main(int argc, const char * argv[]){
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* EXAMPLE_END */
|
||||
/* EXAMPLE_END */
|
||||
|
@ -724,7 +724,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
|
||||
case BNEP_EVENT_CAN_SEND_NOW:
|
||||
/* Check for parked network packets and send it out now */
|
||||
if (network_c_len > 0) {
|
||||
if (network_buffer_len > 0) {
|
||||
bnep_send(bnep_cid, network_buffer, network_buffer_len);
|
||||
network_buffer_len = 0;
|
||||
}
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "btstack_event.h"
|
||||
#include "btstack_memory.h"
|
||||
#include "btstack_run_loop.h"
|
||||
#include "bluetooth_sdp.h"
|
||||
#include "classic/rfcomm.h"
|
||||
#include "classic/sdp_client_rfcomm.h"
|
||||
#include "classic/sdp_server.h"
|
||||
@ -491,7 +492,7 @@ static void stdin_process(char c){
|
||||
if (c == '\n'){
|
||||
printf("\nSending Pin '%s'\n", ui_pin);
|
||||
ui_pin[ui_pin_offset] = 0;
|
||||
gap_pin_code_response(event_addr, ui_pin);
|
||||
gap_pin_code_response(remote, ui_pin);
|
||||
} else {
|
||||
ui_pin[ui_pin_offset++] = c;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user