Write binary data converted to hexadecimal string representation.
MCO_RET mcorest_api_json_write_hex_string( mcorest_api_json_write_ctx_t *ctx,
const void *data,
size_t len );
ctx
data
len
This function writes binary data converted to hexadecimal string representation. If the string is NULL, writes
null. This is a convenience wrapper for
mcorest_api_json_write_string_begin(),
mcorest_api_json_write_hex_string_part() and
mcorest_api_json_write_string_end().
static void print_hex_string(mcorest_api_json_write_ctx_t *jctx,
const char *s)
{
mcorest_api_json_write_object_begin(jctx);
mcorest_api_json_write_key(jctx, "hex_string_value");
mcorest_api_json_write_hex_string(jctx, s, strlen(s));
...
mcorest_api_json_write_object_end(jctx);
...
}