hfp_hf_demo: add gatt_streamer gatt services and add SDP record

This commit is contained in:
Matthias Ringwald 2023-04-13 09:23:01 +02:00
parent e0c5cbc78d
commit 04e91904b0
2 changed files with 13 additions and 2 deletions

View File

@ -82,8 +82,9 @@ set(EXAMPLES_GATT_FILES
gatt_browser.gatt
gatt_counter.gatt
gatt_device_information_query.gatt
gatt_streamer_server.gatt
hog_keyboard_demo.gatt
gatt_streamer_server.gatt
hfp_hf_demo.gatt
hog_keyboard_demo.gatt
hog_mouse_demo.gatt
le_credit_based_flow_control_mode_server.gatt
nordic_spp_le_counter.gatt

View File

@ -61,6 +61,7 @@
#include "btstack.h"
#include "sco_demo_util.h"
#include "hfp_hf_demo.h"
uint8_t hfp_service_buffer[150];
const uint8_t rfcomm_channel_nr = 1;
@ -799,6 +800,15 @@ int btstack_main(int argc, const char * argv[]){
btstack_stdin_setup(stdin_process);
#endif
#ifdef ENABLE_GATT_OVER_CLASSIC
static uint8_t gatt_service_buffer[150];
// create record for GATT and register with SDP
memset(gatt_service_buffer, 0, sizeof(gatt_service_buffer));
gatt_create_sdp_record(gatt_service_buffer, sdp_create_service_record_handle(), ATT_SERVICE_GATT_SERVICE_START_HANDLE, ATT_SERVICE_GATT_SERVICE_END_HANDLE);
sdp_register_service(gatt_service_buffer);
printf("GATT SDP service record size: %u\n", de_get_len(gatt_service_buffer));
#endif
// turn on!
hci_power_control(HCI_POWER_ON);
return 0;