Skip to content
Permalink
Browse files

examples: renamed le_counter to gatt_counter and le_streamer to le_st…

…reamer_server to indicate suppport for GATT over BR/EDR
  • Loading branch information...
mringwal committed Jun 21, 2019
1 parent 59a1a47 commit bdc352b16da8ddb06e0abca313290fcc1e06a43b
Showing with 182 additions and 137 deletions.
  1. +1 −0 CHANGELOG.md
  2. +81 −73 example/Makefile.inc
  3. +1 −1 example/att_delayed_response.c
  4. +2 −2 example/{le_counter.c → gatt_counter.c}
  5. 0 example/{le_counter.gatt → gatt_counter.gatt}
  6. +2 −2 example/{le_streamer.c → gatt_streamer_server.c}
  7. 0 example/{le_streamer.gatt → gatt_streamer_server.gatt}
  8. +2 −2 example/{spp_and_le_counter.c → spp_and_gatt_counter.c}
  9. 0 example/{spp_and_le_counter.gatt → spp_and_gatt_counter.gatt}
  10. +2 −2 example/{spp_and_le_streamer.c → spp_and_gatt_streamer.c}
  11. 0 example/{spp_and_le_streamer.gatt → spp_and_gatt_streamer.gatt}
  12. +11 −2 port/Makefile
  13. +1 −1 port/apollo2-em9304/create_examples.py
  14. +3 −3 port/ez430-rf2560/Makefile
  15. +1 −0 port/libusb-intel/Makefile
  16. +1 −1 port/libusb/Makefile
  17. +3 −3 port/msp-exp430f5438-cc2564b/Makefile
  18. +3 −3 port/msp430f5229lp-cc2564b/Makefile
  19. +2 −2 port/nrf5-zephyr/create_examples.py
  20. +1 −8 port/posix-h4-atwilc3000/Makefile
  21. +1 −8 port/posix-h4-da14581/Makefile
  22. +36 −0 port/posix-h4-zephyr-148/Makefile
  23. +1 −1 port/posix-h4-zephyr/Makefile
  24. +1 −0 port/posix-h4/Makefile
  25. +1 −0 port/posix-h5-bcm/Makefile
  26. +1 −0 port/posix-h5/Makefile
  27. +1 −0 port/raspi/Makefile
  28. +2 −2 port/samv71-xplained-atwilc3000/scripts/create_examples.py
  29. +3 −3 port/stm32-f103rb-nucleo/Makefile
  30. +7 −7 port/stm32-f4discovery-cc256x/Makefile
  31. +6 −8 port/stm32-l073rz-nucleo-em9304/Makefile
  32. +3 −1 port/windows-h4-zephyr/Makefile
  33. +1 −0 port/windows-h4/Makefile
  34. +1 −2 port/windows-winusb/Makefile
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- FreeRTOS: use freertos/.. prefix to include FreeRTOS headers if HAVE_FREERTOS_INCLUDE_PREFIX is defined
- BNEP: add Connection Handle to BNEP_EVENT_CHANNEL_OPENED
- Examples: renamed le_counter to gatt_counter and le_streamer to le_streamer_server to indicate suppport for GATT over BR/EDR

### Fixed
- BNEP: Bluetooth address is stored in little-endian format for all BNEP_EVENT_*
@@ -118,86 +118,106 @@ CVSD_PLC = \
btstack_cvsd_plc.c \

AVDTP += \
avdtp_util.c \
avdtp.c \
avdtp_initiator.c \
avdtp_acceptor.c \
avdtp_source.c \
avdtp_sink.c \
a2dp_source.c \
a2dp_sink.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 \

HXCMOD_PLAYER = \
hxcmod.c \
hxcmod.c \
nao-deceased_by_disease.c \

EXAMPLES = \
audio_duplex \
a2dp_sink_demo \
# List of General Examples without Bluetooth

EXAMPLES_GENERAL = \
audio_duplex \
led_counter \
mod_player \
sine_player \

# List of Examples that only use Bluetooth BR/EDR = Classic

