xref: /btstack/platform/daemon/src/btstack_server.h (revision 2fca4dad957cd7b88f4657ed51e89c12615dda72)
1ee252d54SMatthias Ringwald /*
2ee252d54SMatthias Ringwald  * Copyright (C) 2018 BlueKitchen GmbH
3ee252d54SMatthias Ringwald  *
4ee252d54SMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
5ee252d54SMatthias Ringwald  * modification, are permitted provided that the following conditions
6ee252d54SMatthias Ringwald  * are met:
7ee252d54SMatthias Ringwald  *
8ee252d54SMatthias Ringwald  * 1. Redistributions of source code must retain the above copyright
9ee252d54SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer.
10ee252d54SMatthias Ringwald  * 2. Redistributions in binary form must reproduce the above copyright
11ee252d54SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer in the
12ee252d54SMatthias Ringwald  *    documentation and/or other materials provided with the distribution.
13ee252d54SMatthias Ringwald  * 3. Neither the name of the copyright holders nor the names of
14ee252d54SMatthias Ringwald  *    contributors may be used to endorse or promote products derived
15ee252d54SMatthias Ringwald  *    from this software without specific prior written permission.
16ee252d54SMatthias Ringwald  * 4. Any redistribution, use, or modification is done solely for
17ee252d54SMatthias Ringwald  *    personal benefit and not for any commercial purpose or for
18ee252d54SMatthias Ringwald  *    monetary gain.
19ee252d54SMatthias Ringwald  *
20ee252d54SMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
21ee252d54SMatthias Ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22ee252d54SMatthias Ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23*2fca4dadSMilanka Ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN
24*2fca4dadSMilanka Ringwald  * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25ee252d54SMatthias Ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26ee252d54SMatthias Ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27ee252d54SMatthias Ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28ee252d54SMatthias Ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29ee252d54SMatthias Ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30ee252d54SMatthias Ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31ee252d54SMatthias Ringwald  * SUCH DAMAGE.
32ee252d54SMatthias Ringwald  *
33ee252d54SMatthias Ringwald  * Please inquire about commercial licensing options at
34ee252d54SMatthias Ringwald  * [email protected]
35ee252d54SMatthias Ringwald  *
36ee252d54SMatthias Ringwald  */
37ee252d54SMatthias Ringwald 
38ee252d54SMatthias Ringwald 
39ee252d54SMatthias Ringwald /*
40ee252d54SMatthias Ringwald  *  btstack_server.h
41ee252d54SMatthias Ringwald  *
42ee252d54SMatthias Ringwald  *  BTstack server for use either standalone or inside an application process
43ee252d54SMatthias Ringwald  *
44ee252d54SMatthias Ringwald  */
45ee252d54SMatthias Ringwald 
4680e33422SMatthias Ringwald #ifndef BTSTACK_SERVER_H
4780e33422SMatthias Ringwald #define BTSTACK_SERVER_H
48ee252d54SMatthias Ringwald 
49ee252d54SMatthias Ringwald /**
50ee252d54SMatthias Ringwald  * @brief Start BTstack Server either with TCP or Unix Domain Socket
51ee252d54SMatthias Ringwald  * @param tcp_flag 1=start TCP Server, 0=start Unix Socket Server
52ee252d54SMatthias Ringwald  * @returns 0 on success
53ee252d54SMatthias Ringwald  */
54ee252d54SMatthias Ringwald int btstack_server_run(int tcp_flag);
55ee252d54SMatthias Ringwald 
56ee252d54SMatthias Ringwald /**
57ee252d54SMatthias Ringwald  * @brief Start BTstack Server with TCP Socket
58ee252d54SMatthias Ringwald  * @param tcp_flag 1=start TCP Server, 0=start Unix Socket Server
59ee252d54SMatthias Ringwald  * @returns 0 on success
60ee252d54SMatthias Ringwald  */
61ee252d54SMatthias Ringwald int btstack_server_run_tcp(void);
62ee252d54SMatthias Ringwald 
636cf7652eSMatthias Ringwald /**
646cf7652eSMatthias Ringwald  * @brief Set path for BTstack for packet log and persistent data
656cf7652eSMatthias Ringwald  * @brief Defaults to /tmp
666cf7652eSMatthias Ringwald  * @param poath
676cf7652eSMatthias Ringwald  */
686cf7652eSMatthias Ringwald void btstack_server_set_storage_path(const char * path);
696cf7652eSMatthias Ringwald 
70ee252d54SMatthias Ringwald #endif
71