libtrap
1.16.1
|
Enumerations | |
enum | trap_data_format_t { TRAP_FMT_UNKNOWN = 0, TRAP_FMT_RAW = 1, TRAP_FMT_UNIREC = 2, TRAP_FMT_JSON = 3 } |
enum | trap_in_ifc_state_t { FMT_WAITING = 0, FMT_OK = 1, FMT_MISMATCH = 2, FMT_CHANGED = 3 } |
Functions | |
void | trap_set_data_fmt (uint32_t out_ifc_idx, uint8_t data_type,...) |
int | trap_set_required_fmt (uint32_t in_ifc_idx, uint8_t data_type,...) |
int | trap_get_data_fmt (uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec) |
void | trap_ctx_set_data_fmt (trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type,...) |
void | trap_ctx_vset_data_fmt (trap_ctx_t *ctx, uint32_t out_ifc_idx, uint8_t data_type, va_list ap) |
int | trap_ctx_get_in_ifc_state (trap_ctx_t *ctx, uint32_t ifc_idx) |
int | trap_ctx_set_required_fmt (trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type,...) |
int | trap_ctx_vset_required_fmt (trap_ctx_t *ctx, uint32_t in_ifc_idx, uint8_t data_type, va_list ap) |
int | trap_ctx_get_data_fmt (trap_ctx_t *ctx, uint8_t ifc_dir, uint32_t ifc_idx, uint8_t *data_type, const char **spec) |
enum trap_data_format_t |
enum trap_in_ifc_state_t |
Possible states of an IFC during data format negotiation.
int trap_ctx_get_data_fmt | ( | trap_ctx_t * | ctx, |
uint8_t | ifc_dir, | ||
uint32_t | ifc_idx, | ||
uint8_t * | data_type, | ||
const char ** | spec | ||
) |
Get message format and template that is set on IFC.
On output IFC it should return the values that were set. On input IFC it should return format and template that was received. This function is thread safe.
[in] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | ifc_dir | trap_ifc_type direction of interface |
[in] | ifc_idx | Index of IFC. |
[out] | data_type | Format of messages defined by trap_data_format_t. |
[out] | spec | Specifier of data format specifies the template (char *) is expected. |
int trap_ctx_get_in_ifc_state | ( | trap_ctx_t * | ctx, |
uint32_t | ifc_idx | ||
) |
Returns current state of an input interface on specified index.
This function is thread safe.
[in] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | ifc_idx | Index of the input interface |
void trap_ctx_set_data_fmt | ( | trap_ctx_t * | ctx, |
uint32_t | out_ifc_idx, | ||
uint8_t | data_type, | ||
... | |||
) |
Set format of messages on output IFC.
This function is thread safe.
[in,out] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | out_ifc_idx | Index of output IFC. |
[in] | data_type | Format of messages defined by trap_data_format_t. |
[in] | ... | If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected. |
int trap_ctx_set_required_fmt | ( | trap_ctx_t * | ctx, |
uint32_t | in_ifc_idx, | ||
uint8_t | data_type, | ||
... | |||
) |
Set format of messages expected on input IFC.
This function is thread safe.
[in] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | in_ifc_idx | Index of input IFC. |
[in] | data_type | Format of messages defined by trap_data_format_t. |
[in] | ... | If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected. |
void trap_ctx_vset_data_fmt | ( | trap_ctx_t * | ctx, |
uint32_t | out_ifc_idx, | ||
uint8_t | data_type, | ||
va_list | ap | ||
) |
Set format of messages on output IFC.
This function is thread safe.
[in,out] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | out_ifc_idx | Index of output IFC. |
[in] | data_type | Format of messages defined by trap_data_format_t. |
[in] | ap | If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected. |
int trap_ctx_vset_required_fmt | ( | trap_ctx_t * | ctx, |
uint32_t | in_ifc_idx, | ||
uint8_t | data_type, | ||
va_list | ap | ||
) |
Set format of messages expected on input IFC.
This function is thread safe.
[in] | ctx | Pointer to the private libtrap context data (trap_ctx_init()). |
[in] | in_ifc_idx | Index of input IFC. |
[in] | data_type | Format of messages defined by trap_data_format_t. |
[in] | ap | If data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template (char *) is expected. |
int trap_get_data_fmt | ( | uint8_t | ifc_dir, |
uint32_t | ifc_idx, | ||
uint8_t * | data_type, | ||
const char ** | spec | ||
) |
Get message format and template that is set on IFC.
On output IFC it should return the values that were set. On input IFC it should return format and template that was received.
[in] | ifc_dir | trap_ifc_type direction of interface |
[in] | ifc_idx | index of IFC |
[out] | data_type | format of messages defined by trap_data_format_t |
[out] | spec | Template specifier - UniRec specifier in case of TRAP_FMT_UNIREC data_type, otherwise, it can be any string. |
void trap_set_data_fmt | ( | uint32_t | out_ifc_idx, |
uint8_t | data_type, | ||
... | |||
) |
Set format of messages on output IFC.
[in] | out_ifc_idx | index of output IFC |
[in] | data_type | format of messages defined by trap_data_format_t |
[in] | ... | if data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template is expected |
int trap_set_required_fmt | ( | uint32_t | in_ifc_idx, |
uint8_t | data_type, | ||
... | |||
) |
Set format of messages expected on input IFC.
[in] | in_ifc_idx | index of input IFC |
[in] | data_type | format of messages defined by trap_data_format_t |
[in] | ... | if data_type is TRAP_FMT_UNIREC or TRAP_FMT_JSON, additional parameter that specifies template is expected |