xref: /btstack/src/classic/spp_server.h (revision 6e46b7411f30c40b7603749c02f051634c6af1ca)
1c227ee0fSMatthias Ringwald /*
2c227ee0fSMatthias Ringwald  * Copyright (C) 2014 BlueKitchen GmbH
3c227ee0fSMatthias Ringwald  *
4c227ee0fSMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
5c227ee0fSMatthias Ringwald  * modification, are permitted provided that the following conditions
6c227ee0fSMatthias Ringwald  * are met:
7c227ee0fSMatthias Ringwald  *
8c227ee0fSMatthias Ringwald  * 1. Redistributions of source code must retain the above copyright
9c227ee0fSMatthias Ringwald  *    notice, this list of conditions and the following disclaimer.
10c227ee0fSMatthias Ringwald  * 2. Redistributions in binary form must reproduce the above copyright
11c227ee0fSMatthias Ringwald  *    notice, this list of conditions and the following disclaimer in the
12c227ee0fSMatthias Ringwald  *    documentation and/or other materials provided with the distribution.
13c227ee0fSMatthias Ringwald  * 3. Neither the name of the copyright holders nor the names of
14c227ee0fSMatthias Ringwald  *    contributors may be used to endorse or promote products derived
15c227ee0fSMatthias Ringwald  *    from this software without specific prior written permission.
16c227ee0fSMatthias Ringwald  * 4. Any redistribution, use, or modification is done solely for
17c227ee0fSMatthias Ringwald  *    personal benefit and not for any commercial purpose or for
18c227ee0fSMatthias Ringwald  *    monetary gain.
19c227ee0fSMatthias Ringwald  *
20c227ee0fSMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
21c227ee0fSMatthias Ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22c227ee0fSMatthias Ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
232fca4dadSMilanka Ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN
242fca4dadSMilanka Ringwald  * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25c227ee0fSMatthias Ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26c227ee0fSMatthias Ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27c227ee0fSMatthias Ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28c227ee0fSMatthias Ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29c227ee0fSMatthias Ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30c227ee0fSMatthias Ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31c227ee0fSMatthias Ringwald  * SUCH DAMAGE.
32c227ee0fSMatthias Ringwald  *
33c227ee0fSMatthias Ringwald  * Please inquire about commercial licensing options at
34c227ee0fSMatthias Ringwald  * [email protected]
35c227ee0fSMatthias Ringwald  *
36c227ee0fSMatthias Ringwald  */
37c227ee0fSMatthias Ringwald 
38fe5a6c4eSMilanka Ringwald /**
39fe5a6c4eSMilanka Ringwald  * @title SPP Server
40c227ee0fSMatthias Ringwald  *
41fe5a6c4eSMilanka Ringwald  * Create SPP SDP Records.
42fe5a6c4eSMilanka Ringwald  *
43c227ee0fSMatthias Ringwald  */
44c227ee0fSMatthias Ringwald 
4580e33422SMatthias Ringwald #ifndef SPP_SERVER_H
4680e33422SMatthias Ringwald #define SPP_SERVER_H
47c227ee0fSMatthias Ringwald 
48c227ee0fSMatthias Ringwald #include <stdint.h>
49c227ee0fSMatthias Ringwald 
50c227ee0fSMatthias Ringwald #if defined __cplusplus
51c227ee0fSMatthias Ringwald extern "C" {
52c227ee0fSMatthias Ringwald #endif
53c227ee0fSMatthias Ringwald 
54c227ee0fSMatthias Ringwald /* API_START */
55c227ee0fSMatthias Ringwald 
56c227ee0fSMatthias Ringwald /**
57ec818a28SMatthias Ringwald  * @brief Create SDP record for SPP service with official SPP Service Class
58c227ee0fSMatthias Ringwald  * @param service buffer - needs to large enough
59c227ee0fSMatthias Ringwald  * @param service_record_handle
60c227ee0fSMatthias Ringwald  * @param rfcomm_channel
61*6e46b741SMatthias Ringwald  * @param name or NULL for default value. Provide "" (empty string) to skip attribute
62c227ee0fSMatthias Ringwald  */
63c227ee0fSMatthias Ringwald void spp_create_sdp_record(uint8_t *service, uint32_t service_record_handle, int rfcomm_channel, const char *name);
64c227ee0fSMatthias Ringwald 
65ec818a28SMatthias Ringwald /**
66ec818a28SMatthias Ringwald  * @brief Create SDP record for SPP service with custom service UUID (e.g. for use with Android)
67ec818a28SMatthias Ringwald  * @param service buffer - needs to large enough
68ec818a28SMatthias Ringwald  * @param service_record_handle
69ec818a28SMatthias Ringwald  * @param service_uuid128 buffer
70ec818a28SMatthias Ringwald  * @param rfcomm_channel
71ec818a28SMatthias Ringwald  * @param name
72ec818a28SMatthias Ringwald  */
73ec818a28SMatthias Ringwald void spp_create_custom_sdp_record(uint8_t *service, uint32_t service_record_handle, const uint8_t * service_uuid128, int rfcomm_channel, const char *name);
74ec818a28SMatthias Ringwald 
75c227ee0fSMatthias Ringwald /* API_END */
76c227ee0fSMatthias Ringwald 
77c227ee0fSMatthias Ringwald #if defined __cplusplus
78c227ee0fSMatthias Ringwald }
79c227ee0fSMatthias Ringwald #endif
8080e33422SMatthias Ringwald #endif // SPP_SERVER_H
81