zephyr/subsys/bluetooth/audio/ccid.c
Asbjørn Sæbø 3b44a6d4aa Bluetooth: Audio: CCID - updates for upmerge
Updates to the CCID module for upmerge to Zephyr main

- add bt_ prefix to the ccid_get() function, add explaining comment,
  use defined value for limit
- update copyright statement
- update Kconfig to current practice

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2021-11-02 13:23:42 +01:00

26 lines
632 B
C

/* Bluetooth Audio Content Control */
/*
* Copyright (c) 2020 Bose Corporation
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "ccid_internal.h"
uint8_t bt_ccid_get_value(void)
{
static uint8_t ccid_value;
/* By spec, the CCID can take all values up to and including 0xFF.
* But since this is a value we provide, we do not have to use all of
* them. 254 CCID values on a device should be plenty, the last one
* can be used to prevent wraparound.
*/
__ASSERT(ccid_value != UINT8_MAX,
"Cannot allocate any more control control IDs");
return ccid_value++;
}