samples: bluetooth: rename shadow variables

Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2023-08-09 14:02:47 -07:00 committed by Carles Cufí
commit eedc0bf0fa
14 changed files with 79 additions and 79 deletions

View file

@ -23,7 +23,7 @@ static void start_scan(void);
static struct bt_conn *default_conn;
static struct bt_uuid_16 uuid = BT_UUID_INIT_16(0);
static struct bt_uuid_16 discover_uuid = BT_UUID_INIT_16(0);
static struct bt_gatt_discover_params discover_params;
static struct bt_gatt_subscribe_params subscribe_params;
@ -57,8 +57,8 @@ static uint8_t discover_func(struct bt_conn *conn,
printk("[ATTRIBUTE] handle %u\n", attr->handle);
if (!bt_uuid_cmp(discover_params.uuid, BT_UUID_HRS)) {
memcpy(&uuid, BT_UUID_HRS_MEASUREMENT, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
memcpy(&discover_uuid, BT_UUID_HRS_MEASUREMENT, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
@ -68,8 +68,8 @@ static uint8_t discover_func(struct bt_conn *conn,
}
} else if (!bt_uuid_cmp(discover_params.uuid,
BT_UUID_HRS_MEASUREMENT)) {
memcpy(&uuid, BT_UUID_GATT_CCC, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
memcpy(&discover_uuid, BT_UUID_GATT_CCC, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 2;
discover_params.type = BT_GATT_DISCOVER_DESCRIPTOR;
subscribe_params.value_handle = bt_gatt_attr_value_handle(attr);
@ -202,8 +202,8 @@ static void connected(struct bt_conn *conn, uint8_t conn_err)
printk("Connected: %s\n", addr);
if (conn == default_conn) {
memcpy(&uuid, BT_UUID_HRS, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
memcpy(&discover_uuid, BT_UUID_HRS, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.func = discover_func;
discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE;
discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE;

View file

@ -23,7 +23,7 @@
static int scan_start(void);
static struct bt_conn *default_conn;
static struct bt_uuid_16 uuid = BT_UUID_INIT_16(0);
static struct bt_uuid_16 discover_uuid = BT_UUID_INIT_16(0);
static struct bt_gatt_discover_params discover_params;
static struct bt_gatt_subscribe_params subscribe_params;
@ -84,8 +84,8 @@ static uint8_t discover_func(struct bt_conn *conn,
printk("[ATTRIBUTE] handle %u\n", attr->handle);
if (!bt_uuid_cmp(discover_params.uuid, BT_UUID_HTS)) {
memcpy(&uuid, BT_UUID_HTS_MEASUREMENT, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
memcpy(&discover_uuid, BT_UUID_HTS_MEASUREMENT, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
@ -95,8 +95,8 @@ static uint8_t discover_func(struct bt_conn *conn,
}
} else if (!bt_uuid_cmp(discover_params.uuid,
BT_UUID_HTS_MEASUREMENT)) {
memcpy(&uuid, BT_UUID_GATT_CCC, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
memcpy(&discover_uuid, BT_UUID_GATT_CCC, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 2;
discover_params.type = BT_GATT_DISCOVER_DESCRIPTOR;
subscribe_params.value_handle = bt_gatt_attr_value_handle(attr);
@ -143,8 +143,8 @@ static void connected(struct bt_conn *conn, uint8_t conn_err)
printk("Connected: %s\n", addr);
if (conn == default_conn) {
memcpy(&uuid, BT_UUID_HTS, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
memcpy(&discover_uuid, BT_UUID_HTS, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.func = discover_func;
discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE;
discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE;

View file

@ -45,7 +45,7 @@ static int on_obj_data_read(struct bt_ots_client *ots_inst, struct bt_conn *conn
uint32_t len, uint8_t *data_p, bool is_complete);
static void start_scan(void);
static struct bt_uuid_16 uuid = BT_UUID_INIT_16(0);
static struct bt_uuid_16 discover_uuid = BT_UUID_INIT_16(0);
static struct bt_conn *default_conn;
static atomic_t discovery_state;
@ -371,8 +371,8 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at
}
if (bt_uuid_cmp(discover_params.uuid, BT_UUID_OTS) == 0) {
(void)memcpy(&uuid, BT_UUID_OTS_FEATURE, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
(void)memcpy(&discover_uuid, BT_UUID_OTS_FEATURE, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
err = bt_gatt_discover(conn, &discover_params);
@ -384,8 +384,8 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at
} else if (bt_uuid_cmp(discover_params.uuid, BT_UUID_OTS_FEATURE) == 0) {
atomic_set_bit(&discovery_state, DISC_OTS_FEATURE);
otc.feature_handle = bt_gatt_attr_value_handle(attr);
(void)memcpy(&uuid, BT_UUID_OTS_NAME, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
(void)memcpy(&discover_uuid, BT_UUID_OTS_NAME, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
@ -397,8 +397,8 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at
} else if (bt_uuid_cmp(discover_params.uuid, BT_UUID_OTS_NAME) == 0) {
atomic_set_bit(&discovery_state, DISC_OTS_NAME);
otc.obj_name_handle = bt_gatt_attr_value_handle(attr);
(void)memcpy(&uuid, BT_UUID_OTS_TYPE, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
(void)memcpy(&discover_uuid, BT_UUID_OTS_TYPE, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
@ -410,8 +410,8 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at
} else if (bt_uuid_cmp(discover_params.uuid, BT_UUID_OTS_TYPE) == 0) {
atomic_set_bit(&discovery_state, DISC_OTS_TYPE);
otc.obj_type_handle = bt_gatt_attr_value_handle(attr);
(void)memcpy(&uuid, BT_UUID_OTS_SIZE, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
(void)memcpy(&discover_uuid, BT_UUID_OTS_SIZE, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
@ -423,8 +423,8 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at
} else if (bt_uuid_cmp(discover_params.uuid, BT_UUID_OTS_SIZE) == 0) {
atomic_set_bit(&discovery_state, DISC_OTS_SIZE);
otc.obj_size_handle = bt_gatt_attr_value_handle(attr);
(void)memcpy(&uuid, BT_UUID_OTS_ID, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
(void)memcpy(&discover_uuid, BT_UUID_OTS_ID, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
@ -436,8 +436,8 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at
} else if (bt_uuid_cmp(discover_params.uuid, BT_UUID_OTS_ID) == 0) {
atomic_set_bit(&discovery_state, DISC_OTS_ID);
otc.obj_id_handle = bt_gatt_attr_value_handle(attr);
(void)memcpy(&uuid, BT_UUID_OTS_PROPERTIES, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
(void)memcpy(&discover_uuid, BT_UUID_OTS_PROPERTIES, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
@ -449,8 +449,8 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at
} else if (bt_uuid_cmp(discover_params.uuid, BT_UUID_OTS_PROPERTIES) == 0) {
atomic_set_bit(&discovery_state, DISC_OTS_PROPERTIES);
otc.obj_properties_handle = bt_gatt_attr_value_handle(attr);
(void)memcpy(&uuid, BT_UUID_OTS_ACTION_CP, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
(void)memcpy(&discover_uuid, BT_UUID_OTS_ACTION_CP, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
@ -461,8 +461,8 @@ static uint8_t discover_func(struct bt_conn *conn, const struct bt_gatt_attr *at
} else if (bt_uuid_cmp(discover_params.uuid, BT_UUID_OTS_ACTION_CP) == 0) {
atomic_set_bit(&discovery_state, DISC_OTS_ACTION_CP);
otc.oacp_handle = bt_gatt_attr_value_handle(attr);
(void)memcpy(&uuid, BT_UUID_OTS_LIST_CP, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
(void)memcpy(&discover_uuid, BT_UUID_OTS_LIST_CP, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.start_handle = attr->handle + 1;
discover_params.type = BT_GATT_DISCOVER_CHARACTERISTIC;
@ -517,8 +517,8 @@ static void connected(struct bt_conn *conn, uint8_t err)
printk("Connected: %s\n", addr);
if (conn == default_conn) {
(void)memcpy(&uuid, BT_UUID_OTS, sizeof(uuid));
discover_params.uuid = &uuid.uuid;
(void)memcpy(&discover_uuid, BT_UUID_OTS, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;
discover_params.func = discover_func;
discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE;
discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE;

View file

@ -31,7 +31,7 @@
#define ADV_DATA_HEX_STR_LEN_MAX (BT_GAP_ADV_MAX_EXT_ADV_DATA_LEN * 2 + 1)
static struct bt_le_per_adv_sync_param sync_create_param;
static struct bt_le_per_adv_sync *sync;
static struct bt_le_per_adv_sync *adv_sync;
static bt_addr_le_t per_addr;
static bool per_adv_found;
static bool scan_enabled;
@ -264,7 +264,7 @@ static void create_sync(void)
sync_create_param.sid = per_sid;
sync_create_param.skip = 0;
sync_create_param.timeout = 0xaa;
err = bt_le_per_adv_sync_create(&sync_create_param, &sync);
err = bt_le_per_adv_sync_create(&sync_create_param, &adv_sync);
if (err != 0) {
printk("failed (err %d)\n", err);
return;
@ -277,7 +277,7 @@ static int delete_sync(void)
int err;
printk("Deleting Periodic Advertising Sync...");
err = bt_le_per_adv_sync_delete(sync);
err = bt_le_per_adv_sync_delete(adv_sync);
if (err != 0) {
printk("failed (err %d)\n", err);
return err;
@ -304,7 +304,7 @@ static void enable_cte_rx(void)
};
printk("Enable receiving of CTE...\n");
err = bt_df_per_adv_sync_cte_rx_enable(sync, &cte_rx_params);
err = bt_df_per_adv_sync_cte_rx_enable(adv_sync, &cte_rx_params);
if (err != 0) {
printk("failed (err %d)\n", err);
return;

View file

@ -18,14 +18,14 @@
static struct bt_csip_set_member_svc_inst *svc_inst;
static void csip_lock_changed_cb(struct bt_conn *conn,
struct bt_csip_set_member_svc_inst *svc_inst,
struct bt_csip_set_member_svc_inst *inst,
bool locked)
{
printk("Client %p %s the lock\n", conn, locked ? "locked" : "released");
}
static uint8_t sirk_read_req_cb(struct bt_conn *conn,
struct bt_csip_set_member_svc_inst *svc_inst)
struct bt_csip_set_member_svc_inst *inst)
{
return BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT;
}

View file

@ -51,7 +51,7 @@ static const struct bt_data ad[] = {
};
static struct k_work_delayable adv_work;
static struct bt_le_ext_adv *adv;
static struct bt_le_ext_adv *ext_adv;
static void disconnected(struct bt_conn *conn, uint8_t reason)
{
@ -101,14 +101,14 @@ static void adv_work_handler(struct k_work *work)
{
int err;
if (adv == NULL) {
if (ext_adv == NULL) {
/* Create a non-connectable non-scannable advertising set */
err = bt_le_ext_adv_create(BT_LE_EXT_ADV_CONN_NAME, &adv_cb, &adv);
err = bt_le_ext_adv_create(BT_LE_EXT_ADV_CONN_NAME, &adv_cb, &ext_adv);
if (err) {
printk("Failed to create advertising set (err %d)\n", err);
}
err = bt_le_ext_adv_set_data(adv, ad, ARRAY_SIZE(ad), NULL, 0);
err = bt_le_ext_adv_set_data(ext_adv, ad, ARRAY_SIZE(ad), NULL, 0);
if (err) {
printk("Failed to set advertising data (err %d)\n", err);
}
@ -116,7 +116,7 @@ static void adv_work_handler(struct k_work *work)
__ASSERT_NO_MSG(err == 0);
}
err = bt_le_ext_adv_start(adv, BT_LE_EXT_ADV_START_DEFAULT);
err = bt_le_ext_adv_start(ext_adv, BT_LE_EXT_ADV_START_DEFAULT);
if (err) {
printk("Failed to start advertising set (err %d)\n", err);
} else {

View file

@ -36,7 +36,7 @@ static const struct bt_data ad[] = {
static struct k_thread pwr_thread_data;
static K_THREAD_STACK_DEFINE(pwr_thread_stack, 512);
static const int8_t txp[DEVICE_BEACON_TXPOWER_NUM] = {4, 0, -3, -8,
static const int8_t txpower[DEVICE_BEACON_TXPOWER_NUM] = {4, 0, -3, -8,
-15, -18, -23, -30};
static const struct bt_le_adv_param *param =
BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_USE_NAME,
@ -235,9 +235,9 @@ void modulate_tx_power(void *p1, void *p2, void *p3)
while (1) {
if (!default_conn) {
printk("Set Tx power level to %d\n", txp[idx]);
printk("Set Tx power level to %d\n", txpower[idx]);
set_tx_power(BT_HCI_VS_LL_HANDLE_TYPE_ADV,
0, txp[idx]);
0, txpower[idx]);
k_sleep(K_SECONDS(5));

View file

@ -63,7 +63,7 @@ static struct bt_mesh_elem elements[] = {
BT_MESH_ELEM(0, root_models, BT_MESH_MODEL_NONE),
};
static const struct bt_mesh_comp comp = {
static const struct bt_mesh_comp mesh_comp = {
.cid = BT_COMP_ID_LF,
.elem = elements,
.elem_count = ARRAY_SIZE(elements),
@ -243,7 +243,7 @@ static void unprovisioned_beacon(uint8_t uuid[16],
k_sem_give(&sem_unprov_beacon);
}
static void node_added(uint16_t net_idx, uint8_t uuid[16], uint16_t addr, uint8_t num_elem)
static void node_added(uint16_t idx, uint8_t uuid[16], uint16_t addr, uint8_t num_elem)
{
node_addr = addr;
k_sem_give(&sem_node_added);
@ -260,7 +260,7 @@ static int bt_ready(void)
uint8_t net_key[16], dev_key[16];
int err;
err = bt_mesh_init(&prov, &comp);
err = bt_mesh_init(&prov, &mesh_comp);
if (err) {
printk("Initializing mesh failed (err %d)\n", err);
return err;

View file

@ -77,7 +77,7 @@
/* Cycling Speed and Cadence Service declaration */
static uint32_t cwr; /* Cumulative Wheel Revolutions */
static uint32_t c_wheel_revs; /* Cumulative Wheel Revolutions */
static uint8_t supported_locations[] = CSC_SUPPORTED_LOCATIONS;
static uint8_t sensor_location; /* Current Sensor Location */
static bool csc_simulate;
@ -150,7 +150,7 @@ static ssize_t write_ctrl_point(struct bt_conn *conn,
break;
}
cwr = sys_le32_to_cpu(req->cwr);
c_wheel_revs = sys_le32_to_cpu(req->cwr);
status = SC_CP_RSP_SUCCESS;
break;
case SC_CP_OP_UPDATE_LOC:
@ -310,7 +310,7 @@ static void csc_simulation(void)
/* Measurements don't have to be updated every second */
if (!(i % 2)) {
lwet += 1050 + rand % 50;
cwr += 2U;
c_wheel_revs += 2U;
nfy_wheel = true;
}
@ -326,7 +326,7 @@ static void csc_simulation(void)
* and is determined by the Server and not required to be configurable
* by the Client.
*/
measurement_nfy(NULL, nfy_wheel ? cwr : 0, nfy_wheel ? lwet : 0,
measurement_nfy(NULL, nfy_wheel ? c_wheel_revs : 0, nfy_wheel ? lwet : 0,
nfy_crank ? ccr : 0, nfy_crank ? lcet : 0);
/*

View file

@ -74,7 +74,7 @@ static const struct bt_data ad[] = {
};
/* BLE connection */
struct bt_conn *conn;
struct bt_conn *ble_conn;
/* Notification state */
volatile bool notify_enable;
@ -116,7 +116,7 @@ static void button_callback(const struct device *gpiob, struct gpio_callback *cb
int err;
LOG_INF("Button pressed");
if (conn) {
if (ble_conn) {
if (notify_enable) {
err = bt_gatt_notify(NULL, &stsensor_svc.attrs[4],
&but_val, sizeof(but_val));
@ -157,17 +157,17 @@ static void connected(struct bt_conn *connected, uint8_t err)
LOG_ERR("Connection failed (err %u)", err);
} else {
LOG_INF("Connected");
if (!conn) {
conn = bt_conn_ref(connected);
if (!ble_conn) {
ble_conn = bt_conn_ref(connected);
}
}
}
static void disconnected(struct bt_conn *disconn, uint8_t reason)
{
if (conn) {
bt_conn_unref(conn);
conn = NULL;
if (ble_conn) {
bt_conn_unref(ble_conn);
ble_conn = NULL;
}
LOG_INF("Disconnected (reason %u)", reason);

View file

@ -47,7 +47,7 @@ struct bt_cap_initiator_broadcast_stream_param stream_params;
struct bt_cap_initiator_broadcast_subgroup_param subgroup_param;
struct bt_cap_initiator_broadcast_create_param create_param;
struct bt_cap_broadcast_source *broadcast_source;
struct bt_le_ext_adv *adv;
struct bt_le_ext_adv *ext_adv;
static uint8_t tmap_addata[] = {
BT_UUID_16_ENCODE(BT_UUID_TMAS_VAL), /* TMAS UUID */
@ -273,7 +273,7 @@ void cap_initiator_setup(void)
}
printk("Creating broadcast source\n");
err = setup_extended_adv(&adv);
err = setup_extended_adv(&ext_adv);
if (err != 0) {
printk("Unable to setup extended advertiser: %d\n", err);
return;
@ -285,19 +285,19 @@ void cap_initiator_setup(void)
return;
}
err = bt_cap_initiator_broadcast_audio_start(broadcast_source, adv);
err = bt_cap_initiator_broadcast_audio_start(broadcast_source, ext_adv);
if (err != 0) {
printk("Unable to start broadcast source: %d\n", err);
return;
}
err = setup_extended_adv_data(broadcast_source, adv);
err = setup_extended_adv_data(broadcast_source, ext_adv);
if (err != 0) {
printk("Unable to setup extended advertising data: %d\n", err);
return;
}
err = start_extended_adv(adv);
err = start_extended_adv(ext_adv);
if (err != 0) {
printk("Unable to start extended advertiser: %d\n", err);
return;
@ -337,7 +337,7 @@ void cap_initiator_setup(void)
}
broadcast_source = NULL;
err = stop_and_delete_extended_adv(adv);
err = stop_and_delete_extended_adv(ext_adv);
if (err != 0) {
printk("Failed to stop and delete extended advertising: %d\n", err);
return;

View file

@ -8,7 +8,7 @@
#include <zephyr/bluetooth/audio/audio.h>
#include <zephyr/bluetooth/audio/vcp.h>
static struct bt_vcp_vol_ctlr *vol_ctlr;
static struct bt_vcp_vol_ctlr *vcp_vol_ctlr;
static void vcs_discover_cb(struct bt_vcp_vol_ctlr *vol_ctlr, int err,
uint8_t vocs_count, uint8_t aics_count)
@ -66,7 +66,7 @@ static int process_profile_connection(struct bt_conn *conn)
{
int err = 0;
err = bt_vcp_vol_ctlr_discover(conn, &vol_ctlr);
err = bt_vcp_vol_ctlr_discover(conn, &vcp_vol_ctlr);
if (err != 0) {
printk("bt_vcp_vol_ctlr_discover (err %d)\n", err);
@ -107,8 +107,8 @@ int vcp_vol_ctlr_mute(void)
{
int err;
if (vol_ctlr != NULL) {
err = bt_vcp_vol_ctlr_mute(vol_ctlr);
if (vcp_vol_ctlr != NULL) {
err = bt_vcp_vol_ctlr_mute(vcp_vol_ctlr);
} else {
err = -EINVAL;
}
@ -120,8 +120,8 @@ int vcp_vol_ctlr_unmute(void)
{
int err;
if (vol_ctlr != NULL) {
err = bt_vcp_vol_ctlr_unmute(vol_ctlr);
if (vcp_vol_ctlr != NULL) {
err = bt_vcp_vol_ctlr_unmute(vcp_vol_ctlr);
} else {
err = -EINVAL;
}
@ -133,8 +133,8 @@ int vcp_vol_ctlr_set_vol(uint8_t volume)
{
int err;
if (vol_ctlr != NULL) {
err = bt_vcp_vol_ctlr_set_vol(vol_ctlr, volume);
if (vcp_vol_ctlr != NULL) {
err = bt_vcp_vol_ctlr_set_vol(vcp_vol_ctlr, volume);
} else {
err = -EINVAL;
}

View file

@ -235,8 +235,8 @@ static int lc3_metadata(struct bt_bap_stream *stream, const struct bt_audio_code
}
if (data->data.type == BT_AUDIO_METADATA_TYPE_CCID_LIST) {
for (uint8_t i = 0; i < data->data.data_len; i++) {
const uint8_t ccid = data->data.data[i];
for (uint8_t j = 0; j < data->data.data_len; j++) {
const uint8_t ccid = data->data.data[j];
if (!(IS_ENABLED(CONFIG_BT_TBS_CLIENT_CCID) &&
bt_tbs_client_get_by_ccid(default_conn, ccid) != NULL)) {

View file

@ -16,7 +16,7 @@
static struct bt_csip_set_member_svc_inst *svc_inst;
static void csip_lock_changed_cb(struct bt_conn *conn,
struct bt_csip_set_member_svc_inst *svc_inst,
struct bt_csip_set_member_svc_inst *inst,
bool locked)
{
printk("Client %p %s the lock\n", conn, locked ? "locked" : "released");