From bc209ef15b8626e9b31e36e1c010450a28dc6b30 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 13 Mar 2023 18:08:37 +0100 Subject: [PATCH] goep_client: move goep_client_t to header file --- src/classic/goep_client.c | 47 -------------------------------------- src/classic/goep_client.h | 48 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 47 deletions(-) diff --git a/src/classic/goep_client.c b/src/classic/goep_client.c index 145d34666..91c4537a2 100644 --- a/src/classic/goep_client.c +++ b/src/classic/goep_client.c @@ -65,53 +65,6 @@ #endif #endif -typedef enum { - GOEP_CLIENT_INIT, - GOEP_CLIENT_W4_SDP, - GOEP_CLIENT_CONNECTED, -} goep_client_state_t; - -typedef struct { - btstack_linked_item_t item; - - uint16_t cid; - - goep_client_state_t state; - bd_addr_t bd_addr; - uint16_t uuid; - hci_con_handle_t con_handle; - uint8_t incoming; - - btstack_packet_handler_t client_handler; - btstack_context_callback_registration_t sdp_query_request; - - uint8_t rfcomm_port; - uint16_t l2cap_psm; - uint16_t bearer_cid; - uint16_t bearer_mtu; - - uint16_t record_index; - - // cached higher layer information PBAP + MAP - uint32_t profile_supported_features; - uint8_t map_mas_instance_id; - uint8_t map_supported_message_types; - - // needed to select one of multiple MAS Instances - struct { - uint32_t supported_features; - uint16_t l2cap_psm; - uint8_t instance_id; - uint8_t supported_message_types; - uint8_t rfcomm_port; - } mas_info; - - uint8_t obex_opcode; - uint32_t obex_connection_id; - int obex_connection_id_set; - -} goep_client_t; - static goep_client_t goep_client_singleton; static goep_client_t * goep_client = &goep_client_singleton; diff --git a/src/classic/goep_client.h b/src/classic/goep_client.h index 57a077517..5e902cd99 100644 --- a/src/classic/goep_client.h +++ b/src/classic/goep_client.h @@ -54,8 +54,56 @@ extern "C" { #include "btstack_defines.h" +typedef enum { + GOEP_CLIENT_INIT, + GOEP_CLIENT_W4_SDP, + GOEP_CLIENT_CONNECTED, +} goep_client_state_t; + /* API_START */ +typedef struct { + btstack_linked_item_t item; + + uint16_t cid; + + goep_client_state_t state; + bd_addr_t bd_addr; + uint16_t uuid; + hci_con_handle_t con_handle; + uint8_t incoming; + + btstack_packet_handler_t client_handler; + btstack_context_callback_registration_t sdp_query_request; + + uint8_t rfcomm_port; + uint16_t l2cap_psm; + uint16_t bearer_cid; + uint16_t bearer_mtu; + + uint16_t record_index; + + // cached higher layer information PBAP + MAP + uint32_t profile_supported_features; + uint8_t map_mas_instance_id; + uint8_t map_supported_message_types; + + // needed to select one of multiple MAS Instances + struct { + uint32_t supported_features; + uint16_t l2cap_psm; + uint8_t instance_id; + uint8_t supported_message_types; + uint8_t rfcomm_port; + } mas_info; + + uint8_t obex_opcode; + uint32_t obex_connection_id; + int obex_connection_id_set; + +} goep_client_t; + + // remote does not expose PBAP features in SDP record #define PBAP_FEATURES_NOT_PRESENT ((uint32_t) -1) #define MAP_FEATURES_NOT_PRESENT ((uint32_t) -1)