EXAMPLES_CLASSIC_ONLY = \
a2dp_sink_demo \
a2dp_source_demo \
ancs_client_demo \
att_delayed_response \
avrcp_browsing_client \
dut_mode_classic \
gap_dedicated_bonding \
gap_inquiry \
gap_le_advertisements \
gap_dedicated_bonding \
gap_inquiry \
gap_link_keys \
gatt_battery_query \
gatt_browser \
gatt_heart_rate_client \
hfp_ag_demo \
hfp_hf_demo \
hid_host_demo \
hid_keyboard_demo \
hid_keyboard_demo \
hid_mouse_demo \
hog_keyboard_demo \
hog_mouse_demo \
hsp_ag_demo \
hsp_hs_demo \
le_counter \
le_data_channel_client \
le_data_channel_server \
le_streamer \
le_streamer_client \
led_counter \
mod_player \
nordic_spp_le_counter \
nordic_spp_le_streamer \
pbap_client_demo \
sdp_bnep_query \
sdp_general_query \
sdp_rfcomm_query \
sine_player \
sm_pairing_central \
sm_pairing_peripheral \
spp_and_le_counter \
spp_and_le_streamer \
spp_counter \
spp_streamer \
pbap_client_demo \
sdp_bnep_query \
sdp_general_query \
sdp_rfcomm_query \
spp_counter \
spp_streamer \
spp_streamer_client \
ublox_spp_le_counter \

EXAMPLES_USING_LE = \
ancs_client_demo \
# List of Examples that only use Bluetooth LE

EXAMPLES_LE_ONLY= \
ancs_client_demo \
att_delayed_response \
gap_le_advertisements \
gatt_battery_query \
gatt_browser \
gatt_browser \
gatt_counter \
gatt_streamer_server \
hog_keyboard_demo \
hog_mouse_demo \
le_counter \
le_data_channel_client \
le_data_channel_server \
le_streamer \
le_streamer_client \
nordic_spp_le_counter \
nordic_spp_le_streamer \
sm_pairing_central \
sm_pairing_peripheral \
spp_and_le_counter \
spp_and_gatt_counter \
ublox_spp_le_counter \

# List of Examples that use Bluetooth BR/EDR/LE = Dual Mode

EXAMPLES_DUAL_MODE= \
gatt_counter \
gatt_streamer_server \
spp_and_gatt_counter \
spp_and_gatt_streamer \

# List of GATT files used by either LE_ONLY or DUAL_MODE examples

EXAMPLES_GATT_FILES = \
att_delayed_response.gatt \
ancs_client_demo.gatt \
gatt_battery_query.gatt \
gatt_browser.gatt \
gatt_counter.gatt \
gatt_streamer_server.gatt \
hog_keyboard_demo.gatt \
hog_mouse_demo.gatt \
le_data_channel_server.gatt \
nordic_spp_le_counter.gatt \
nordic_spp_le_streamer.gatt \
sm_pairing_central.gatt \
sm_pairing_peripheral.gatt \
spp_and_gatt_counter.gatt \
spp_and_gatt_streamer.gatt \
ublox_spp_le_counter.gatt \

# .h for .gatt
EXAMPLES_GATT_H_FILES = $(EXAMPLES_GATT_FILES:.gatt=.h)

# .o for .c
CORE_OBJ = $(CORE:.c=.o)
COMMON_OBJ = $(COMMON:.c=.o)
@@ -253,23 +273,23 @@ sm_pairing_peripheral: sm_pairing_peripheral.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_O
sm_pairing_central: sm_pairing_central.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} sm_pairing_central.o
${CC} $(filter-out sm_pairing_central.h,$^) ${CFLAGS} ${LDFLAGS} -o $@

le_counter: le_counter.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${CLASSIC_OBJ} battery_service_server.o le_counter.c
${CC} $(filter-out le_counter.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
gatt_counter: gatt_counter.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${CLASSIC_OBJ} battery_service_server.o gatt_counter.c
${CC} $(filter-out gatt_counter.h,$^) ${CFLAGS} ${LDFLAGS} -o $@

le_streamer: le_streamer.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${CLASSIC_OBJ} le_streamer.c
${CC} $(filter-out le_streamer.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
gatt_streamer_server: gatt_streamer_server.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${CLASSIC_OBJ} gatt_streamer_server.c
${CC} $(filter-out gatt_streamer_server.h,$^) ${CFLAGS} ${LDFLAGS} -o $@

le_streamer_client: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} le_streamer_client.c
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@

gatt_heart_rate_client: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} gatt_heart_rate_client.c
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@

spp_and_le_counter: spp_and_le_counter.h ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} spp_and_le_counter.c
${CC} $(filter-out spp_and_le_counter.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
spp_and_gatt_counter: spp_and_gatt_counter.h ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} spp_and_gatt_counter.c
${CC} $(filter-out spp_and_gatt_counter.h,$^) ${CFLAGS} ${LDFLAGS} -o $@

spp_and_le_streamer: spp_and_le_streamer.h ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} spp_and_le_streamer.c
${CC} $(filter-out spp_and_le_streamer.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
spp_and_gatt_streamer: spp_and_gatt_streamer.h ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} spp_and_gatt_streamer.c
${CC} $(filter-out spp_and_gatt_streamer.h,$^) ${CFLAGS} ${LDFLAGS} -o $@

