BUILD_ASSERT(ARRAY_SIZE(opt_descr) > 0); \
if (IS_ENABLED(CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE) && is_config_event(aeh)) { \
static const uint8_t module_id_in_section \
__attribute__((__section__("config_channel_modules"))) = 0; \
uint8_t config_module_id = \
&module_id_in_section - (uint8_t *)__start_config_channel_modules; \
static uint8_t cur_opt_descr; \
\
\
size_t rsp_data_size = 0; \
bool consume = false; \
\
\
return false; \
} \
\
if (event->status == CONFIG_STATUS_SET) { \
BUILD_ASSERT(config_set_fn != NULL); \
event->dyndata.data, \
event->dyndata.size); \
consume = true; \
} \
} else if (event->status == CONFIG_STATUS_FETCH) { \
if (cur_opt_descr < ARRAY_SIZE(opt_descr) + 1) { \
const char *data_ptr; \
\
if (cur_opt_descr == 0) { \
data_ptr = mod_name; \
} else { \
data_ptr = opt_descr[cur_opt_descr - 1];\
} \
rsp_data_size = strlen(data_ptr); \
__ASSERT_NO_MSG(rsp_data_size <= \
sizeof(rsp_data_buf)); \
strncpy((char *) rsp_data_buf, data_ptr, \
rsp_data_size); \
cur_opt_descr++; \
} else { \
rsp_data_size = sizeof(uint8_t); \
cur_opt_descr = 0; \
} \
} else { \
BUILD_ASSERT(config_fetch_fn != NULL); \
rsp_data_buf, \
&rsp_data_size); \
} \
consume = true; \
} \
} \
\
if (consume) { \
struct config_event *rsp = new_config_event(rsp_data_size); \
\
rsp->
status = CONFIG_STATUS_SUCCESS; \
\
if (rsp_data_size > 0) { \
memcpy(rsp->
dyndata.data, rsp_data_buf, rsp_data_size); \
} \
\
APP_EVENT_SUBMIT(rsp); \
} \
\
return consume; \
}
#define CFG_CHAN_RECIPIENT_LOCAL
Definition config_event.h:79
#define OPT_ID_GET(opt_field)
Definition config_event.h:67
#define CONFIG_CHANNEL_FETCHED_DATA_MAX_SIZE
Definition config_event.h:51
#define MOD_FIELD_GET(event_id)
Definition config_event.h:59
#define MODULE_OPT_MODULE_DESCR
Definition config_event.h:70
#define MODULE_DESCR_END_CHAR
Definition config_event.h:73
#define OPT_FIELD_MASK
Definition config_event.h:63
#define OPT_FIELD_GET(event_id)
Definition config_event.h:65
bool is_request
Definition config_event.h:88
uint8_t status
Definition config_event.h:93
uint8_t recipient
Definition config_event.h:92
uint16_t transport_id
Definition config_event.h:87
uint8_t event_id
Definition config_event.h:91
struct event_dyndata dyndata
Definition config_event.h:94
Configuration channel event. Used to forward configuration channel request/response.
Definition config_event.h:84