move GATT Service clients into ble/gatt-service

This commit is contained in:
Matthias Ringwald 2021-03-08 10:09:41 +01:00
parent d9c6a0aea9
commit 6bdecec7ba
21 changed files with 35 additions and 56 deletions

View File

@ -47,24 +47,7 @@
#include <string.h>
#include <inttypes.h>
#include "btstack_config.h"
#include "btstack_run_loop.h"
#include "btstack_debug.h"
#include "btstack_event.h"
#include "btstack_memory.h"
#include "gap.h"
#include "hci.h"
#include "hci_dump.h"
#include "l2cap.h"
#include "ble/ancs_client.h"
#include "ble/att_db.h"
#include "ble/att_server.h"
#include "ble/gatt_client.h"
#include "ble/le_device_db.h"
#include "ble/sm.h"
#include "btstack.h"
// TODO: query full text upon notification using control point
// TODO: present notifications in human readable form
@ -189,4 +172,4 @@ int btstack_main(int argc, const char * argv[]){
return 0;
}
/* EXAMPLE_END */
/* EXAMPLE_END */

View File

@ -12,7 +12,8 @@ ARCHIVE=btstack-arduino-${VERSION}.zip
SRC_FILES = btstack_memory.c btstack_linked_list.c btstack_memory_pool.c btstack_run_loop.c btstack_run_loop_base.c btstack_crypto.c
SRC_FILES += hci_dump.c hci.c hci_cmd.c btstack_util.c l2cap.c ad_parser.c hci_transport_h4.c
BLE_FILES = att_db.c att_server.c att_dispatch.c att_db_util.c le_device_db_memory.c gatt_client.c
BLE_FILES += sm.c ancs_client.h ancs_client.c
BLE_FILES += sm.c
BEL_GATT_FILES = ancs_client.c
PORT_FILES = btstack_config.h bsp_arduino_em9301.cpp BTstack.cpp BTstack.h
EMBEDDED_FILES = btstack_run_loop_embedded.c btstack_uart_block_embedded.c
@ -20,6 +21,8 @@ PATHS = $(addprefix ${BTSTACK_ROOT}/src/, ${SRC_FILES})
PATHS += $(filter-out ${BTSTACK_ROOT}/src/btstack.h, $(wildcard ${BTSTACK_ROOT}/src/*.h))
PATHS += $(addprefix ${BTSTACK_ROOT}/src/ble/, ${BLE_FILES})
PATHS += $(wildcard ${BTSTACK_ROOT}/src/ble/*.h)
PATHS += $(addprefix ${BTSTACK_ROOT}/src/ble/gatt-service/, ${BEL_GATT_FILES})
PATHS += $(wildcard ${BTSTACK_ROOT}/src/ble/gatt-service/*.h)
PATHS += $(addprefix ${BTSTACK_ROOT}/platform/embedded/, ${EMBEDDED_FILES})
PATHS += $(wildcard ${BTSTACK_ROOT}/platform/embedded/*.h)
PATHS += $(wildcard ${BTSTACK_ROOT}/chipset/em9301/*)

View File

@ -58,10 +58,10 @@ ${BTSTACK_ROOT}/src/ble/ancs_client.c \
${BTSTACK_ROOT}/src/ble/att_db.c \
${BTSTACK_ROOT}/src/ble/att_dispatch.c \
${BTSTACK_ROOT}/src/ble/att_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_server.c \
${BTSTACK_ROOT}/src/ble/battery_service_client.c \
${BTSTACK_ROOT}/src/ble/device_information_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/hids_device.c \
${BTSTACK_ROOT}/src/ble/gatt_client.c \
${BTSTACK_ROOT}/src/ble/le_device_db_memory.c \

View File

@ -59,10 +59,10 @@ ${BTSTACK_ROOT}/src/ble/ancs_client.c \
${BTSTACK_ROOT}/src/ble/att_db.c \
${BTSTACK_ROOT}/src/ble/att_dispatch.c \
${BTSTACK_ROOT}/src/ble/att_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_server.c \
${BTSTACK_ROOT}/src/ble/battery_service_client.c \
${BTSTACK_ROOT}/src/ble/device_information_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/hids_device.c \
${BTSTACK_ROOT}/src/ble/gatt_client.c \
${BTSTACK_ROOT}/src/ble/le_device_db_memory.c \

View File

@ -49,15 +49,15 @@ ${BTSTACK_ROOT}/platform/embedded/btstack_stdin_embedded.c \
${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \
${BTSTACK_ROOT}/platform/embedded/btstack_uart_block_embedded.c \
${BTSTACK_ROOT}/src/ad_parser.c \
${BTSTACK_ROOT}/src/ble/ancs_client.c \
${BTSTACK_ROOT}/src/ble/att_db.c \
${BTSTACK_ROOT}/src/ble/att_dispatch.c \
${BTSTACK_ROOT}/src/ble/att_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/ancs_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/hids_device.c \
${BTSTACK_ROOT}/src/ble/battery_service_client.c \
${BTSTACK_ROOT}/src/ble/device_information_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt_client.c \
${BTSTACK_ROOT}/src/ble/le_device_db_memory.c \
${BTSTACK_ROOT}/src/ble/le_device_db_tlv.c \

View File

@ -53,11 +53,11 @@ ${BTSTACK_ROOT}/src/ble/ancs_client.c \
${BTSTACK_ROOT}/src/ble/att_db.c \
${BTSTACK_ROOT}/src/ble/att_dispatch.c \
${BTSTACK_ROOT}/src/ble/att_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/hids_device.c \
${BTSTACK_ROOT}/src/ble/battery_service_client.c \
${BTSTACK_ROOT}/src/ble/device_information_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt_client.c \
${BTSTACK_ROOT}/src/ble/le_device_db_memory.c \
${BTSTACK_ROOT}/src/ble/le_device_db_tlv.c \

View File

@ -46,15 +46,15 @@ ${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
${BTSTACK_ROOT}/platform/freertos/btstack_run_loop_freertos.c \
${BTSTACK_ROOT}/src/ad_parser.c \
${BTSTACK_ROOT}/src/ble/ancs_client.c \
${BTSTACK_ROOT}/src/ble/att_db.c \
${BTSTACK_ROOT}/src/ble/att_dispatch.c \
${BTSTACK_ROOT}/src/ble/att_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/ancs_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_server.c \
${BTSTACK_ROOT}/src/ble/gatt-service/hids_device.c \
${BTSTACK_ROOT}/src/ble/battery_service_client.c \
${BTSTACK_ROOT}/src/ble/device_information_service_client.c \
${BTSTACK_ROOT}/src/ble/gatt_client.c \
${BTSTACK_ROOT}/src/ble/le_device_db_memory.c \
${BTSTACK_ROOT}/src/ble/le_device_db_tlv.c \

View File

@ -1,13 +1,10 @@
# Makefile to collect all C source files of src/ble
SRC_BLE_FILES = \
ancs_client.c \
att_db.c \
att_db_util.c \
att_dispatch.c \
att_server.c \
battery_service_client.c \
device_information_service_client.c \
gatt_client.c \
hids_client.c \
le_device_db_memory.c \

View File

@ -1,9 +1,12 @@
# Makefile to collect all C source files of src/ble/gatt-service
SRC_BLE_GATT_SERVICE_FILES = \
ancs_client.c \
battery_service_server.c \
battery_service_client.c \
cycling_power_service_server.c \
cycling_speed_and_cadence_service_server.c \
device_information_service_client.c \
device_information_service_server.c \
heart_rate_service_server.c \
hids_device.c \

View File

@ -42,7 +42,7 @@
#include <stdint.h>
#include <string.h>
#include "ancs_client.h"
#include "ble/gatt-service/ancs_client.h"
#include "ble/att_db.h"
#include "ble/core.h"
@ -51,7 +51,6 @@
#include "btstack_debug.h"
#include "btstack_event.h"
#include "btstack_run_loop.h"
#include "classic/sdp_util.h"
#include "gap.h"
// ancs_client.h Start

View File

@ -43,7 +43,7 @@
#include <string.h>
#include "battery_service_client.h"
#include "ble/gatt-service/battery_service_client.h"
#include "btstack_memory.h"

View File

@ -43,7 +43,7 @@
#include <string.h>
#include "device_information_service_client.h"
#include "ble/gatt-service/device_information_service_client.h"
#include "btstack_memory.h"
#include "ble/att_db.h"

View File

@ -76,16 +76,16 @@
#include "l2cap_signaling.h"
#ifdef ENABLE_BLE
#include "ble/ancs_client.h"
#include "ble/att_db.h"
#include "ble/att_db_util.h"
#include "ble/att_dispatch.h"
#include "ble/att_server.h"
#include "ble/battery_service_client.h"
#include "ble/device_information_service_client.h"
#include "ble/gatt-service/ancs_client.h"
#include "ble/gatt-service/battery_service_client.h"
#include "ble/gatt-service/battery_service_server.h"
#include "ble/gatt-service/cycling_power_service_server.h"
#include "ble/gatt-service/cycling_speed_and_cadence_service_server.h"
#include "ble/gatt-service/device_information_service_client.h"
#include "ble/gatt-service/device_information_service_server.h"
#include "ble/gatt-service/heart_rate_service_server.h"
#include "ble/gatt-service/hids_device.h"

View File

@ -55,11 +55,6 @@
#include <stdlib.h>
#ifdef ENABLE_MALLOC_TEST
extern "C" void * test_malloc(size_t size);
#define malloc test_malloc
#endif
#ifdef HAVE_MALLOC
typedef struct btstack_memory_buffer {
struct btstack_memory_buffer * next;

View File

@ -52,12 +52,11 @@ extern "C" {
#endif
#include "btstack_config.h"
// Core
#include "hci.h"
#include "l2cap.h"
// Classic
#include "classic/avdtp_sink.h"
#include "classic/avdtp_source.h"
@ -70,11 +69,10 @@ extern "C" {
#include "classic/rfcomm.h"
#include "classic/sdp_server.h"
// BLE
#ifdef ENABLE_BLE
#include "ble/gatt_client.h"
#include "ble/battery_service_client.h"
#include "ble/gatt-service/battery_service_client.h"
#include "ble/sm.h"
#endif

View File

@ -8,6 +8,7 @@ CFLAGS = -DUNIT_TEST -x c++ -g -Wall -Wnarrowing -Wconversion-null -I. -Ibuild-
VPATH += ${BTSTACK_ROOT}/src
VPATH += ${BTSTACK_ROOT}/src/ble
VPATH += ${BTSTACK_ROOT}/src/ble/gatt-service
VPATH += ${BTSTACK_ROOT}/platform/posix
COMMON = \

View File

@ -155,13 +155,13 @@ all: ${EXAMPLES}
cycling_power_server_test.h: cycling_power_server_test.gatt
python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
cycling_power_server_test: cycling_power_server_test.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} ${SRC_BLE_GATT_SERVICE_FILES_OBJ} cycling_power_server_test.c
cycling_power_server_test: cycling_power_server_test.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} ${SRC_BLE_GATT_SERVICE_FILES_OBJ} gatt_client.o cycling_power_server_test.c
${CC} $(filter-out cycling_power_server_test.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
csc_server_test.h: csc_server_test.gatt
python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
csc_server_test: csc_server_test.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} ${SRC_BLE_GATT_SERVICE_FILES_OBJ} csc_server_test.c
csc_server_test: csc_server_test.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} ${SRC_BLE_GATT_SERVICE_FILES_OBJ} gatt_client.o csc_server_test.c
${CC} $(filter-out csc_server_test.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
csc_client_test: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${SM_OBJ} csc_client_test.c
@ -173,7 +173,7 @@ hid_host_test: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} btstack_hi
hid_device_test: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} btstack_hid_parser.o btstack_ring_buffer.o hid_device.o hid_device_test.o
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
hog_demo_test: hog_demo_test.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} ${SRC_BLE_GATT_SERVICE_FILES_OBJ} btstack_ring_buffer.o hog_demo_test.c
hog_demo_test: hog_demo_test.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} ${SRC_BLE_GATT_SERVICE_FILES_OBJ} gatt_client.o btstack_ring_buffer.o hog_demo_test.c
${CC} $(filter-out hog_demo_test.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
hrp_server_test.h: hrp_server_test.gatt
@ -233,7 +233,7 @@ iopt: ${CORE_OBJ} ${COMMON_OBJ} pan.o hsp_ag.o hsp_hs.o hfp_ag.o hfp_hf.o hfp_gs
gatt_profiles.h: gatt_profiles.gatt
python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
gatt_profiles: gatt_profiles.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} ${SRC_BLE_GATT_SERVICE_FILES_OBJ} gatt_profiles.o
gatt_profiles: gatt_profiles.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} ${SRC_BLE_GATT_SERVICE_FILES_OBJ} gatt_client.c gatt_profiles.o
${CC} $(filter-out gatt_profiles.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
myclean:

View File

@ -80,7 +80,7 @@ extern "C" {
// BLE
#ifdef ENABLE_BLE
#include "ble/gatt_client.h"
#include "ble/battery_service_client.h"
#include "ble/gatt-service/battery_service_client.h"
#include "ble/sm.h"
#endif