xref: /btstack/test/mock/mock_att_server.h (revision 0b0c01c9424108fe4b494865f98972f960539ae2)
1*0b0c01c9SMilanka Ringwald /*
2*0b0c01c9SMilanka Ringwald  * Copyright (C) 2020 BlueKitchen GmbH
3*0b0c01c9SMilanka Ringwald  *
4*0b0c01c9SMilanka Ringwald  * Redistribution and use in source and binary forms, with or without
5*0b0c01c9SMilanka Ringwald  * modification, are permitted provided that the following conditions
6*0b0c01c9SMilanka Ringwald  * are met:
7*0b0c01c9SMilanka Ringwald  *
8*0b0c01c9SMilanka Ringwald  * 1. Redistributions of source code must retain the above copyright
9*0b0c01c9SMilanka Ringwald  *    notice, this list of conditions and the following disclaimer.
10*0b0c01c9SMilanka Ringwald  * 2. Redistributions in binary form must reproduce the above copyright
11*0b0c01c9SMilanka Ringwald  *    notice, this list of conditions and the following disclaimer in the
12*0b0c01c9SMilanka Ringwald  *    documentation and/or other materials provided with the distribution.
13*0b0c01c9SMilanka Ringwald  * 3. Neither the name of the copyright holders nor the names of
14*0b0c01c9SMilanka Ringwald  *    contributors may be used to endorse or promote products derived
15*0b0c01c9SMilanka Ringwald  *    from this software without specific prior written permission.
16*0b0c01c9SMilanka Ringwald  * 4. Any redistribution, use, or modification is done solely for
17*0b0c01c9SMilanka Ringwald  *    personal benefit and not for any commercial purpose or for
18*0b0c01c9SMilanka Ringwald  *    monetary gain.
19*0b0c01c9SMilanka Ringwald  *
20*0b0c01c9SMilanka Ringwald  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
21*0b0c01c9SMilanka Ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22*0b0c01c9SMilanka Ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23*0b0c01c9SMilanka Ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS
24*0b0c01c9SMilanka Ringwald  * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25*0b0c01c9SMilanka Ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26*0b0c01c9SMilanka Ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27*0b0c01c9SMilanka Ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28*0b0c01c9SMilanka Ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29*0b0c01c9SMilanka Ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30*0b0c01c9SMilanka Ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31*0b0c01c9SMilanka Ringwald  * SUCH DAMAGE.
32*0b0c01c9SMilanka Ringwald  *
33*0b0c01c9SMilanka Ringwald  * Please inquire about commercial licensing options at
34*0b0c01c9SMilanka Ringwald  * [email protected]
35*0b0c01c9SMilanka Ringwald  *
36*0b0c01c9SMilanka Ringwald  */
37*0b0c01c9SMilanka Ringwald #ifndef MOCK_ATT_SERVER_H
38*0b0c01c9SMilanka Ringwald #define MOCK_ATT_SERVER_H
39*0b0c01c9SMilanka Ringwald 
40*0b0c01c9SMilanka Ringwald #include <stdint.h>
41*0b0c01c9SMilanka Ringwald 
42*0b0c01c9SMilanka Ringwald #if defined __cplusplus
43*0b0c01c9SMilanka Ringwald extern "C" {
44*0b0c01c9SMilanka Ringwald #endif
45*0b0c01c9SMilanka Ringwald 
46*0b0c01c9SMilanka Ringwald #include "ble/att_db.h"
47*0b0c01c9SMilanka Ringwald 
48*0b0c01c9SMilanka Ringwald att_service_handler_t * mock_att_server_get_service(void);
49*0b0c01c9SMilanka Ringwald 
50*0b0c01c9SMilanka Ringwald uint16_t mock_att_service_read_callback(hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size);
51*0b0c01c9SMilanka Ringwald 
52*0b0c01c9SMilanka Ringwald uint16_t mock_att_service_write_callback(hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t transaction_mode, uint16_t offset, const uint8_t *buffer, uint16_t buffer_size);
53*0b0c01c9SMilanka Ringwald 
54*0b0c01c9SMilanka Ringwald #if defined __cplusplus
55*0b0c01c9SMilanka Ringwald }
56*0b0c01c9SMilanka Ringwald #endif
57*0b0c01c9SMilanka Ringwald 
58*0b0c01c9SMilanka Ringwald #endif
59*0b0c01c9SMilanka Ringwald 
60