Bluetooth: GATT: Move clear_ccc_cfg for reuse

Move the clear_ccc_cfg function further up to be re-used without a
forward declaration in bt_gatt_service_unregister.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2020-07-28 16:35:22 +02:00 committed by Carles Cufí
commit 2919eac891

View file

@ -947,6 +947,13 @@ static void sc_process(struct k_work *work)
atomic_set_bit(sc->flags, SC_INDICATE_PENDING);
}
static void clear_ccc_cfg(struct bt_gatt_ccc_cfg *cfg)
{
bt_addr_le_copy(&cfg->peer, BT_ADDR_LE_ANY);
cfg->id = 0U;
cfg->value = 0U;
}
#if defined(CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE)
static struct gatt_ccc_store {
struct bt_conn *conn_list[CONFIG_BT_MAX_CONN];
@ -1442,13 +1449,6 @@ struct bt_gatt_attr *bt_gatt_attr_next(const struct bt_gatt_attr *attr)
return next;
}
static void clear_ccc_cfg(struct bt_gatt_ccc_cfg *cfg)
{
bt_addr_le_copy(&cfg->peer, BT_ADDR_LE_ANY);
cfg->id = 0U;
cfg->value = 0U;
}
static struct bt_gatt_ccc_cfg *find_ccc_cfg(const struct bt_conn *conn,
struct _bt_gatt_ccc *ccc)
{