From 0806590a600df0f851d9905dbdc2002bd34ce2dc Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 7 Aug 2024 13:09:59 +0200 Subject: [PATCH] pbap_client: pass l2cap ertm config into pbap_client_connect and use goep_client_connect --- src/classic/pbap_client.c | 6 ++++-- src/classic/pbap_client.h | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/classic/pbap_client.c b/src/classic/pbap_client.c index 2381552c6..c33b4fee1 100644 --- a/src/classic/pbap_client.c +++ b/src/classic/pbap_client.c @@ -1081,7 +1081,8 @@ void pbap_client_init(void){ void pbap_client_deinit(void){ } -uint8_t pbap_client_connect(pbap_client_t * client, btstack_packet_handler_t handler, bd_addr_t addr, uint16_t * out_cid) { +uint8_t pbap_client_connect(pbap_client_t * client, l2cap_ertm_config_t *l2cap_ertm_config, uint8_t *l2cap_ertm_buffer, + uint16_t l2cap_ertm_buffer_size, btstack_packet_handler_t handler, bd_addr_t addr, uint16_t * out_cid) { client->state = PBAP_CLIENT_W4_GOEP_CONNECTION; client->client_handler = handler; client->vcard_selector = 0; @@ -1089,7 +1090,8 @@ uint8_t pbap_client_connect(pbap_client_t * client, btstack_packet_handler_t han btstack_linked_list_add(&pbap_clients, (btstack_linked_item_t*) client); - uint8_t status = goep_client_create_connection(&pbap_packet_handler, addr, BLUETOOTH_SERVICE_CLASS_PHONEBOOK_ACCESS_PSE, &client->goep_cid); + uint8_t status = goep_client_connect(&client->goep_client, l2cap_ertm_config, l2cap_ertm_buffer, l2cap_ertm_buffer_size, + &pbap_packet_handler, addr, BLUETOOTH_SERVICE_CLASS_PHONEBOOK_ACCESS_PSE, 0, &client->goep_cid); *out_cid = client->goep_cid; if (status) { diff --git a/src/classic/pbap_client.h b/src/classic/pbap_client.h index f934bf36d..02b651d37 100644 --- a/src/classic/pbap_client.h +++ b/src/classic/pbap_client.h @@ -181,13 +181,17 @@ void pbap_client_init(void); * This function allows for multiple parallel connections. * * @param client storage for connection state. Must stay valid until connection closes + * @param l2cap_ertm_config + * @param l2cap_ertm_buffer_size + * @param l2cap_ertm_buffer * @param handler * @param addr * @param out_cid to use for further commands * @return status ERROR_CODE_SUCCESS on success, otherwise BTSTACK_MEMORY_ALLOC_FAILED if PBAP or GOEP connection already exists. */ -uint8_t pbap_client_connect(pbap_client_t * client, btstack_packet_handler_t handler, bd_addr_t addr, uint16_t * out_cid); +uint8_t pbap_client_connect(pbap_client_t * client, l2cap_ertm_config_t *l2cap_ertm_config, uint8_t *l2cap_ertm_buffer, + uint16_t l2cap_ertm_buffer_size, btstack_packet_handler_t handler, bd_addr_t addr, uint16_t * out_cid); /** * @brief Create PBAP connection to a Phone Book Server (PSE) server on a remote device.