xref: /btstack/src/classic/sdp_client_rfcomm.h (revision 2fca4dad957cd7b88f4657ed51e89c12615dda72)
1efda0b48SMatthias Ringwald /*
2efda0b48SMatthias Ringwald  * Copyright (C) 2014 BlueKitchen GmbH
3efda0b48SMatthias Ringwald  *
4efda0b48SMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
5efda0b48SMatthias Ringwald  * modification, are permitted provided that the following conditions
6efda0b48SMatthias Ringwald  * are met:
7efda0b48SMatthias Ringwald  *
8efda0b48SMatthias Ringwald  * 1. Redistributions of source code must retain the above copyright
9efda0b48SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer.
10efda0b48SMatthias Ringwald  * 2. Redistributions in binary form must reproduce the above copyright
11efda0b48SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer in the
12efda0b48SMatthias Ringwald  *    documentation and/or other materials provided with the distribution.
13efda0b48SMatthias Ringwald  * 3. Neither the name of the copyright holders nor the names of
14efda0b48SMatthias Ringwald  *    contributors may be used to endorse or promote products derived
15efda0b48SMatthias Ringwald  *    from this software without specific prior written permission.
16efda0b48SMatthias Ringwald  * 4. Any redistribution, use, or modification is done solely for
17efda0b48SMatthias Ringwald  *    personal benefit and not for any commercial purpose or for
18efda0b48SMatthias Ringwald  *    monetary gain.
19efda0b48SMatthias Ringwald  *
20efda0b48SMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
21efda0b48SMatthias Ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22efda0b48SMatthias Ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23*2fca4dadSMilanka Ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN
24*2fca4dadSMilanka Ringwald  * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25efda0b48SMatthias Ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26efda0b48SMatthias Ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27efda0b48SMatthias Ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28efda0b48SMatthias Ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29efda0b48SMatthias Ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30efda0b48SMatthias Ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31efda0b48SMatthias Ringwald  * SUCH DAMAGE.
32efda0b48SMatthias Ringwald  *
33efda0b48SMatthias Ringwald  * Please inquire about commercial licensing options at
34efda0b48SMatthias Ringwald  * [email protected]
35efda0b48SMatthias Ringwald  *
36efda0b48SMatthias Ringwald  */
37efda0b48SMatthias Ringwald 
38fe5a6c4eSMilanka Ringwald /**
39fe5a6c4eSMilanka Ringwald  * @title SDP Client RFCOMM
40fe5a6c4eSMilanka Ringwald  *
41efda0b48SMatthias Ringwald  */
42efda0b48SMatthias Ringwald 
4380e33422SMatthias Ringwald #ifndef SDP_QUERY_RFCOMM_H
4480e33422SMatthias Ringwald #define SDP_QUERY_RFCOMM_H
45efda0b48SMatthias Ringwald 
46efda0b48SMatthias Ringwald #include "btstack_util.h"
47efda0b48SMatthias Ringwald 
48efda0b48SMatthias Ringwald #define SDP_SERVICE_NAME_LEN 20
49efda0b48SMatthias Ringwald 
50efda0b48SMatthias Ringwald #if defined __cplusplus
51efda0b48SMatthias Ringwald extern "C" {
52efda0b48SMatthias Ringwald #endif
53efda0b48SMatthias Ringwald 
54efda0b48SMatthias Ringwald /* API_START */
55efda0b48SMatthias Ringwald 
56efda0b48SMatthias Ringwald /**
5718aab418SMatthias Ringwald  * @brief Searches SDP records on a remote device for RFCOMM services with a given 16-bit UUID anywhere.
5809ac355cSMatthias Ringwald  * @note calls sdp_service_search_pattern_for_uuid16 that uses global buffer
5918aab418SMatthias Ringwald  * @param callback handler
6018aab418SMatthias Ringwald  * @param remote BD_ADDR
6118aab418SMatthias Ringwald  * @param uuid16
62efda0b48SMatthias Ringwald  */
6318aab418SMatthias Ringwald  uint8_t sdp_client_query_rfcomm_channel_and_name_for_uuid(btstack_packet_handler_t callback, bd_addr_t remote, uint16_t uuid16);
64efda0b48SMatthias Ringwald 
65efda0b48SMatthias Ringwald /**
6618aab418SMatthias Ringwald  * @brief Searches SDP records on a remote device for RFCOMM services with a given 16-bit UUID in its ServiceClassIDList
6718aab418SMatthias Ringwald  * @note calls sdp_service_search_pattern_for_uuid16 that uses global buffer
6818aab418SMatthias Ringwald  * @param callback handler
6918aab418SMatthias Ringwald  * @param remote BD_ADDR
7018aab418SMatthias Ringwald  * @param uuid16
7118aab418SMatthias Ringwald  */
7218aab418SMatthias Ringwald uint8_t sdp_client_query_rfcomm_channel_and_name_for_service_class_uuid(btstack_packet_handler_t callback, bd_addr_t remote, uint16_t uuid16);
7318aab418SMatthias Ringwald 
7418aab418SMatthias Ringwald /**
7518aab418SMatthias Ringwald  * @brief Searches SDP records on a remote device for RFCOMM services with a given 128-bit UUID anywhere
7609ac355cSMatthias Ringwald  * @note calls sdp_service_search_pattern_for_uuid128 that uses global buffer
7718aab418SMatthias Ringwald  * @param callback handler
7818aab418SMatthias Ringwald  * @param remote BD_ADDR
7918aab418SMatthias Ringwald  * @param uuid128
8009ac355cSMatthias Ringwald  */
8155bb522cSMatthias Ringwald uint8_t sdp_client_query_rfcomm_channel_and_name_for_uuid128(btstack_packet_handler_t callback, bd_addr_t remote, const uint8_t * uuid128);
8209ac355cSMatthias Ringwald 
8309ac355cSMatthias Ringwald /**
84efda0b48SMatthias Ringwald  * @brief Searches SDP records on a remote device for RFCOMM services with a given service search pattern.
85efda0b48SMatthias Ringwald  */
8655bb522cSMatthias Ringwald uint8_t sdp_client_query_rfcomm_channel_and_name_for_search_pattern(btstack_packet_handler_t callback, bd_addr_t remote, const uint8_t * des_serviceSearchPattern);
8709ac355cSMatthias Ringwald 
88efda0b48SMatthias Ringwald /* API_END */
89efda0b48SMatthias Ringwald 
90efda0b48SMatthias Ringwald #if defined __cplusplus
91efda0b48SMatthias Ringwald }
92efda0b48SMatthias Ringwald #endif
93efda0b48SMatthias Ringwald 
9480e33422SMatthias Ringwald #endif // SDP_QUERY_RFCOMM_H
95