1
0
mirror of https://github.com/bluekitchen/btstack.git synced 2025-02-28 16:11:24 +00:00

sm_pairing_central: add dummy GATT DB

This commit is contained in:
Matthias Ringwald 2017-11-21 15:52:22 +01:00
parent f4cac3dd72
commit e5779dd230
3 changed files with 14 additions and 2 deletions

@ -207,8 +207,8 @@ hog_mouse_demo: hog_mouse_demo.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SER
sm_pairing_peripheral: sm_pairing_peripheral.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} sm_pairing_peripheral.c
${CC} $(filter-out sm_pairing_peripheral.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
sm_pairing_central: ${CORE_OBJ} ${COMMON_OBJ} ${SM_OBJ} sm_pairing_central.o
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
sm_pairing_central: sm_pairing_central.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} sm_pairing_central.o
${CC} $(filter-out sm_pairing_central.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
le_streamer: le_streamer.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} le_streamer.c
${CC} $(filter-out le_streamer.h,$^) ${CFLAGS} ${LDFLAGS} -o $@

@ -57,6 +57,7 @@
#include <string.h>
#include "btstack.h"
#include "sm_pairing_peripheral.h"
// We're looking for a remote device that lists this service in the advertisement
@ -91,6 +92,10 @@ static void sm_pairing_central_setup(void){
sm_event_callback_registration.callback = &packet_handler;
sm_add_event_handler(&sm_event_callback_registration);
// setup ATT server
att_server_init(profile_data, NULL, NULL);
att_server_register_packet_handler(packet_handler);
/**
* Choose ONE of the following configurations
*/

@ -0,0 +1,7 @@
PRIMARY_SERVICE, GAP_SERVICE
CHARACTERISTIC, GAP_DEVICE_NAME, READ, "SM Pairing Central"
// Dummy Service
PRIMARY_SERVICE, 0000FF10-0000-1000-8000-00805F9B34FB
// Dummy Service, Characteristic, with read and notify + authentication
CHARACTERISTIC, 0000FF12-0000-1000-8000-00805F9B34FB, READ | ENCRYPTION_KEY_SIZE_16, "Secure :)"