Metadata handling

group jsdrv_meta

Handle JSON-formatted metadata.

Functions

int32_t jsdrv_meta_syntax_check(const char *meta)

Check the JSON metadata syntax.

Parameters:

meta – The JSON metadata.

Returns:

0 or error code.

int32_t jsdrv_meta_dtype(const char *meta, uint8_t *dtype)

Get the data type.

Parameters:
  • meta – The JSON metadata.

  • dtype[out] The jsdrv_union_e data type.

Returns:

0 or error code.

int32_t jsdrv_meta_default(const char *meta, struct jsdrv_union_s *value)

Get the default value.

Parameters:
  • meta – The JSON metadata.

  • value[out] The parsed default value.

Returns:

0 or error code.

int32_t jsdrv_meta_value(const char *meta, struct jsdrv_union_s *value)

Validate a parameter value using the metadata.

Parameters:
  • meta – The JSON metadata.

  • value[inout] The value, which is modified in place.

Returns:

0 or error code.