fs9721: Pass 'info' as a void pointer.
This is done so that the function prototype of all sr_*_parse() DMM functions is the same, which will be needed later.
This commit is contained in:
parent
d84fc9cb3b
commit
93357bc3ce
|
@ -343,30 +343,33 @@ SR_PRIV gboolean sr_fs9721_packet_valid(const uint8_t *buf)
|
||||||
/**
|
/**
|
||||||
* Parse a protocol packet.
|
* Parse a protocol packet.
|
||||||
*
|
*
|
||||||
* @param buf Buffer containing the 14-byte protocol packet.
|
* @param buf Buffer containing the 14-byte protocol packet. Must not be NULL.
|
||||||
* @param floatval Pointer to a float variable. That variable will contain the
|
* @param floatval Pointer to a float variable. That variable will contain the
|
||||||
* result value upon parsing success.
|
* result value upon parsing success. Mut not be NULL.
|
||||||
* @param analog Pointer to a struct sr_datafeed_analog. The struct will be
|
* @param analog Pointer to a struct sr_datafeed_analog. The struct will be
|
||||||
* filled with data according to the protocol packet.
|
* filled with data according to the protocol packet.
|
||||||
|
* Must not be NULL.
|
||||||
* @param info Pointer to a struct fs9721_info. The struct will be filled
|
* @param info Pointer to a struct fs9721_info. The struct will be filled
|
||||||
* with data according to the protocol packet.
|
* with data according to the protocol packet. Must not be NULL.
|
||||||
*
|
*
|
||||||
* @return SR_OK upon success, SR_ERR upon failure. Upon errors, the
|
* @return SR_OK upon success, SR_ERR upon failure. Upon errors, the
|
||||||
* 'analog' variable contents are undefined and should not be used.
|
* 'analog' variable contents are undefined and should not be used.
|
||||||
*/
|
*/
|
||||||
SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval,
|
SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval,
|
||||||
struct sr_datafeed_analog *analog,
|
struct sr_datafeed_analog *analog, void *info)
|
||||||
struct fs9721_info *info)
|
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
struct fs9721_info *info_local;
|
||||||
|
|
||||||
|
info_local = (struct fs9721_info *)info;
|
||||||
|
|
||||||
if ((ret = parse_value(buf, floatval)) != SR_OK) {
|
if ((ret = parse_value(buf, floatval)) != SR_OK) {
|
||||||
sr_err("Error parsing value: %d.", ret);
|
sr_err("Error parsing value: %d.", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_flags(buf, info);
|
parse_flags(buf, info_local);
|
||||||
handle_flags(analog, floatval, info);
|
handle_flags(analog, floatval, info_local);
|
||||||
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,8 +187,7 @@ struct fs9721_info {
|
||||||
SR_PRIV gboolean sr_fs9721_is_packet_start(uint8_t b);
|
SR_PRIV gboolean sr_fs9721_is_packet_start(uint8_t b);
|
||||||
SR_PRIV gboolean sr_fs9721_packet_valid(const uint8_t *buf);
|
SR_PRIV gboolean sr_fs9721_packet_valid(const uint8_t *buf);
|
||||||
SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval,
|
SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval,
|
||||||
struct sr_datafeed_analog *analog,
|
struct sr_datafeed_analog *analog, void *info);
|
||||||
struct fs9721_info *info);
|
|
||||||
|
|
||||||
/*--- hardware/common/dmm/metex14.c -----------------------------------------*/
|
/*--- hardware/common/dmm/metex14.c -----------------------------------------*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue