mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 19:20:54 +00:00
sdp_rfcomm_query: register for SDP query, and handle it in a callback
This commit is contained in:
parent
acb6281e01
commit
ef24a2f712
@ -71,7 +71,12 @@ static struct {
|
||||
static uint8_t service_index = 0;
|
||||
|
||||
static btstack_packet_callback_registration_t hci_event_callback_registration;
|
||||
static btstack_context_callback_registration_t handle_sdp_client_query_request;
|
||||
|
||||
static void handle_start_sdp_client_query(void * context){
|
||||
UNUSED(context);
|
||||
sdp_client_query_rfcomm_channel_and_name_for_uuid(&handle_query_rfcomm_event, remote, BLUETOOTH_ATTRIBUTE_PUBLIC_BROWSE_ROOT);
|
||||
}
|
||||
|
||||
static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||
UNUSED(channel);
|
||||
@ -84,7 +89,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
case BTSTACK_EVENT_STATE:
|
||||
// BTstack activated, get started
|
||||
if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING){
|
||||
sdp_client_query_rfcomm_channel_and_name_for_uuid(&handle_query_rfcomm_event, remote, BLUETOOTH_ATTRIBUTE_PUBLIC_BROWSE_ROOT);
|
||||
handle_sdp_client_query_request.callback = &handle_start_sdp_client_query;
|
||||
(void) sdp_client_register_query_callback(&handle_start_sdp_client_query);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user