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