1 /**
2  * @file dummy.c
3  * Static compilation checks.
4  */
5 
6 /*
7  * Copyright (c) 2017 Nordic Semiconductor ASA
8  *
9  * SPDX-License-Identifier: Apache-2.0
10  */
11 
12 #include <zephyr/kernel.h>
13 #include <zephyr/bluetooth/bluetooth.h>
14 
15 /*
16  * The unpacked structs below are used inside __packed structures that reflect
17  * what goes on the wire. While alignment is not a problem for those, since all
18  * their members are bytes or byte arrays, the size is. They must not be padded
19  * by the compiler, otherwise the on-wire packet will not map the packed
20  * structure correctly.
21  */
22 BUILD_ASSERT(sizeof(bt_addr_t) == BT_ADDR_SIZE);
23 BUILD_ASSERT(sizeof(bt_addr_le_t) == BT_ADDR_LE_SIZE);
24 
25 #if defined(CONFIG_BT_HCI_HOST)
26 /* The Bluetooth subsystem requires the Tx thread to execute at higher priority
27  * than the Rx thread as the Tx thread needs to process the acknowledgements
28  * before new Rx data is processed. This is a necessity to correctly detect
29  * transaction violations in ATT and SMP protocols.
30  */
31 BUILD_ASSERT(CONFIG_BT_HCI_TX_PRIO < CONFIG_BT_RX_PRIO);
32 
33 /* The Bluetooth subsystem requires that higher priority events shall be given
34  * in a priority higher than the Bluetooth Host's Tx and the Controller's
35  * receive thread priority.
36  * This is required in order to dispatch Number of Completed Packets event
37  * before any new data arrives on a connection to the Host threads.
38  */
39 BUILD_ASSERT(CONFIG_BT_DRIVER_RX_HIGH_PRIO < CONFIG_BT_HCI_TX_PRIO);
40 #endif /* defined(CONFIG_BT_HCI_HOST) */
41 
42 #if (defined(CONFIG_LOG_BACKEND_RTT) &&                     \
43      (defined(CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL) || \
44       defined(CONFIG_LOG_BACKEND_RTT_MODE_BLOCK))) ||       \
45     defined(CONFIG_LOG_BACKEND_NET) ||                      \
46     defined(CONFIG_LOG_IMMEDIATE_CLEAN_OUTPUT)
47 #define INCOMPATIBLE_IMMEDIATE_LOG_BACKEND 1
48 #endif
49 
50 /* Immediate logging on most backend is not supported
51  * with the software-based Link Layer since it introduces ISR latency
52  * due to outputting log messages with interrupts disabled.
53  */
54 #if !defined(CONFIG_TEST) && !defined(CONFIG_ARCH_POSIX) && \
55     defined(CONFIG_BT_LL_SW_SPLIT) &&                       \
56     defined(INCOMPATIBLE_IMMEDIATE_LOG_BACKEND)
57 BUILD_ASSERT(!IS_ENABLED(CONFIG_LOG_MODE_IMMEDIATE), "Immediate logging "
58 	     "on selected backend(s) not "
59 	     "supported with the software Link Layer");
60 #endif
61