spp_streamer: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} spp_streamer.c
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
@@ -368,22 +388,10 @@ ublox_spp_le_counter: ublox_spp_le_counter.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ
${CC} $(filter-out ublox_spp_le_counter.h,$^) ${CFLAGS} ${LDFLAGS} -o $@

clean:
rm -f ${EXAMPLES} *_demo
rm -f *.o *.out *.hex *.exe *.wav *.sbc
rm -f ancs_client_demo.h profile.h spp_and_le_counter.h le_counter.h le_streamer.h hog_keyboard_demo.h hog_mouse_demo.h
rm -f gatt_battery_query.h gatt_browser.h sm_pairing_peripheral.h spp_and_le_streamer.h
rm -f le_data_channel_server.h sm_pairing_central.h
rm -f nordic_spp_le_counter.h nordic_spp_le_streamer.h nordic_spp_le_counter nordic_spp_le_streamer
rm -f ublox_spp_le_counter.h ublox_spp_le_counter
rm -f le_streamer_and_counter_client.h le_streamer_and_counter_client
rm -f sco_output.msbc sco_input.msbc
rm -rf *.dSYM
rm -f ${EXAMPLES} ${EXAMPLES_GATT_H_FILES}
rm -f *.o *.out *.hex *.exe *.wav *.sbc *.dSYM
rm -rf ${BTSTACK_ROOT}/src/*.o
rm -rf ${BTSTACK_ROOT}/src/ble/*.o
rm -rf ${BTSTACK_ROOT}/src/ble/gatt-service/*.o
rm -rf ${BTSTACK_ROOT}/src/classic/*.o
rm -rf ${BTSTACK_ROOT}/example/*.o
rm -rf ${BTSTACK_ROOT}/example/ancs_client_demo.h
rm -rf ${BTSTACK_ROOT}/example/profile.h
rm -rf ${BTSTACK_ROOT}/example/spp_and_le_counter.h
rm -rf ${BTSTACK_ROOT}/example/le_counter.h
rm -rf ${BTSTACK_ROOT}/example/le_streamer.h
@@ -70,7 +70,7 @@
*
* @text Listing MainConfiguration shows main application code.
* It initializes L2CAP, the Security Manager and configures the ATT Server with the pre-compiled
* ATT Database generated from $le_counter.gatt$.
* ATT Database generated from $att_delayed_response.gatt$.
* Additionally, it enables the Battery Service Server with the current battery level.
* Finally, it configures the advertisements and boots the Bluetooth stack.
* In this example, the Advertisement contains the Flags attribute and the device name.
@@ -35,7 +35,7 @@
*
*/

#define BTSTACK_FILE__ "le_counter.c"
#define BTSTACK_FILE__ "gatt_counter.c"

// *****************************************************************************
/* EXAMPLE_START(le_counter): LE Peripheral - Heartbeat Counter over GATT
@@ -52,7 +52,7 @@
#include <stdlib.h>
#include <string.h>

#include "le_counter.h"
#include "gatt_counter.h"
#include "btstack.h"
#include "ble/gatt-service/battery_service_server.h"

File renamed without changes.
@@ -35,7 +35,7 @@
*
*/

#define BTSTACK_FILE__ "le_streamer.c"
#define BTSTACK_FILE__ "gatt_streamer.c"

// *****************************************************************************
/* EXAMPLE_START(le_streamer): LE Streamer - Stream data over GATT.
@@ -66,7 +66,7 @@
// le_streamer.h contains the binary representation of le_streamer.gatt
// it is generated by the build system by calling: $BTSTACK_ROOT/tool/compile_gatt.py le_streamer.gatt le_streamer.h
// it needs to be regenerated when the GATT Database declared in le_streamer.gatt file is modified
#include "le_streamer.h"
#include "gatt_streamer_server.h"

#define REPORT_INTERVAL_MS 3000
#define MAX_NR_CONNECTIONS 3
File renamed without changes.
@@ -35,7 +35,7 @@
*
*/

#define BTSTACK_FILE__ "spp_and_le_counter.c"
#define BTSTACK_FILE__ "spp_and_gatt_counter.c"

// *****************************************************************************
/* EXAMPLE_START(spp_and_le_counter): Dual mode example
@@ -59,7 +59,7 @@
#include <inttypes.h>

#include "btstack.h"
#include "spp_and_le_counter.h"
#include "spp_and_gatt_counter.h"

#define RFCOMM_SERVER_CHANNEL 1
#define HEARTBEAT_PERIOD_MS 1000
File renamed without changes.
@@ -35,7 +35,7 @@
*
*/

#define BTSTACK_FILE__ "spp_and_le_streamer.c"
#define BTSTACK_FILE__ "spp_and_gatt_streamer.c"

