libsigrok  unreleased development snapshot
sigrok hardware access and backend library
Macros | Functions
binary_helpers.c File Reference
#include <config.h>
#include <glib.h>
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
+ Include dependency graph for binary_helpers.c:

Go to the source code of this file.

Macros

#define VALUE_TYPE(T, R, L)
 

Functions

SR_PRIV int bv_get_value_len (float *out, const struct binary_value_spec *spec, const uint8_t *data, size_t length)
 
SR_PRIV int bv_get_value (float *out, const struct binary_value_spec *spec, const uint8_t *data)
 

Macro Definition Documentation

#define VALUE_TYPE (   T,
  R,
 
)
Value:
case T: \
if (spec->offset + (L) > length) \
return SR_ERR_DATA; \
value = R(data + spec->offset); \
break
Data is invalid.
Definition: libsigrok.h:77
float value
If the trigger match is one of SR_TRIGGER_OVER or SR_TRIGGER_UNDER, this contains the value to compar...
Definition: libsigrok.h:463

Referenced by bv_get_value_len().

Function Documentation

SR_PRIV int bv_get_value ( float *  out,
const struct binary_value_spec *  spec,
const uint8_t *  data 
)

Definition at line 62 of file binary_helpers.c.

References SR_ERR_ARG, and SR_OK.

SR_PRIV int bv_get_value_len ( float *  out,
const struct binary_value_spec *  spec,
const uint8_t *  data,
size_t  length 
)

Definition at line 25 of file binary_helpers.c.

References SR_ERR_ARG, SR_OK, and VALUE_TYPE.