Loading...
Searching...
No Matches
nimble_riot.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
20
21#include <stdbool.h>
22#include <stdint.h>
23#include "kernel_defines.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
34#ifndef NIMBLE_CONTROLLER_PRIO
35#define NIMBLE_CONTROLLER_PRIO (0)
36#endif
37
41#ifndef NIMBLE_CONTROLLER_STACKSIZE
42#define NIMBLE_CONTROLLER_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
43#endif
44
48#ifndef NIMBLE_HOST_PRIO
49#if IS_USED(MODULE_NIMBLE_NETIF)
50/* when using IP, the host should have a higher prio than the netif thread, but
51 * MUST always have a lower priority then the controller thread. Setting it to
52 * controller prio plus will guarantee the latter while also matching the first
53 * condition as long as the default netif prio is not changed. */
54#define NIMBLE_HOST_PRIO (NIMBLE_CONTROLLER_PRIO + 1)
55#else
56#define NIMBLE_HOST_PRIO (THREAD_PRIORITY_MAIN - 2)
57#endif
58#endif
59
63#ifndef NIMBLE_HOST_STACKSIZE
64#define NIMBLE_HOST_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
65#endif
66
70typedef enum {
73#if IS_USED(MODULE_NIMBLE_PHY_2MBIT)
74 NIMBLE_PHY_2M,
75#endif
76#if IS_USED(MODULE_NIMBLE_PHY_CODED)
77 NIMBLE_PHY_CODED,
78#endif
80
84extern uint8_t nimble_riot_own_addr_type;
85
99extern bool nimble_port_initialized;
100
105
111#if MYNEWT_VAL_BLE_EXT_ADV
112int nimble_riot_get_phy_hci(uint8_t mode);
113#endif
114
115#ifdef __cplusplus
116}
117#endif
118
bool nimble_port_initialized
Indicates whether Setup NimBLE's controller has been initialized.
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:70
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:72
@ NIMBLE_PHY_INVALID
PHY mode invalid.
Definition nimble_riot.h:71
Common macros and compiler attributes/pragmas configuration.