xref: /btstack/src/mesh/gatt-service/mesh_proxy_service_server.h (revision d567aeb32398f2a708611c446bcd9bad85a152cd)
1*d567aeb3SMatthias Ringwald /*
2*d567aeb3SMatthias Ringwald  * Copyright (C) 2018 BlueKitchen GmbH
3*d567aeb3SMatthias Ringwald  *
4*d567aeb3SMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
5*d567aeb3SMatthias Ringwald  * modification, are permitted provided that the following conditions
6*d567aeb3SMatthias Ringwald  * are met:
7*d567aeb3SMatthias Ringwald  *
8*d567aeb3SMatthias Ringwald  * 1. Redistributions of source code must retain the above copyright
9*d567aeb3SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer.
10*d567aeb3SMatthias Ringwald  * 2. Redistributions in binary form must reproduce the above copyright
11*d567aeb3SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer in the
12*d567aeb3SMatthias Ringwald  *    documentation and/or other materials provided with the distribution.
13*d567aeb3SMatthias Ringwald  * 3. Neither the name of the copyright holders nor the names of
14*d567aeb3SMatthias Ringwald  *    contributors may be used to endorse or promote products derived
15*d567aeb3SMatthias Ringwald  *    from this software without specific prior written permission.
16*d567aeb3SMatthias Ringwald  * 4. Any redistribution, use, or modification is done solely for
17*d567aeb3SMatthias Ringwald  *    personal benefit and not for any commercial purpose or for
18*d567aeb3SMatthias Ringwald  *    monetary gain.
19*d567aeb3SMatthias Ringwald  *
20*d567aeb3SMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
21*d567aeb3SMatthias Ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22*d567aeb3SMatthias Ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23*d567aeb3SMatthias Ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN
24*d567aeb3SMatthias Ringwald  * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25*d567aeb3SMatthias Ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26*d567aeb3SMatthias Ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27*d567aeb3SMatthias Ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28*d567aeb3SMatthias Ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29*d567aeb3SMatthias Ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30*d567aeb3SMatthias Ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31*d567aeb3SMatthias Ringwald  * SUCH DAMAGE.
32*d567aeb3SMatthias Ringwald  *
33*d567aeb3SMatthias Ringwald  * Please inquire about commercial licensing options at
34*d567aeb3SMatthias Ringwald  * [email protected]
35*d567aeb3SMatthias Ringwald  *
36*d567aeb3SMatthias Ringwald  */
37*d567aeb3SMatthias Ringwald 
38*d567aeb3SMatthias Ringwald /**
39*d567aeb3SMatthias Ringwald  * @title Mesh Proxy Service Server
40*d567aeb3SMatthias Ringwald  *
41*d567aeb3SMatthias Ringwald  */
42*d567aeb3SMatthias Ringwald 
43*d567aeb3SMatthias Ringwald #ifndef __MESH_PROXY_SERVICE_SERVER_H
44*d567aeb3SMatthias Ringwald #define __MESH_PROXY_SERVICE_SERVER_H
45*d567aeb3SMatthias Ringwald 
46*d567aeb3SMatthias Ringwald #include <stdint.h>
47*d567aeb3SMatthias Ringwald 
48*d567aeb3SMatthias Ringwald #include "hci.h"
49*d567aeb3SMatthias Ringwald 
50*d567aeb3SMatthias Ringwald #if defined __cplusplus
51*d567aeb3SMatthias Ringwald extern "C" {
52*d567aeb3SMatthias Ringwald #endif
53*d567aeb3SMatthias Ringwald 
54*d567aeb3SMatthias Ringwald /**
55*d567aeb3SMatthias Ringwald  * @text The Mesh Proxy Service is used to enable a server to send and receive Proxy PDUs with a client.
56*d567aeb3SMatthias Ringwald  *
57*d567aeb3SMatthias Ringwald  * To use with your application, add `#import <mesh_proxy_service.gatt>` to your .gatt file.
58*d567aeb3SMatthias Ringwald  */
59*d567aeb3SMatthias Ringwald 
60*d567aeb3SMatthias Ringwald /* API_START */
61*d567aeb3SMatthias Ringwald 
62*d567aeb3SMatthias Ringwald /**
63*d567aeb3SMatthias Ringwald  * @brief Init Mesh Proxy Service Server with ATT DB
64*d567aeb3SMatthias Ringwald  */
65*d567aeb3SMatthias Ringwald void mesh_proxy_service_server_init(void);
66*d567aeb3SMatthias Ringwald 
67*d567aeb3SMatthias Ringwald /**
68*d567aeb3SMatthias Ringwald  * @brief Send a Proxy PDU message containing proxy PDU from a proxy Server to a proxy Client.
69*d567aeb3SMatthias Ringwald  * @param con_handle
70*d567aeb3SMatthias Ringwald  * @param proxy_pdu
71*d567aeb3SMatthias Ringwald  * @param proxy_pdu_size max lenght MESH_PROV_MAX_PROXY_PDU
72*d567aeb3SMatthias Ringwald  */
73*d567aeb3SMatthias Ringwald void mesh_proxy_service_server_send_proxy_pdu(uint16_t con_handle, const uint8_t * proxy_pdu, uint16_t proxy_pdu_size);
74*d567aeb3SMatthias Ringwald 
75*d567aeb3SMatthias Ringwald /**
76*d567aeb3SMatthias Ringwald  * @brief Register callback for the PB-GATT.
77*d567aeb3SMatthias Ringwald  * @param callback
78*d567aeb3SMatthias Ringwald  */
79*d567aeb3SMatthias Ringwald void mesh_proxy_service_server_register_packet_handler(btstack_packet_handler_t callback);
80*d567aeb3SMatthias Ringwald 
81*d567aeb3SMatthias Ringwald /**
82*d567aeb3SMatthias Ringwald  * @brief Request can send now event to send PDU
83*d567aeb3SMatthias Ringwald  * Generates an MESH_SUBEVENT_CAN_SEND_NOW subevent
84*d567aeb3SMatthias Ringwald  * @param con_handle
85*d567aeb3SMatthias Ringwald  */
86*d567aeb3SMatthias Ringwald void mesh_proxy_service_server_request_can_send_now(hci_con_handle_t con_handle);
87*d567aeb3SMatthias Ringwald /* API_END */
88*d567aeb3SMatthias Ringwald 
89*d567aeb3SMatthias Ringwald #if defined __cplusplus
90*d567aeb3SMatthias Ringwald }
91*d567aeb3SMatthias Ringwald #endif
92*d567aeb3SMatthias Ringwald 
93*d567aeb3SMatthias Ringwald #endif
94*d567aeb3SMatthias Ringwald 
95