xref: /btstack/src/ble/gatt-service/link_loss_service_server.h (revision daa5f023ef40927147f1a414e0ebef2ed425824c)
1*daa5f023SMatthias Ringwald /*
2*daa5f023SMatthias Ringwald  * Copyright (C) 2021 BlueKitchen GmbH
3*daa5f023SMatthias Ringwald  *
4*daa5f023SMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
5*daa5f023SMatthias Ringwald  * modification, are permitted provided that the following conditions
6*daa5f023SMatthias Ringwald  * are met:
7*daa5f023SMatthias Ringwald  *
8*daa5f023SMatthias Ringwald  * 1. Redistributions of source code must retain the above copyright
9*daa5f023SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer.
10*daa5f023SMatthias Ringwald  * 2. Redistributions in binary form must reproduce the above copyright
11*daa5f023SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer in the
12*daa5f023SMatthias Ringwald  *    documentation and/or other materials provided with the distribution.
13*daa5f023SMatthias Ringwald  * 3. Neither the name of the copyright holders nor the names of
14*daa5f023SMatthias Ringwald  *    contributors may be used to endorse or promote products derived
15*daa5f023SMatthias Ringwald  *    from this software without specific prior written permission.
16*daa5f023SMatthias Ringwald  * 4. Any redistribution, use, or modification is done solely for
17*daa5f023SMatthias Ringwald  *    personal benefit and not for any commercial purpose or for
18*daa5f023SMatthias Ringwald  *    monetary gain.
19*daa5f023SMatthias Ringwald  *
20*daa5f023SMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
21*daa5f023SMatthias Ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22*daa5f023SMatthias Ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23*daa5f023SMatthias Ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN
24*daa5f023SMatthias Ringwald  * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25*daa5f023SMatthias Ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26*daa5f023SMatthias Ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27*daa5f023SMatthias Ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28*daa5f023SMatthias Ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29*daa5f023SMatthias Ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30*daa5f023SMatthias Ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31*daa5f023SMatthias Ringwald  * SUCH DAMAGE.
32*daa5f023SMatthias Ringwald  *
33*daa5f023SMatthias Ringwald  * Please inquire about commercial licensing options at
34*daa5f023SMatthias Ringwald  * [email protected]
35*daa5f023SMatthias Ringwald  *
36*daa5f023SMatthias Ringwald  */
37*daa5f023SMatthias Ringwald 
38*daa5f023SMatthias Ringwald /**
39*daa5f023SMatthias Ringwald  * @title Link Loss Service Server
40*daa5f023SMatthias Ringwald  *
41*daa5f023SMatthias Ringwald  */
42*daa5f023SMatthias Ringwald 
43*daa5f023SMatthias Ringwald #ifndef LINK_LOSS_SERVICE_SERVER_H
44*daa5f023SMatthias Ringwald #define LINK_LOSS_SERVICE_SERVER_H
45*daa5f023SMatthias Ringwald 
46*daa5f023SMatthias Ringwald #include <stdint.h>
47*daa5f023SMatthias Ringwald #include "ble/gatt-service/link_loss_service_util.h"
48*daa5f023SMatthias Ringwald 
49*daa5f023SMatthias Ringwald #if defined __cplusplus
50*daa5f023SMatthias Ringwald extern "C" {
51*daa5f023SMatthias Ringwald #endif
52*daa5f023SMatthias Ringwald 
53*daa5f023SMatthias Ringwald 
54*daa5f023SMatthias Ringwald /**
55*daa5f023SMatthias Ringwald  * @ To use with your application, add `#import <link_loss_service.gatt>` to your .gatt file.
56*daa5f023SMatthias Ringwald  */
57*daa5f023SMatthias Ringwald 
58*daa5f023SMatthias Ringwald /* API_START */
59*daa5f023SMatthias Ringwald 
60*daa5f023SMatthias Ringwald /**
61*daa5f023SMatthias Ringwald  * @brief Init Link Loss Service Server with ATT DB
62*daa5f023SMatthias Ringwald  * @param mute_state
63*daa5f023SMatthias Ringwald  */
64*daa5f023SMatthias Ringwald void link_loss_service_server_init(void);
65*daa5f023SMatthias Ringwald 
66*daa5f023SMatthias Ringwald /**
67*daa5f023SMatthias Ringwald  * @brief Register packet handler
68*daa5f023SMatthias Ringwald  */
69*daa5f023SMatthias Ringwald void link_loss_service_server_register_packet_handler(btstack_packet_handler_t packet_handler);
70*daa5f023SMatthias Ringwald 
71*daa5f023SMatthias Ringwald /**
72*daa5f023SMatthias Ringwald  * @brief Set alert level. Default is no alert.
73*daa5f023SMatthias Ringwald  * @param alert_level
74*daa5f023SMatthias Ringwald  */
75*daa5f023SMatthias Ringwald uint8_t link_loss_service_client_set_alert_level(lls_alert_level_t alert_level);
76*daa5f023SMatthias Ringwald 
77*daa5f023SMatthias Ringwald /**
78*daa5f023SMatthias Ringwald  * @brief Set alert timeout. Default is 0 that equals to no timeout.
79*daa5f023SMatthias Ringwald  * @param alert_timeout_ms
80*daa5f023SMatthias Ringwald  */
81*daa5f023SMatthias Ringwald uint8_t link_loss_service_server_set_alert_timeout(uint32_t alert_timeout_ms);
82*daa5f023SMatthias Ringwald 
83*daa5f023SMatthias Ringwald 
84*daa5f023SMatthias Ringwald void link_loss_service_server_stop_alerting(void);
85*daa5f023SMatthias Ringwald 
86*daa5f023SMatthias Ringwald /* API_END */
87*daa5f023SMatthias Ringwald 
88*daa5f023SMatthias Ringwald #if defined __cplusplus
89*daa5f023SMatthias Ringwald }
90*daa5f023SMatthias Ringwald #endif
91*daa5f023SMatthias Ringwald 
92*daa5f023SMatthias Ringwald #endif
93*daa5f023SMatthias Ringwald 
94