Bluetooth: GATT: Fix regression in lazy loading of CCCs
Fix regression in lazy loading handling of GATT CCCs. Bug introduced by: 00d370b09aa5dd1dc56986989989df6d4dd53bcf The commit failed to account for ccc_set_direct calling ccc_set. Fixes: #29150 Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
c13588a508
commit
34cf1c74c2
1 changed files with 12 additions and 6 deletions
|
@ -4350,11 +4350,6 @@ next:
|
||||||
static int ccc_set(const char *name, size_t len_rd, settings_read_cb read_cb,
|
static int ccc_set(const char *name, size_t len_rd, settings_read_cb read_cb,
|
||||||
void *cb_arg)
|
void *cb_arg)
|
||||||
{
|
{
|
||||||
if (IS_ENABLED(CONFIG_BT_SETTINGS_CCC_LAZY_LOADING)) {
|
|
||||||
/* Only load CCCs on demand */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
|
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
|
||||||
struct ccc_store ccc_store[CCC_STORE_MAX];
|
struct ccc_store ccc_store[CCC_STORE_MAX];
|
||||||
struct ccc_load load;
|
struct ccc_load load;
|
||||||
|
@ -4412,7 +4407,18 @@ static int ccc_set(const char *name, size_t len_rd, settings_read_cb read_cb,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SETTINGS_STATIC_HANDLER_DEFINE(bt_ccc, "bt/ccc", NULL, ccc_set, NULL, NULL);
|
static int ccc_set_cb(const char *name, size_t len_rd, settings_read_cb read_cb,
|
||||||
|
void *cb_arg)
|
||||||
|
{
|
||||||
|
if (IS_ENABLED(CONFIG_BT_SETTINGS_CCC_LAZY_LOADING)) {
|
||||||
|
/* Only load CCCs on demand */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ccc_set(name, len_rd, read_cb, cb_arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
SETTINGS_STATIC_HANDLER_DEFINE(bt_ccc, "bt/ccc", NULL, ccc_set_cb, NULL, NULL);
|
||||||
|
|
||||||
static int ccc_set_direct(const char *key, size_t len, settings_read_cb read_cb,
|
static int ccc_set_direct(const char *key, size_t len, settings_read_cb read_cb,
|
||||||
void *cb_arg, void *param)
|
void *cb_arg, void *param)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue