actube/src/cw/cw_in_generic_with_index.c

18 lines
442 B
C
Raw Normal View History

#include "cw.h"
2022-08-13 09:47:12 +02:00
#include "dbg.h"
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];
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
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);
return 1;
}