2018-04-20 05:46:50 +02:00
|
|
|
#include "cw.h"
|
2022-08-13 09:47:12 +02:00
|
|
|
#include "dbg.h"
|
2018-04-20 05:46:50 +02:00
|
|
|
|
|
|
|
int cw_in_generic_with_index(struct cw_ElemHandler *eh,
|
|
|
|
struct cw_ElemHandlerParams *params,
|
|
|
|
uint8_t * data, int len)
|
|
|
|
{
|
2022-08-14 12:26:34 +02:00
|
|
|
char key[CW_CFG_MAX_KEY_LEN];
|
2018-04-20 05:46:50 +02:00
|
|
|
int idx;
|
2022-08-19 22:23:55 +02:00
|
|
|
struct cw_Type * type = (struct cw_Type*)eh->type;
|
2022-08-13 09:47:12 +02:00
|
|
|
|
2018-04-20 05:46:50 +02:00
|
|
|
idx = cw_get_byte(data);
|
|
|
|
sprintf(key,"%s.%d",eh->key,idx);
|
2022-08-13 09:47:12 +02:00
|
|
|
// cw_cfg_add(params->cfg,key,eh->type,NULL,data+1,len-1);
|
2022-08-19 22:23:55 +02:00
|
|
|
type->read(params->cfg,key,data+1,len-1,eh->param);
|
2018-04-20 05:46:50 +02:00
|
|
|
return 1;
|
|
|
|
}
|