1 /* 2 * Copyright (c) 2023 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <stdint.h> 8 9 #include <zephyr/kernel.h> 10 #include <zephyr/bluetooth/ead.h> 11 12 #ifndef __EAD_SAMPLE_COMMON_H 13 #define __EAD_SAMPLE_COMMON_H 14 15 struct key_material { 16 uint8_t session_key[BT_EAD_KEY_SIZE]; 17 uint8_t iv[BT_EAD_IV_SIZE]; 18 } __packed; 19 20 #define CUSTOM_SERVICE_TYPE BT_UUID_128_ENCODE(0x2e2b8dc3, 0x06e0, 0x4f93, 0x9bb2, 0x734091c356f0) 21 #define BT_UUID_CUSTOM_SERVICE BT_UUID_DECLARE_128(CUSTOM_SERVICE_TYPE) 22 await_signal(struct k_poll_signal * sig)23static inline void await_signal(struct k_poll_signal *sig) 24 { 25 struct k_poll_event events[] = { 26 K_POLL_EVENT_INITIALIZER(K_POLL_TYPE_SIGNAL, K_POLL_MODE_NOTIFY_ONLY, sig), 27 }; 28 29 k_poll(events, ARRAY_SIZE(events), K_FOREVER); 30 } 31 32 #endif /* __EAD_SAMPLE_COMMON_H */ 33