pbap_client: add PbapSupportedFeatures to OBEX Connect request

This commit is contained in:
Matthias Ringwald 2018-09-20 17:44:10 +02:00
parent 046d2a34e6
commit bca6857aa1
4 changed files with 18 additions and 0 deletions

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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;