From 50e828286979a600512768a934c3b633d6fe3a2c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 23 Jul 2024 15:01:06 +0200 Subject: [PATCH] example/hfp_hf_demo: set Apple Accessory Information --- example/hfp_hf_demo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/example/hfp_hf_demo.c b/example/hfp_hf_demo.c index 743715d66..cfe3e9fe0 100644 --- a/example/hfp_hf_demo.c +++ b/example/hfp_hf_demo.c @@ -692,6 +692,10 @@ static void hfp_hf_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t status = hfp_subevent_echo_canceling_and_noise_reduction_deactivate_get_status(event); report_status(status, "Echo Canceling and Noise Reduction Deactivate"); break; + case HFP_SUBEVENT_APPLE_EXTENSION_SUPPORTED: + printf("Apple Extension supported: %s\n", + hfp_subevent_apple_extension_supported_get_supported(event) ? "yes" : "no"); + break; default: break; } @@ -751,7 +755,10 @@ int btstack_main(int argc, const char * argv[]){ hfp_hf_init_hf_indicators(sizeof(indicators)/sizeof(uint16_t), indicators); hfp_hf_init_codecs(sizeof(codecs), codecs); hfp_hf_register_packet_handler(hfp_hf_packet_handler); - + // Set Apple Accessory Information: features = battery reporting & docked/powered, battery=9, docked=1 + hfp_hf_apple_set_identification(BLUETOOTH_COMPANY_ID_BLUEKITCHEN_GMBH, 0x0001, "0001", 3); + hfp_hf_apple_set_battery_level(9); + hfp_hf_apple_set_docked_state(1); // Configure SDP