nimble_riot.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
22 #ifndef NIMBLE_RIOT_H
23 #define NIMBLE_RIOT_H
24 
25 #include <stdint.h>
26 #include "kernel_defines.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
37 #ifndef NIMBLE_CONTROLLER_PRIO
38 #define NIMBLE_CONTROLLER_PRIO (0)
39 #endif
40 
44 #ifndef NIMBLE_CONTROLLER_STACKSIZE
45 #define NIMBLE_CONTROLLER_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
46 #endif
47 
51 #ifndef NIMBLE_HOST_PRIO
52 #if IS_USED(MODULE_NIMBLE_NETIF)
53 /* when using IP, the host should have a higher prio than the netif thread, but
54  * MUST always have a lower priority then the controller thread. Setting it to
55  * controller prio plus will guarantee the latter while also matching the first
56  * condition as long as the default netif prio is not changed. */
57 #define NIMBLE_HOST_PRIO (NIMBLE_CONTROLLER_PRIO + 1)
58 #else
59 #define NIMBLE_HOST_PRIO (THREAD_PRIORITY_MAIN - 2)
60 #endif
61 #endif
62 
63 
64 
68 #ifndef NIMBLE_HOST_STACKSIZE
69 #define NIMBLE_HOST_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
70 #endif
71 
75 typedef enum {
78 #if IS_USED(MODULE_NIMBLE_PHY_2MBIT)
79  NIMBLE_PHY_2M,
80 #endif
81 #if IS_USED(MODULE_NIMBLE_PHY_CODED)
82  NIMBLE_PHY_CODED,
83 #endif
84 } nimble_phy_t;
85 
89 extern uint8_t nimble_riot_own_addr_type;
90 
94 void nimble_riot_init(void);
95 
101 #if MYNEWT_VAL_BLE_EXT_ADV
102 int nimble_riot_get_phy_hci(uint8_t mode);
103 #endif
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif /* NIMBLE_RIOT_H */
uint8_t nimble_riot_own_addr_type
Export our own address type for later usage.
nimble_phy_t
BLE PHY modes.
Definition: nimble_riot.h:75
void nimble_riot_init(void)
Setup and run NimBLE's controller and host threads.
@ NIMBLE_PHY_1M
legacy 1Mbit PHY mode (always supported)
Definition: nimble_riot.h:77
@ NIMBLE_PHY_INVALID
PHY mode invalid.
Definition: nimble_riot.h:76
Common macros and compiler attributes/pragmas configuration.