Delete the first errorcode in the read/write result

This commit is contained in:
fengzero
2022-02-11 11:54:13 +08:00
committed by Parker Liu
parent c4f6d8c710
commit 84accdf861
10 changed files with 547 additions and 631 deletions
+4
View File
@@ -206,6 +206,10 @@ int neu_datatag_pack_add(neu_data_val_t *val, uint16_t index, neu_dtype_e type,
tv = neu_dvalue_new(NEU_DTYPE_ERRORCODE);
neu_dvalue_set_errorcode(tv, *(int32_t *) data);
break;
case NEU_DTYPE_BIT:
tv = neu_dvalue_new(NEU_DTYPE_BIT);
neu_dvalue_set_bit(tv, *(uint8_t *) data);
break;
case NEU_DTYPE_INT8:
tv = neu_dvalue_new(NEU_DTYPE_INT8);
neu_dvalue_set_int8(tv, *(int8_t *) data);
+6
View File
@@ -42,11 +42,17 @@ int neu_json_encode_read_resp(void *json_object, void *param)
.t = p_tag->t,
.v = p_tag->value,
},
{
.name = "error",
.t = NEU_JSON_INT,
.v.val_int = p_tag->error,
},
{
.name = "id",
.t = NEU_JSON_INT,
.v.val_int = p_tag->id,
} };
tag_array = neu_json_encode_array(tag_array, tag_elems,
NEU_JSON_ELEM_SIZE(tag_elems));
p_tag++;