libsigrok  0.4.0
sigrok hardware access and backend library
Macros | Functions
kern.c File Reference
#include <config.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <glib.h>
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
+ Include dependency graph for kern.c:

Go to the source code of this file.

Macros

#define LOG_PREFIX   "kern"
 

Functions

SR_PRIV gboolean sr_kern_packet_valid (const uint8_t *buf)
 
SR_PRIV int sr_kern_parse (const uint8_t *buf, float *floatval, struct sr_datafeed_analog_old *analog, void *info)
 Parse a protocol packet. More...
 

Macro Definition Documentation

#define LOG_PREFIX   "kern"

Definition at line 33 of file kern.c.

Function Documentation

SR_PRIV gboolean sr_kern_packet_valid ( const uint8_t *  buf)

Definition at line 152 of file kern.c.

SR_PRIV int sr_kern_parse ( const uint8_t *  buf,
float *  floatval,
struct sr_datafeed_analog_old analog,
void *  info 
)

Parse a protocol packet.

Parameters
bufBuffer containing the protocol packet. Must not be NULL.
floatvalPointer to a float variable. That variable will contain the result value upon parsing success. Must not be NULL.
analogPointer to a struct sr_datafeed_analog_old. The struct will be filled with data according to the protocol packet. Must not be NULL.
infoPointer to a struct kern_info. The struct will be filled with data according to the protocol packet. Must not be NULL.
Returns
SR_OK upon success, SR_ERR upon failure. Upon errors, the 'analog' variable contents are undefined and should not be used.

Definition at line 199 of file kern.c.

References SR_OK.