// *****************************************************************************
/* EXAMPLE_START(spp_and_le_streamer): Dual mode example
@@ -60,7 +60,7 @@
#include <inttypes.h>

#include "btstack.h"
#include "spp_and_le_streamer.h"
#include "spp_and_gatt_streamer.h"

int btstack_main(int argc, const char * argv[]);

File renamed without changes.
@@ -12,16 +12,25 @@

SUBDIRS = \
arduino \
deamon \
daemon \
ez430-rf2560 \
libusb \
libusb-intel \
max32630-fthr \
msp-exp430f5438-cc2564b \
msp430f5229lp-cc2564b \
mtk \
posix-h4 \
posix-h4-atwilc3000 \
posix-h4-da14581 \
posix-h4-da14585 \
posix-h4-zephyr \
posix-h5 \
posix-h5-bcm \
samv71-xplained-atwilc3000 \
stm32-f103rb-nucleo \
max32630-fthr \
stm32-f4discovery-cc256x \
stm32-l073rz-nucleo-em9304 \

EXCLUDED = \
pic32-harmony/app.X \
@@ -43,7 +43,7 @@

print("Creating examples in /boards/apollo2_evb_am_ble/examples:")

LE_EXAMPLES = ["ancs_client_demo", "gap_le_advertisements", "gatt_battery_query", "gatt_browser", "le_counter", "le_streamer", "le_streamer_client", "sm_pairing_peripheral", "sm_pairing_central"]
LE_EXAMPLES = ["ancs_client_demo", "gap_le_advertisements", "gatt_battery_query", "gatt_browser", "gatt_counter", "gatt_streamer", "le_streamer_client", "sm_pairing_peripheral", "sm_pairing_central"]

# iterate over btstack examples
for example in LE_EXAMPLES:
@@ -102,7 +102,7 @@ all: led_counter.hex
include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc

# compiling requires a 20-bit mspgcc version
# spp_and_le_counter.hex spp_accel.hex spp_flowcontrol.hex spp_counter.hex
# spp_and_gatt_counter.hex spp_accel.hex spp_flowcontrol.hex spp_counter.hex
# sdp_rfcomm_query.hex sdp_general_query.hex
# gap_inquiry.hex

@@ -129,7 +129,7 @@ hid_demo.out: ${CORE_OBJ} ${COMMON_OBJ} ${LCD_OBJ} ${SPP_OBJ} ${CC2560B} hid_dem
spp_accel.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_accel.o sdp_server.o hal_adc.o
${CC} $^ ${LDFLAGS} -o $@

spp_and_le_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${BLE_OBJ} spp_and_le_counter.h spp_and_le_counter.o sdp_server.o
spp_and_gatt_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${BLE_OBJ} spp_and_gatt_counter.h spp_and_gatt_counter.o sdp_server.o
${CC} $^ ${LDFLAGS} -o $@

spp_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_counter.o sdp_server.o
@@ -148,7 +148,7 @@ sdp_general_query.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${SDP_CLIENT} ${CC25
${CC} $^ ${LDFLAGS} -o $@

clean:
rm -f $ *.o *.out *.hex profile.h spp_and_le_counter.h bluetooth*.c BLE*.c *.bts
rm -f $ *.o *.out *.hex profile.h spp_and_gatt_counter.h bluetooth*.c BLE*.c *.bts

size: all
msp430-size *.o
@@ -33,6 +33,7 @@ VPATH += ${BTSTACK_ROOT}/chipset/intel
CFLAGS += $(shell pkg-config libusb-1.0 --cflags)
LDFLAGS += $(shell pkg-config libusb-1.0 --libs)

EXAMPLES = ${EXAMPLES_GENERAL} ${EXAMPLES_CLASSIC_ONLY} ${EXAMPLES_LE_ONLY} ${EXAMPLES_DUAL_MODE}
EXAMPLES += pan_lwip_http_server

# use pkg-config for portaudio
@@ -32,8 +32,8 @@ VPATH += ${BTSTACK_ROOT}/chipset/zephyr
CFLAGS += $(shell pkg-config libusb-1.0 --cflags)
LDFLAGS += $(shell pkg-config libusb-1.0 --libs)

EXAMPLES = ${EXAMPLES_GENERAL} ${EXAMPLES_CLASSIC_ONLY} ${EXAMPLES_LE_ONLY} ${EXAMPLES_DUAL_MODE}
EXAMPLES += pan_lwip_http_server

EXAMPLES += csr_set_bd_addr

csr_set_bd_addr: ${CORE_OBJ} ${COMMON_OBJ} btstack_chipset_csr.o csr_set_bd_addr.o

0 comments on commit bdc352b

Please sign in to comment.
You can’t perform that action at this time.