40 perror(
"Failed to create lite3_ctx *ctx");
49 perror(
"Failed to build message");
52 printf(
"buflen: %zu\n", ctx->buflen);
54 perror(
"Failed to print JSON");
58 printf(
"\nUpdating lap count\n");
60 perror(
"Failed to update lap count");
63 printf(
"Data to send:\n");
64 printf(
"buflen: %zu\n", ctx->buflen);
66 perror(
"Failed to print JSON");
73 perror(
"Failed create lite3_ctx *rx");
78 printf(
"\nVerifying fastest lap\n");
81 perror(
"Failed to verify lap");
84 printf(
"Modified data:\n");
85 printf(
"rx_buflen: %zu\n", rx->buflen);
87 perror(
"Failed to print JSON");
static int lite3_ctx_init_obj(lite3_ctx *ctx)
Initialize a Lite³ context as an object.
static int lite3_ctx_json_print(lite3_ctx *ctx, size_t ofs)
Print Lite³ buffer as JSON to stdout
static lite3_ctx * lite3_ctx_create(void)
Create context with minimum size.
void lite3_ctx_destroy(lite3_ctx *ctx)
Destroy context.
lite3_ctx * lite3_ctx_create_from_buf(const unsigned char *buf, size_t buflen)
Create context by copying from a buffer.
#define lite3_ctx_set_i64(ctx, ofs, key, value)
Set integer in object.
#define lite3_ctx_set_bool(ctx, ofs, key, value)
Set boolean in object.
#define lite3_ctx_set_f64(ctx, ofs, key, value)
Set floating point in object.
#define lite3_ctx_set_str(ctx, ofs, key, str)
Set string in object.
Lite³ Context API Header.