From bca6857aa1276e6b25b530c8d204dcbf0ad568fe Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 20 Sep 2018 17:44:10 +0200 Subject: [PATCH] pbap_client: add PbapSupportedFeatures to OBEX Connect request --- src/classic/goep_client.c | 6 ++++++ src/classic/goep_client.h | 5 +++++ src/classic/obex.h | 2 ++ src/classic/pbap_client.c | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/src/classic/goep_client.c b/src/classic/goep_client.c index c2fb647b9..f81c691b8 100644 --- a/src/classic/goep_client.c +++ b/src/classic/goep_client.c @@ -387,6 +387,12 @@ uint8_t goep_client_create_connection(btstack_packet_handler_t handler, bd_addr_ return 0; } +uint32_t goep_client_get_pbap_supported_features(uint16_t goep_cid){ + UNUSED(goep_cid); + goep_client_t * context = goep_client; + return context->pbap_supported_features; +} + uint8_t goep_client_disconnect(uint16_t goep_cid){ UNUSED(goep_cid); goep_client_t * context = goep_client; diff --git a/src/classic/goep_client.h b/src/classic/goep_client.h index 56b9c9760..78694c8a4 100644 --- a/src/classic/goep_client.h +++ b/src/classic/goep_client.h @@ -93,6 +93,11 @@ void goep_client_request_can_send_now(uint16_t goep_cid); */ uint8_t goep_client_get_request_opcode(uint16_t goep_cid); +/** + * brief Get PBAP Supported Features found in SDP record during conenct + */ +uint32_t goep_client_get_pbap_supported_features(uint16_t goep_cid); + /** * @brief Set Connection ID used for newly created requests * @param gope_cid diff --git a/src/classic/obex.h b/src/classic/obex.h index 12339504a..deb1847ce 100644 --- a/src/classic/obex.h +++ b/src/classic/obex.h @@ -120,5 +120,7 @@ #define PBAP_APPLICATION_PARAMETER_VCARD_SELECTOR_OPERATOR 0x0E // ResetNewMissedCalls - 0x0F - 1 byte #define PBAP_APPLICATION_PARAMETER_RESET_NEW_MISSED_CALLS 0x0F +// PbapSupportedFeatures - 0x10 - 4 bytes +#define PBAP_APPLICATION_PARAMETER_PBAP_SUPPORTED_FEATURES 0x10 #endif diff --git a/src/classic/pbap_client.c b/src/classic/pbap_client.c index 43726c701..a5a487474 100644 --- a/src/classic/pbap_client.c +++ b/src/classic/pbap_client.c @@ -223,6 +223,11 @@ static void pbap_handle_can_send_now(void){ case PBAP_W2_SEND_CONNECT_REQUEST: goep_client_create_connect_request(pbap_client->goep_cid, OBEX_VERSION, 0, OBEX_MAX_PACKETLEN_DEFAULT); goep_client_add_header_target(pbap_client->goep_cid, 16, pbap_uuid); + // Add PbapSupportedFeatures + application_parameters[0] = PBAP_APPLICATION_PARAMETER_PBAP_SUPPORTED_FEATURES; + application_parameters[1] = 4; + big_endian_store_32(application_parameters, 2, goep_client_get_pbap_supported_features(pbap_client->goep_cid)); + goep_client_add_header_application_parameters(pbap_client->goep_cid, 6, &application_parameters[0]); pbap_client->state = PBAP_W4_CONNECT_RESPONSE; goep_client_execute(pbap_client->goep_cid); break;