1 /*  Bluetooth Audio Content Control */
2 
3 /*
4  * Copyright (c) 2020 Bose Corporation
5  * Copyright (c) 2021 Nordic Semiconductor ASA
6  *
7  * SPDX-License-Identifier: Apache-2.0
8  */
9 
10 #include "ccid_internal.h"
11 
bt_ccid_get_value(void)12 uint8_t bt_ccid_get_value(void)
13 {
14 	static uint8_t ccid_value;
15 
16 	/* By spec, the CCID can take all values up to and including 0xFF.
17 	 * But since this is a value we provide, we do not have to use all of
18 	 * them.  254 CCID values on a device should be plenty, the last one
19 	 * can be used to prevent wraparound.
20 	 */
21 	__ASSERT(ccid_value != UINT8_MAX,
22 		 "Cannot allocate any more control control IDs");
23 
24 	return ccid_value++;
25 }
26