Improvements with debug details
FossilOrigin-Name: fb15ceffecddd7b8356e0f2cfde238d5328b09ba578c8670b217f761acf7ed37
This commit is contained in:
parent
7128df99a3
commit
8dd91ab6af
@ -41,6 +41,7 @@ struct wtpman{
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
struct wtp{
|
||||
|
||||
|
||||
@ -48,6 +49,8 @@ struct wtp{
|
||||
|
||||
|
||||
//extern void wtpman_run(void *arg);
|
||||
*/
|
||||
|
||||
extern struct wtpman * wtpman_create();
|
||||
|
||||
extern struct wtpman * wtpman_create(int socklistindex,struct sockaddr * srcaddr);
|
||||
|
@ -11,6 +11,7 @@
|
||||
int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
|
||||
, uint8_t * dst)
|
||||
{
|
||||
char detail[128];
|
||||
struct cw_KTV * elem, search;
|
||||
int start, len;
|
||||
/* Get the element to put */
|
||||
@ -29,8 +30,8 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
|
||||
}
|
||||
if ( params->elemdata->mand) {
|
||||
cw_log(LOG_ERR,
|
||||
"Can't put mandatory element %s %d - (%s) into %s. No value for '%s' found.",
|
||||
vendor, handler->id, handler->name, "nona"
|
||||
"Can't put mandatory element %s %d-(%s) into %s. No value for '%s' found.",
|
||||
vendor, handler->id, handler->name, params->msgdata->name
|
||||
, handler->key
|
||||
);
|
||||
}
|
||||
@ -44,6 +45,13 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
|
||||
return 0;
|
||||
}
|
||||
len = handler->type->put(elem,dst+start);
|
||||
|
||||
|
||||
handler->type->to_str(elem,detail,120);
|
||||
sprintf(params->debug_details, " Value = %s", detail);
|
||||
|
||||
|
||||
|
||||
params->elem = elem;
|
||||
|
||||
/*(cw_put_mbag_item(dst + start, item);*/
|
||||
|
@ -38,6 +38,7 @@
|
||||
*/
|
||||
int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
||||
{
|
||||
char details[1024];
|
||||
uint8_t *msgptr,*dst;
|
||||
int type;
|
||||
struct cw_MsgData * msg;
|
||||
@ -87,11 +88,17 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
||||
params.conn=conn;
|
||||
params.elemdata = data;
|
||||
params.elem=NULL;
|
||||
params.msgdata=msg;
|
||||
params.debug_details=details;
|
||||
*details=0;
|
||||
|
||||
l = handler->put(handler,¶ms,dst+len);
|
||||
|
||||
if(l>0)
|
||||
cw_dbg_elem(DBG_ELEM_OUT,conn,type,handler,dst+len,l);
|
||||
if (strlen(details)){
|
||||
cw_dbg(DBG_ELEM_DETAIL," %s",params.debug_details);
|
||||
}
|
||||
len += l;
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,9 @@ static int put(const cw_KTV_t *data, uint8_t * dst)
|
||||
|
||||
static int to_str(const cw_KTV_t *data, char *dst, int max_len)
|
||||
{
|
||||
if (max_len<3){
|
||||
return 0;
|
||||
}
|
||||
return sprintf(dst, "%d", data->val.byte);
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@ struct cw_ElemHandlerParams {
|
||||
struct sockaddr *from;
|
||||
mavl_t mand_found;
|
||||
cw_KTV_t * elem;
|
||||
char * debug_details;
|
||||
};
|
||||
|
||||
struct cw_ElemHandler {
|
||||
|
Loading…
Reference in New Issue
Block a user