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