From: Uwe Hermann Date: Tue, 29 Sep 2015 11:55:46 +0000 (+0200) Subject: SR_DF_ANALOG_OLD and sr_datafeed_analog_old renames. X-Git-Tag: libsigrok-0.4.0~204 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5faebab2903dc91949edc31f0a4b118d86090a30;p=libsigrok.git SR_DF_ANALOG_OLD and sr_datafeed_analog_old renames. Rename SR_DF_ANALOG to SR_DF_ANALOG_OLD, and 'struct sr_datafeed_analog' to 'struct sr_datafeed_analog_old'. --- diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index af10e8ea..3e441f72 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -319,12 +319,12 @@ shared_ptr Context::create_logic_packet( return shared_ptr(new Packet(nullptr, packet), Packet::Deleter()); } -shared_ptr Context::create_analog_packet( +shared_ptr Context::create_analog_old_packet( vector > channels, float *data_pointer, unsigned int num_samples, const Quantity *mq, const Unit *unit, vector mqflags) { - auto analog = g_new0(struct sr_datafeed_analog, 1); + auto analog = g_new0(struct sr_datafeed_analog_old, 1); for (auto channel : channels) analog->channels = g_slist_append(analog->channels, channel->_structure); analog->num_samples = num_samples; @@ -333,7 +333,7 @@ shared_ptr Context::create_analog_packet( analog->mqflags = QuantityFlag::mask_from_flags(mqflags); analog->data = data_pointer; auto packet = g_new(struct sr_datafeed_packet, 1); - packet->type = SR_DF_ANALOG; + packet->type = SR_DF_ANALOG_OLD; packet->payload = analog; return shared_ptr(new Packet(nullptr, packet), Packet::Deleter()); } @@ -1068,9 +1068,9 @@ Packet::Packet(shared_ptr device, static_cast( structure->payload)); break; - case SR_DF_ANALOG: - _payload = new Analog( - static_cast( + case SR_DF_ANALOG_OLD: + _payload = new AnalogOld( + static_cast( structure->payload)); break; default: @@ -1192,33 +1192,33 @@ unsigned int Logic::unit_size() return _structure->unitsize; } -Analog::Analog(const struct sr_datafeed_analog *structure) : +AnalogOld::AnalogOld(const struct sr_datafeed_analog_old *structure) : ParentOwned(structure), PacketPayload() { } -Analog::~Analog() +AnalogOld::~AnalogOld() { } -shared_ptr Analog::get_shared_pointer(Packet *_parent) +shared_ptr AnalogOld::get_shared_pointer(Packet *_parent) { return static_pointer_cast( ParentOwned::get_shared_pointer(_parent)); } -float *Analog::data_pointer() +float *AnalogOld::data_pointer() { return _structure->data; } -unsigned int Analog::num_samples() +unsigned int AnalogOld::num_samples() { return _structure->num_samples; } -vector> Analog::channels() +vector> AnalogOld::channels() { vector> result; for (auto l = _structure->channels; l; l = l->next) @@ -1227,17 +1227,17 @@ vector> Analog::channels() return result; } -const Quantity *Analog::mq() +const Quantity *AnalogOld::mq() { return Quantity::get(_structure->mq); } -const Unit *Analog::unit() +const Unit *AnalogOld::unit() { return Unit::get(_structure->unit); } -vector Analog::mq_flags() +vector AnalogOld::mq_flags() { return QuantityFlag::flags_from_mask(_structure->mqflags); } diff --git a/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp b/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp index b000e4cd..3c8e7276 100644 --- a/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp +++ b/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp @@ -297,7 +297,7 @@ public: shared_ptr create_logic_packet( void *data_pointer, size_t data_length, unsigned int unit_size); /** Create an analog packet. */ - shared_ptr create_analog_packet( + shared_ptr create_analog_old_packet( vector > channels, float *data_pointer, unsigned int num_samples, const Quantity *mq, const Unit *unit, vector mqflags); @@ -428,7 +428,7 @@ protected: friend class Channel; friend class ChannelGroup; friend class Output; - friend class Analog; + friend class AnalogOld; }; /** A real hardware device, connected via a driver */ @@ -702,7 +702,7 @@ protected: friend class Header; friend class Meta; friend class Logic; - friend class Analog; + friend class AnalogOld; friend class Context; }; @@ -777,8 +777,8 @@ protected: }; /** Payload of a datafeed packet with analog data */ -class SR_API Analog : - public ParentOwned, +class SR_API AnalogOld : + public ParentOwned, public PacketPayload { public: @@ -795,8 +795,8 @@ public: /** Measurement flags associated with the samples in this packet. */ vector mq_flags(); protected: - Analog(const struct sr_datafeed_analog *structure); - ~Analog(); + AnalogOld(const struct sr_datafeed_analog_old *structure); + ~AnalogOld(); shared_ptr get_shared_pointer(Packet *parent); friend class Packet; }; diff --git a/bindings/java/org/sigrok/core/classes/classes.i b/bindings/java/org/sigrok/core/classes/classes.i index 34323b16..44efc1c5 100644 --- a/bindings/java/org/sigrok/core/classes/classes.i +++ b/bindings/java/org/sigrok/core/classes/classes.i @@ -385,7 +385,7 @@ typedef jobject jdatafeedcallback; %enddef /* Ignore this for now, needs a fix. */ -%ignore sigrok::Context::create_analog_packet; +%ignore sigrok::Context::create_analog_old_packet; %include "bindings/swig/classes.i" diff --git a/bindings/python/sigrok/core/classes.i b/bindings/python/sigrok/core/classes.i index 49cfba98..07b13715 100644 --- a/bindings/python/sigrok/core/classes.i +++ b/bindings/python/sigrok/core/classes.i @@ -250,9 +250,9 @@ typedef guint pyg_flags_type; { return dynamic_pointer_cast($self->payload()); } - std::shared_ptr _payload_analog() + std::shared_ptr _payload_analog_old() { - return dynamic_pointer_cast($self->payload()); + return dynamic_pointer_cast($self->payload()); } std::shared_ptr _payload_logic() { @@ -271,8 +271,8 @@ typedef guint pyg_flags_type; return self._payload_meta() elif self.type == PacketType.LOGIC: return self._payload_logic() - elif self.type == PacketType.ANALOG: - return self._payload_analog() + elif self.type == PacketType.ANALOG_OLD: + return self._payload_analog_old() else: return None @@ -377,7 +377,7 @@ std::map dict_to_map_options(PyObject *dict, %} /* Ignore these methods, we will override them below. */ -%ignore sigrok::Analog::data; +%ignore sigrok::AnalogOld::data; %ignore sigrok::Driver::scan; %ignore sigrok::InputFormat::create_input; %ignore sigrok::OutputFormat::create_output; @@ -506,8 +506,8 @@ std::map dict_to_map_options(PyObject *dict, } } -/* Return NumPy array from Analog::data(). */ -%extend sigrok::Analog +/* Return NumPy array from AnalogOld::data(). */ +%extend sigrok::AnalogOld { PyObject * _data() { diff --git a/bindings/swig/classes.i b/bindings/swig/classes.i index 309bd340..443d77b5 100644 --- a/bindings/swig/classes.i +++ b/bindings/swig/classes.i @@ -72,7 +72,7 @@ template< class T > class enable_shared_from_this; %shared_ptr(sigrok::PacketPayload); %shared_ptr(sigrok::Header); %shared_ptr(sigrok::Meta); -%shared_ptr(sigrok::Analog); +%shared_ptr(sigrok::AnalogOld); %shared_ptr(sigrok::Logic); %shared_ptr(sigrok::InputFormat); %shared_ptr(sigrok::Input); @@ -259,12 +259,12 @@ typedef std::map %attributemap(Meta, map_ConfigKey_Variant, config, config); -%attributevector(Analog, +%attributevector(AnalogOld, std::vector >, channels, channels); -%attribute(sigrok::Analog, int, num_samples, num_samples); -%attribute(sigrok::Analog, const sigrok::Quantity *, mq, mq); -%attribute(sigrok::Analog, const sigrok::Unit *, unit, unit); -%attributevector(Analog, std::vector, mq_flags, mq_flags); +%attribute(sigrok::AnalogOld, int, num_samples, num_samples); +%attribute(sigrok::AnalogOld, const sigrok::Quantity *, mq, mq); +%attribute(sigrok::AnalogOld, const sigrok::Unit *, unit, unit); +%attributevector(AnalogOld, std::vector, mq_flags, mq_flags); %include diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 47b9874c..a497e8cf 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -162,8 +162,8 @@ enum sr_packettype { SR_DF_TRIGGER, /** Payload is struct sr_datafeed_logic. */ SR_DF_LOGIC, - /** Payload is struct sr_datafeed_analog. */ - SR_DF_ANALOG, + /** Payload is struct sr_datafeed_analog_old. */ + SR_DF_ANALOG_OLD, /** Beginning of frame. No payload. */ SR_DF_FRAME_BEGIN, /** End of frame. No payload. */ @@ -494,8 +494,8 @@ struct sr_datafeed_logic { void *data; }; -/** Analog datafeed payload for type SR_DF_ANALOG. */ -struct sr_datafeed_analog { +/** Analog datafeed payload for type SR_DF_ANALOG_OLD. */ +struct sr_datafeed_analog_old { /** The channels for which data is included in this packet. */ GSList *channels; /** Number of samples in data */ diff --git a/src/dmm/bm25x.c b/src/dmm/bm25x.c index 1ea9c19a..e7aa45a1 100644 --- a/src/dmm/bm25x.c +++ b/src/dmm/bm25x.c @@ -147,7 +147,7 @@ special: } SR_PRIV int sr_brymen_bm25x_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { float val; diff --git a/src/dmm/es519xx.c b/src/dmm/es519xx.c index 1c060e41..69d81752 100644 --- a/src/dmm/es519xx.c +++ b/src/dmm/es519xx.c @@ -444,7 +444,7 @@ static void parse_flags(const uint8_t *buf, struct es519xx_info *info) } } -static void handle_flags(struct sr_datafeed_analog *analog, +static void handle_flags(struct sr_datafeed_analog_old *analog, float *floatval, const struct es519xx_info *info) { /* @@ -604,7 +604,7 @@ static gboolean sr_es519xx_packet_valid(const uint8_t *buf, } static int sr_es519xx_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, + struct sr_datafeed_analog_old *analog, struct es519xx_info *info) { int ret; @@ -640,7 +640,7 @@ SR_PRIV gboolean sr_es519xx_2400_11b_packet_valid(const uint8_t *buf) } SR_PRIV int sr_es519xx_2400_11b_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { struct es519xx_info *info_local; @@ -669,7 +669,7 @@ SR_PRIV gboolean sr_es519xx_2400_11b_altfn_packet_valid(const uint8_t *buf) } SR_PRIV int sr_es519xx_2400_11b_altfn_parse(const uint8_t *buf, - float *floatval, struct sr_datafeed_analog *analog, void *info) + float *floatval, struct sr_datafeed_analog_old *analog, void *info) { struct es519xx_info *info_local; @@ -699,7 +699,7 @@ SR_PRIV gboolean sr_es519xx_19200_11b_5digits_packet_valid(const uint8_t *buf) } SR_PRIV int sr_es519xx_19200_11b_5digits_parse(const uint8_t *buf, - float *floatval, struct sr_datafeed_analog *analog, void *info) + float *floatval, struct sr_datafeed_analog_old *analog, void *info) { struct es519xx_info *info_local; @@ -729,7 +729,7 @@ SR_PRIV gboolean sr_es519xx_19200_11b_clamp_packet_valid(const uint8_t *buf) } SR_PRIV int sr_es519xx_19200_11b_clamp_parse(const uint8_t *buf, - float *floatval, struct sr_datafeed_analog *analog, void *info) + float *floatval, struct sr_datafeed_analog_old *analog, void *info) { struct es519xx_info *info_local; @@ -758,7 +758,7 @@ SR_PRIV gboolean sr_es519xx_19200_11b_packet_valid(const uint8_t *buf) } SR_PRIV int sr_es519xx_19200_11b_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { struct es519xx_info *info_local; @@ -786,7 +786,7 @@ SR_PRIV gboolean sr_es519xx_19200_14b_packet_valid(const uint8_t *buf) } SR_PRIV int sr_es519xx_19200_14b_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { struct es519xx_info *info_local; @@ -815,7 +815,7 @@ SR_PRIV gboolean sr_es519xx_19200_14b_sel_lpf_packet_valid(const uint8_t *buf) } SR_PRIV int sr_es519xx_19200_14b_sel_lpf_parse(const uint8_t *buf, - float *floatval, struct sr_datafeed_analog *analog, void *info) + float *floatval, struct sr_datafeed_analog_old *analog, void *info) { struct es519xx_info *info_local; diff --git a/src/dmm/fs9721.c b/src/dmm/fs9721.c index 8edeed93..3c981021 100644 --- a/src/dmm/fs9721.c +++ b/src/dmm/fs9721.c @@ -243,7 +243,7 @@ static void parse_flags(const uint8_t *buf, struct fs9721_info *info) info->is_c2c1_00 = (buf[13] & (1 << 0)) != 0; } -static void handle_flags(struct sr_datafeed_analog *analog, float *floatval, +static void handle_flags(struct sr_datafeed_analog_old *analog, float *floatval, const struct fs9721_info *info) { /* Factors */ @@ -337,7 +337,7 @@ SR_PRIV gboolean sr_fs9721_packet_valid(const uint8_t *buf) * @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 * result value upon parsing success. Must 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_old. The struct will be * 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 @@ -347,7 +347,7 @@ SR_PRIV gboolean sr_fs9721_packet_valid(const uint8_t *buf) * 'analog' variable contents are undefined and should not be used. */ SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { int ret; struct fs9721_info *info_local; @@ -365,7 +365,7 @@ SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval, return SR_OK; } -SR_PRIV void sr_fs9721_00_temp_c(struct sr_datafeed_analog *analog, void *info) +SR_PRIV void sr_fs9721_00_temp_c(struct sr_datafeed_analog_old *analog, void *info) { struct fs9721_info *info_local; @@ -378,7 +378,7 @@ SR_PRIV void sr_fs9721_00_temp_c(struct sr_datafeed_analog *analog, void *info) } } -SR_PRIV void sr_fs9721_01_temp_c(struct sr_datafeed_analog *analog, void *info) +SR_PRIV void sr_fs9721_01_temp_c(struct sr_datafeed_analog_old *analog, void *info) { struct fs9721_info *info_local; @@ -391,7 +391,7 @@ SR_PRIV void sr_fs9721_01_temp_c(struct sr_datafeed_analog *analog, void *info) } } -SR_PRIV void sr_fs9721_10_temp_c(struct sr_datafeed_analog *analog, void *info) +SR_PRIV void sr_fs9721_10_temp_c(struct sr_datafeed_analog_old *analog, void *info) { struct fs9721_info *info_local; @@ -404,7 +404,7 @@ SR_PRIV void sr_fs9721_10_temp_c(struct sr_datafeed_analog *analog, void *info) } } -SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog *analog, void *info) +SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog_old *analog, void *info) { struct fs9721_info *info_local; @@ -423,7 +423,7 @@ SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog *analog, void *i } } -SR_PRIV void sr_fs9721_max_c_min(struct sr_datafeed_analog *analog, void *info) +SR_PRIV void sr_fs9721_max_c_min(struct sr_datafeed_analog_old *analog, void *info) { struct fs9721_info *info_local; diff --git a/src/dmm/fs9922.c b/src/dmm/fs9922.c index ae2b4850..5325e6dd 100644 --- a/src/dmm/fs9922.c +++ b/src/dmm/fs9922.c @@ -223,7 +223,7 @@ static void parse_flags(const uint8_t *buf, struct fs9922_info *info) /* Byte 13: Always '\n' (newline, 0x0a, 10) */ } -static void handle_flags(struct sr_datafeed_analog *analog, float *floatval, +static void handle_flags(struct sr_datafeed_analog_old *analog, float *floatval, const struct fs9922_info *info) { /* Factors */ @@ -344,7 +344,7 @@ SR_PRIV gboolean sr_fs9922_packet_valid(const uint8_t *buf) * @param buf Buffer containing the protocol packet. Must not be NULL. * @param floatval Pointer to a float variable. That variable will contain the * result value upon parsing success. Must 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_old. The struct will be * filled with data according to the protocol packet. * Must not be NULL. * @param info Pointer to a struct fs9922_info. The struct will be filled @@ -354,7 +354,7 @@ SR_PRIV gboolean sr_fs9922_packet_valid(const uint8_t *buf) * 'analog' variable contents are undefined and should not be used. */ SR_PRIV int sr_fs9922_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { int ret; struct fs9922_info *info_local; @@ -372,7 +372,7 @@ SR_PRIV int sr_fs9922_parse(const uint8_t *buf, float *floatval, return SR_OK; } -SR_PRIV void sr_fs9922_z1_diode(struct sr_datafeed_analog *analog, void *info) +SR_PRIV void sr_fs9922_z1_diode(struct sr_datafeed_analog_old *analog, void *info) { struct fs9922_info *info_local; diff --git a/src/dmm/m2110.c b/src/dmm/m2110.c index edea1f26..ea53fae5 100644 --- a/src/dmm/m2110.c +++ b/src/dmm/m2110.c @@ -51,7 +51,7 @@ SR_PRIV gboolean sr_m2110_packet_valid(const uint8_t *buf) } SR_PRIV int sr_m2110_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { float val; diff --git a/src/dmm/metex14.c b/src/dmm/metex14.c index 3fe99ace..b39c9324 100644 --- a/src/dmm/metex14.c +++ b/src/dmm/metex14.c @@ -170,7 +170,7 @@ static void parse_flags(const char *buf, struct metex14_info *info) /* Byte 13: Always '\r' (carriage return, 0x0d, 13) */ } -static void handle_flags(struct sr_datafeed_analog *analog, float *floatval, +static void handle_flags(struct sr_datafeed_analog_old *analog, float *floatval, const struct metex14_info *info) { /* Factors */ @@ -311,7 +311,7 @@ SR_PRIV gboolean sr_metex14_packet_valid(const uint8_t *buf) * @param buf Buffer containing the protocol packet. Must not be NULL. * @param floatval Pointer to a float variable. That variable will be modified * in-place depending on the protocol packet. Must 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_old. The struct will be * filled with data according to the protocol packet. * Must not be NULL. * @param info Pointer to a struct metex14_info. The struct will be filled @@ -321,7 +321,7 @@ SR_PRIV gboolean sr_metex14_packet_valid(const uint8_t *buf) * 'analog' variable contents are undefined and should not be used. */ SR_PRIV int sr_metex14_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { int ret; struct metex14_info *info_local; diff --git a/src/dmm/rs9lcd.c b/src/dmm/rs9lcd.c index 1f86d885..d337d7f7 100644 --- a/src/dmm/rs9lcd.c +++ b/src/dmm/rs9lcd.c @@ -318,7 +318,7 @@ static gboolean is_logic_high(const struct rs9lcd_packet *rs_packet) } SR_PRIV int sr_rs9lcd_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { const struct rs9lcd_packet *rs_packet = (void *)buf; double rawval; diff --git a/src/dmm/ut372.c b/src/dmm/ut372.c index 49b4e3cb..74f87575 100644 --- a/src/dmm/ut372.c +++ b/src/dmm/ut372.c @@ -88,7 +88,7 @@ SR_PRIV gboolean sr_ut372_packet_valid(const uint8_t *buf) } SR_PRIV int sr_ut372_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { unsigned int i, j, value, divisor; uint8_t segments, flags1, flags2; diff --git a/src/dmm/ut71x.c b/src/dmm/ut71x.c index b17e0583..9af8fc12 100644 --- a/src/dmm/ut71x.c +++ b/src/dmm/ut71x.c @@ -212,7 +212,7 @@ static void parse_flags(const uint8_t *buf, struct ut71x_info *info) } } -static void handle_flags(struct sr_datafeed_analog *analog, +static void handle_flags(struct sr_datafeed_analog_old *analog, float *floatval, const struct ut71x_info *info) { /* Measurement modes */ @@ -325,7 +325,7 @@ SR_PRIV gboolean sr_ut71x_packet_valid(const uint8_t *buf) } SR_PRIV int sr_ut71x_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { int ret; struct ut71x_info *info_local; diff --git a/src/dmm/vc870.c b/src/dmm/vc870.c index 29ec2e2f..ac04e640 100644 --- a/src/dmm/vc870.c +++ b/src/dmm/vc870.c @@ -280,7 +280,7 @@ static void parse_flags(const uint8_t *buf, struct vc870_info *info) info->is_rms = TRUE; } -static void handle_flags(struct sr_datafeed_analog *analog, +static void handle_flags(struct sr_datafeed_analog_old *analog, float *floatval, const struct vc870_info *info) { /* @@ -402,7 +402,7 @@ SR_PRIV gboolean sr_vc870_packet_valid(const uint8_t *buf) } SR_PRIV int sr_vc870_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { int ret; struct vc870_info *info_local; diff --git a/src/hardware/agilent-dmm/sched.c b/src/hardware/agilent-dmm/sched.c index a38ddc46..c1ca8f2e 100644 --- a/src/hardware/agilent-dmm/sched.c +++ b/src/hardware/agilent-dmm/sched.c @@ -264,7 +264,7 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; float fvalue; const char *s; char *mstr; @@ -296,14 +296,14 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match) fvalue /= devc->cur_divider; } - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.mq = devc->cur_mq; analog.unit = devc->cur_unit; analog.mqflags = devc->cur_mqflags; analog.channels = sdi->channels; analog.num_samples = 1; analog.data = &fvalue; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); diff --git a/src/hardware/appa-55ii/protocol.c b/src/hardware/appa-55ii/protocol.c index 9a061de1..84826890 100644 --- a/src/hardware/appa-55ii/protocol.c +++ b/src/hardware/appa-55ii/protocol.c @@ -92,7 +92,7 @@ static void appa_55ii_live_data(struct sr_dev_inst *sdi, const uint8_t *buf) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_channel *ch; float values[APPA_55II_NUM_CHANNELS], *val_ptr; int i; @@ -103,7 +103,7 @@ static void appa_55ii_live_data(struct sr_dev_inst *sdi, const uint8_t *buf) return; val_ptr = values; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.num_samples = 1; analog.mq = SR_MQ_TEMPERATURE; analog.unit = SR_UNIT_CELSIUS; @@ -118,7 +118,7 @@ static void appa_55ii_live_data(struct sr_dev_inst *sdi, const uint8_t *buf) *val_ptr++ = appa_55ii_temp(buf, i); } - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->session_cb_data, &packet); g_slist_free(analog.channels); @@ -138,7 +138,7 @@ static void appa_55ii_log_data_parse(struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_channel *ch; float values[APPA_55II_NUM_CHANNELS], *val_ptr; const uint8_t *buf; @@ -155,7 +155,7 @@ static void appa_55ii_log_data_parse(struct sr_dev_inst *sdi) /* FIXME: Timestamp should be sent in the packet. */ sr_dbg("Timestamp: %02d:%02d:%02d", buf[2], buf[3], buf[4]); - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.num_samples = 1; analog.mq = SR_MQ_TEMPERATURE; analog.unit = SR_UNIT_CELSIUS; @@ -170,7 +170,7 @@ static void appa_55ii_log_data_parse(struct sr_dev_inst *sdi) *val_ptr++ = temp == 0x7FFF ? INFINITY : (float)temp / 10; } - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->session_cb_data, &packet); g_slist_free(analog.channels); diff --git a/src/hardware/atten-pps3xxx/protocol.c b/src/hardware/atten-pps3xxx/protocol.c index 582a10d2..a969e976 100644 --- a/src/hardware/atten-pps3xxx/protocol.c +++ b/src/hardware/atten-pps3xxx/protocol.c @@ -37,13 +37,13 @@ static void handle_packet(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; float value, data[MAX_CHANNELS]; int offset, i; devc = sdi->priv; dump_packet("received", devc->packet); - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; analog.channels = sdi->channels; analog.num_samples = 1; diff --git a/src/hardware/baylibre-acme/protocol.c b/src/hardware/baylibre-acme/protocol.c index 72dee87a..becd6851 100644 --- a/src/hardware/baylibre-acme/protocol.c +++ b/src/hardware/baylibre-acme/protocol.c @@ -696,7 +696,7 @@ SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data) uint32_t cur_time, elapsed_time; uint64_t nrexpiration; struct sr_datafeed_packet packet, framep; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_dev_inst *sdi; struct sr_channel *ch; struct channel_priv *chp; @@ -715,9 +715,9 @@ SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data) if (!devc) return TRUE; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); if (read(devc->timer_fd, &nrexpiration, sizeof(nrexpiration)) < 0) { sr_warn("Failed to read timer information"); diff --git a/src/hardware/brymen-bm86x/protocol.c b/src/hardware/brymen-bm86x/protocol.c index 2840696f..17d1a905 100644 --- a/src/hardware/brymen-bm86x/protocol.c +++ b/src/hardware/brymen-bm86x/protocol.c @@ -73,7 +73,7 @@ static int brymen_bm86x_parse_digits(const unsigned char *buf, int length, } static void brymen_bm86x_parse(unsigned char *buf, float *floatval, - struct sr_datafeed_analog *analog) + struct sr_datafeed_analog_old *analog) { char str[16], temp_unit; int ret1, ret2, over_limit; @@ -195,7 +195,7 @@ static void brymen_bm86x_handle_packet(const struct sr_dev_inst *sdi, { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog[2]; + struct sr_datafeed_analog_old analog[2]; float floatval[2]; devc = sdi->priv; @@ -213,7 +213,7 @@ static void brymen_bm86x_handle_packet(const struct sr_dev_inst *sdi, analog[0].num_samples = 1; analog[0].data = &floatval[0]; analog[0].channels = g_slist_append(NULL, sdi->channels->data); - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog[0]; sr_session_send(sdi, &packet); g_slist_free(analog[0].channels); @@ -224,7 +224,7 @@ static void brymen_bm86x_handle_packet(const struct sr_dev_inst *sdi, analog[1].num_samples = 1; analog[1].data = &floatval[1]; analog[1].channels = g_slist_append(NULL, sdi->channels->next->data); - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog[1]; sr_session_send(sdi, &packet); g_slist_free(analog[1].channels); diff --git a/src/hardware/brymen-dmm/parser.c b/src/hardware/brymen-dmm/parser.c index 7341d381..aaa2c3f4 100644 --- a/src/hardware/brymen-dmm/parser.c +++ b/src/hardware/brymen-dmm/parser.c @@ -192,7 +192,7 @@ static void parse_flags(const uint8_t *buf, struct brymen_flags *info) } SR_PRIV int brymen_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { struct brymen_flags flags; struct brymen_header *hdr; diff --git a/src/hardware/brymen-dmm/protocol.c b/src/hardware/brymen-dmm/protocol.c index 96ef6853..4db460af 100644 --- a/src/hardware/brymen-dmm/protocol.c +++ b/src/hardware/brymen-dmm/protocol.c @@ -25,7 +25,7 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi) float floatval; struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; devc = sdi->priv; @@ -40,7 +40,7 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi) if (analog.mq != -1) { /* Got a measurement. */ - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); devc->num_samples++; diff --git a/src/hardware/brymen-dmm/protocol.h b/src/hardware/brymen-dmm/protocol.h index 3a695b44..24fe63d3 100644 --- a/src/hardware/brymen-dmm/protocol.h +++ b/src/hardware/brymen-dmm/protocol.h @@ -77,7 +77,7 @@ SR_PRIV int brymen_packet_length(const uint8_t *buf, int *len); SR_PRIV gboolean brymen_packet_is_valid(const uint8_t *buf); SR_PRIV int brymen_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); SR_PRIV int brymen_stream_detect(struct sr_serial_dev_inst *serial, uint8_t *buf, size_t *buflen, diff --git a/src/hardware/cem-dt-885x/protocol.c b/src/hardware/cem-dt-885x/protocol.c index 9c083dcd..a893bd1b 100644 --- a/src/hardware/cem-dt-885x/protocol.c +++ b/src/hardware/cem-dt-885x/protocol.c @@ -66,7 +66,7 @@ static void process_mset(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; GString *dbg; float fvalue; int i; @@ -131,14 +131,14 @@ static void process_mset(const struct sr_dev_inst *sdi) break; } } - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL; analog.mqflags = devc->cur_mqflags; analog.unit = SR_UNIT_DECIBEL_SPL; analog.channels = sdi->channels; analog.num_samples = 1; analog.data = &devc->last_spl; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); @@ -178,7 +178,7 @@ static void send_data(const struct sr_dev_inst *sdi, unsigned char *data, { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; float fbuf[SAMPLES_PER_PACKET]; unsigned int i; @@ -190,14 +190,14 @@ static void send_data(const struct sr_dev_inst *sdi, unsigned char *data, fbuf[i] += ((data[i * 2 + 1] & 0xf0) >> 4); fbuf[i] += (data[i * 2 + 1] & 0x0f) / 10.0; } - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL; analog.mqflags = devc->cur_mqflags; analog.unit = SR_UNIT_DECIBEL_SPL; analog.channels = sdi->channels; analog.num_samples = num_samples; analog.data = fbuf; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); diff --git a/src/hardware/center-3xx/protocol.c b/src/hardware/center-3xx/protocol.c index f22dd4d9..34478fae 100644 --- a/src/hardware/center-3xx/protocol.c +++ b/src/hardware/center-3xx/protocol.c @@ -123,7 +123,7 @@ static int packet_parse(const uint8_t *buf, int idx, struct center_info *info) static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx) { struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct dev_context *devc; struct center_info info; GSList *l; @@ -131,7 +131,7 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx) devc = sdi->priv; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); memset(&info, 0, sizeof(struct center_info)); ret = packet_parse(buf, idx, &info); @@ -141,7 +141,7 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx) } /* Common values for all 4 channels. */ - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; analog.mq = SR_MQ_TEMPERATURE; analog.unit = (info.celsius) ? SR_UNIT_CELSIUS : SR_UNIT_FAHRENHEIT; diff --git a/src/hardware/colead-slm/protocol.c b/src/hardware/colead-slm/protocol.c index 9bf9eb21..481a6dd3 100644 --- a/src/hardware/colead-slm/protocol.c +++ b/src/hardware/colead-slm/protocol.c @@ -29,7 +29,7 @@ static void process_packet(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; GString *dbg; float fvalue; int checksum, mode, i; @@ -71,7 +71,7 @@ static void process_packet(const struct sr_dev_inst *sdi) } fvalue /= 10; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL; analog.unit = SR_UNIT_DECIBEL_SPL; analog.channels = sdi->channels; @@ -167,7 +167,7 @@ static void process_packet(const struct sr_dev_inst *sdi) return; } - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c index f0edbcab..1b258727 100644 --- a/src/hardware/demo/demo.c +++ b/src/hardware/demo/demo.c @@ -98,7 +98,7 @@ struct analog_gen { float amplitude; float pattern_data[ANALOG_BUFSIZE]; unsigned int num_samples; - struct sr_datafeed_analog packet; + struct sr_datafeed_analog_old packet; float avg_val; /* Average value */ unsigned num_avgs; /* Number of samples averaged */ }; @@ -687,7 +687,7 @@ static void send_analog_packet(struct analog_gen *ag, unsigned int i; devc = sdi->priv; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &ag->packet; if (!devc->avg) { @@ -833,7 +833,7 @@ static int prepare_data(int fd, int revents, void *cb_data) g_hash_table_iter_init(&iter, devc->ch_ag); while (g_hash_table_iter_next(&iter, NULL, &value)) { ag = value; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &ag->packet; ag->packet.data = &ag->avg_val; ag->packet.num_samples = 1; diff --git a/src/hardware/fluke-dmm/fluke.c b/src/hardware/fluke-dmm/fluke.c index 59b79ccd..c6ab4b01 100644 --- a/src/hardware/fluke-dmm/fluke.c +++ b/src/hardware/fluke-dmm/fluke.c @@ -26,10 +26,10 @@ #include "libsigrok-internal.h" #include "fluke-dmm.h" -static struct sr_datafeed_analog *handle_qm_18x(const struct sr_dev_inst *sdi, +static struct sr_datafeed_analog_old *handle_qm_18x(const struct sr_dev_inst *sdi, char **tokens) { - struct sr_datafeed_analog *analog; + struct sr_datafeed_analog_old *analog; float fvalue; char *e, *u; gboolean is_oor; @@ -59,7 +59,7 @@ static struct sr_datafeed_analog *handle_qm_18x(const struct sr_dev_inst *sdi, while (*e && *e == ' ') e++; - analog = g_malloc0(sizeof(struct sr_datafeed_analog)); + analog = g_malloc0(sizeof(struct sr_datafeed_analog_old)); analog->data = g_malloc(sizeof(float)); analog->channels = sdi->channels; analog->num_samples = 1; @@ -154,10 +154,10 @@ static struct sr_datafeed_analog *handle_qm_18x(const struct sr_dev_inst *sdi, return analog; } -static struct sr_datafeed_analog *handle_qm_28x(const struct sr_dev_inst *sdi, +static struct sr_datafeed_analog_old *handle_qm_28x(const struct sr_dev_inst *sdi, char **tokens) { - struct sr_datafeed_analog *analog; + struct sr_datafeed_analog_old *analog; float fvalue; if (!tokens[1]) @@ -168,7 +168,7 @@ static struct sr_datafeed_analog *handle_qm_28x(const struct sr_dev_inst *sdi, return NULL; } - analog = g_malloc0(sizeof(struct sr_datafeed_analog)); + analog = g_malloc0(sizeof(struct sr_datafeed_analog_old)); analog->data = g_malloc(sizeof(float)); analog->channels = sdi->channels; analog->num_samples = 1; @@ -362,7 +362,7 @@ static void handle_qm_19x_data(const struct sr_dev_inst *sdi, char **tokens) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; float fvalue; if (!strcmp(tokens[0], "9.9E+37")) { @@ -397,7 +397,7 @@ static void handle_qm_19x_data(const struct sr_dev_inst *sdi, char **tokens) analog.mq = devc->mq; analog.unit = devc->unit; analog.mqflags = 0; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); devc->num_samples++; @@ -409,7 +409,7 @@ static void handle_line(const struct sr_dev_inst *sdi) struct dev_context *devc; struct sr_serial_dev_inst *serial; struct sr_datafeed_packet packet; - struct sr_datafeed_analog *analog; + struct sr_datafeed_analog_old *analog; int num_tokens, n, i; char cmd[16], **tokens; @@ -465,7 +465,7 @@ static void handle_line(const struct sr_dev_inst *sdi) if (analog) { /* Got a measurement. */ - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = analog; sr_session_send(devc->cb_data, &packet); devc->num_samples++; diff --git a/src/hardware/gmc-mh-1x-2x/protocol.c b/src/hardware/gmc-mh-1x-2x/protocol.c index 68a409b4..7851f0ec 100644 --- a/src/hardware/gmc-mh-1x-2x/protocol.c +++ b/src/hardware/gmc-mh-1x-2x/protocol.c @@ -652,12 +652,12 @@ static void clean_ctmv_rs_v(struct dev_context *devc) static void send_value(struct sr_dev_inst *sdi) { struct dev_context *devc; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_datafeed_packet packet; devc = sdi->priv; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.channels = sdi->channels; analog.num_samples = 1; analog.mq = devc->mq; @@ -666,7 +666,7 @@ static void send_value(struct sr_dev_inst *sdi) analog.data = &devc->value; memset(&packet, 0, sizeof(struct sr_datafeed_packet)); - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); diff --git a/src/hardware/gwinstek-gds-800/protocol.c b/src/hardware/gwinstek-gds-800/protocol.c index 05328df9..358e962a 100644 --- a/src/hardware/gwinstek-gds-800/protocol.c +++ b/src/hardware/gwinstek-gds-800/protocol.c @@ -66,7 +66,7 @@ SR_PRIV int gwinstek_gds_800_receive_data(int fd, int revents, void *cb_data) struct sr_scpi_dev_inst *scpi; struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; char command[32]; char *response; float volts_per_division; @@ -243,7 +243,7 @@ SR_PRIV int gwinstek_gds_800_receive_data(int fd, int revents, void *cb_data) analog.mq = SR_MQ_VOLTAGE; analog.unit = SR_UNIT_VOLT; analog.mqflags = 0; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(cb_data, &packet); g_slist_free(analog.channels); diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c index ea704eef..b79182d3 100644 --- a/src/hardware/hameg-hmo/protocol.c +++ b/src/hardware/hameg-hmo/protocol.c @@ -649,7 +649,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) struct dev_context *devc; struct sr_datafeed_packet packet; GArray *data; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_datafeed_logic logic; (void)fd; @@ -685,7 +685,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data) analog.mq = SR_MQ_VOLTAGE; analog.unit = SR_UNIT_VOLT; analog.mqflags = 0; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(cb_data, &packet); g_slist_free(analog.channels); diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index e55f4e09..7eef397a 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -708,14 +708,14 @@ static void send_chunk(struct sr_dev_inst *sdi, unsigned char *buf, int num_samples) { struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct dev_context *devc; float ch1, ch2, range; int num_channels, data_offset, i; devc = sdi->priv; num_channels = (devc->ch1_enabled && devc->ch2_enabled) ? 2 : 1; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; /* TODO: support for 5xxx series 9-bit samples */ analog.channels = devc->enabled_channels; diff --git a/src/hardware/hung-chang-dso-2100/protocol.c b/src/hardware/hung-chang-dso-2100/protocol.c index 47fe8f0e..c1c8dacb 100644 --- a/src/hardware/hung-chang-dso-2100/protocol.c +++ b/src/hardware/hung-chang-dso-2100/protocol.c @@ -331,7 +331,7 @@ static void push_samples(const struct sr_dev_inst *sdi, uint8_t *buf, size_t num { struct dev_context *devc = sdi->priv; float *data = devc->samples; - struct sr_datafeed_analog analog = { + struct sr_datafeed_analog_old analog = { .channels = devc->enabled_channel, .num_samples = num, .mq = SR_MQ_VOLTAGE, @@ -340,7 +340,7 @@ static void push_samples(const struct sr_dev_inst *sdi, uint8_t *buf, size_t num .data = data, }; struct sr_datafeed_packet packet = { - .type = SR_DF_ANALOG, + .type = SR_DF_ANALOG_OLD, .payload = &analog, }; float factor = devc->factor; diff --git a/src/hardware/kecheng-kc-330b/protocol.c b/src/hardware/kecheng-kc-330b/protocol.c index 1bca7520..e4550d21 100644 --- a/src/hardware/kecheng-kc-330b/protocol.c +++ b/src/hardware/kecheng-kc-330b/protocol.c @@ -108,18 +108,18 @@ static void send_data(const struct sr_dev_inst *sdi, void *buf, unsigned int buf { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; devc = sdi->priv; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL; analog.mqflags = devc->mqflags; analog.unit = SR_UNIT_DECIBEL_SPL; analog.channels = sdi->channels; analog.num_samples = buf_len; analog.data = buf; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); diff --git a/src/hardware/kern-scale/protocol.c b/src/hardware/kern-scale/protocol.c index 182a9d80..8845ae39 100644 --- a/src/hardware/kern-scale/protocol.c +++ b/src/hardware/kern-scale/protocol.c @@ -33,14 +33,14 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, struct scale_info *scale; float floatval; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct dev_context *devc; scale = (struct scale_info *)sdi->driver; devc = sdi->priv; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.channels = sdi->channels; analog.num_samples = 1; @@ -51,7 +51,7 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, if (analog.mq != -1) { /* Got a measurement. */ - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); devc->num_samples++; diff --git a/src/hardware/kern-scale/protocol.h b/src/hardware/kern-scale/protocol.h index a7f11d23..9be375f7 100644 --- a/src/hardware/kern-scale/protocol.h +++ b/src/hardware/kern-scale/protocol.h @@ -40,7 +40,7 @@ struct scale_info { gboolean (*packet_valid)(const uint8_t *); /** Packet parsing function. */ int (*packet_parse)(const uint8_t *, float *, - struct sr_datafeed_analog *, void *); + struct sr_datafeed_analog_old *, void *); /** Size of chipset info struct. */ gsize info_size; }; diff --git a/src/hardware/korad-kdxxxxp/protocol.c b/src/hardware/korad-kdxxxxp/protocol.c index 90ee55f1..cd266e2f 100644 --- a/src/hardware/korad-kdxxxxp/protocol.c +++ b/src/hardware/korad-kdxxxxp/protocol.c @@ -307,7 +307,7 @@ SR_PRIV int korad_kdxxxxp_receive_data(int fd, int revents, void *cb_data) struct dev_context *devc; struct sr_serial_dev_inst *serial; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; int64_t t, elapsed_us; (void)fd; @@ -325,7 +325,7 @@ SR_PRIV int korad_kdxxxxp_receive_data(int fd, int revents, void *cb_data) korad_kdxxxxp_get_reply(serial, devc); /* Send the value forward. */ - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; analog.channels = sdi->channels; analog.num_samples = 1; diff --git a/src/hardware/lascar-el-usb/protocol.c b/src/hardware/lascar-el-usb/protocol.c index 709e3677..ac8b6ff9 100644 --- a/src/hardware/lascar-el-usb/protocol.c +++ b/src/hardware/lascar-el-usb/protocol.c @@ -383,7 +383,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf, { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_channel *ch; float *temp, *rh; uint16_t s; @@ -397,7 +397,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf, samples = samples_left; switch (devc->profile->logformat) { case LOG_TEMP_RH: - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; analog.mqflags = 0; if (!(temp = g_try_malloc(sizeof(float) * samples))) @@ -448,7 +448,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf, g_free(rh); break; case LOG_CO: - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; analog.channels = sdi->channels; analog.num_samples = samples; diff --git a/src/hardware/manson-hcs-3xxx/protocol.c b/src/hardware/manson-hcs-3xxx/protocol.c index 6521a451..657ae318 100644 --- a/src/hardware/manson-hcs-3xxx/protocol.c +++ b/src/hardware/manson-hcs-3xxx/protocol.c @@ -123,11 +123,11 @@ static void send_sample(struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; devc = sdi->priv; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; analog.channels = sdi->channels; analog.num_samples = 1; diff --git a/src/hardware/maynuo-m97/protocol.c b/src/hardware/maynuo-m97/protocol.c index 5be8d146..a85989f2 100644 --- a/src/hardware/maynuo-m97/protocol.c +++ b/src/hardware/maynuo-m97/protocol.c @@ -128,7 +128,7 @@ SR_PRIV const char *maynuo_m97_mode_to_str(enum maynuo_m97_mode mode) static void maynuo_m97_session_send_value(const struct sr_dev_inst *sdi, struct sr_channel *ch, float value, enum sr_mq mq, enum sr_unit unit) { struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; analog.channels = g_slist_append(NULL, ch); analog.num_samples = 1; @@ -137,7 +137,7 @@ static void maynuo_m97_session_send_value(const struct sr_dev_inst *sdi, struct analog.unit = unit; analog.mqflags = SR_MQFLAG_DC; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(sdi, &packet); g_slist_free(analog.channels); diff --git a/src/hardware/motech-lps-30x/protocol.c b/src/hardware/motech-lps-30x/protocol.c index 81808faf..4b9da802 100644 --- a/src/hardware/motech-lps-30x/protocol.c +++ b/src/hardware/motech-lps-30x/protocol.c @@ -33,12 +33,12 @@ static void send_data(struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; int i; float data[MAX_CHANNELS]; devc = sdi->priv; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; analog.channels = sdi->channels; analog.num_samples = 1; diff --git a/src/hardware/norma-dmm/protocol.c b/src/hardware/norma-dmm/protocol.c index 35b11957..a077cf98 100644 --- a/src/hardware/norma-dmm/protocol.c +++ b/src/hardware/norma-dmm/protocol.c @@ -91,7 +91,7 @@ static void nma_process_line(const struct sr_dev_inst *sdi) int mmode, devstat; /* Measuring mode, device status */ float value; /* Measured value */ float scale; /* Scaling factor depending on range and function */ - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_datafeed_packet packet; devc = sdi->priv; @@ -120,7 +120,7 @@ static void nma_process_line(const struct sr_dev_inst *sdi) /* Start decoding. */ value = 0.0; scale = 1.0; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); /* * The numbers are hex digits, starting from 0. @@ -364,7 +364,7 @@ static void nma_process_line(const struct sr_dev_inst *sdi) analog.data = &value; memset(&packet, 0, sizeof(struct sr_datafeed_packet)); - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); diff --git a/src/hardware/rigol-ds/protocol.c b/src/hardware/rigol-ds/protocol.c index 16bfb478..4a307178 100644 --- a/src/hardware/rigol-ds/protocol.c +++ b/src/hardware/rigol-ds/protocol.c @@ -539,7 +539,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data) struct sr_scpi_dev_inst *scpi; struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_datafeed_logic logic; double vdiv, offset; int len, i, vref; @@ -675,7 +675,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data) analog.mq = SR_MQ_VOLTAGE; analog.unit = SR_UNIT_VOLT; analog.mqflags = 0; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(cb_data, &packet); g_slist_free(analog.channels); diff --git a/src/hardware/scpi-pps/protocol.c b/src/hardware/scpi-pps/protocol.c index e9209b3e..b6b57fb8 100644 --- a/src/hardware/scpi-pps/protocol.c +++ b/src/hardware/scpi-pps/protocol.c @@ -58,7 +58,7 @@ SR_PRIV int scpi_pps_receive_data(int fd, int revents, void *cb_data) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; const struct sr_dev_inst *sdi; struct sr_channel *next_channel; struct sr_scpi_dev_inst *scpi; @@ -80,7 +80,7 @@ SR_PRIV int scpi_pps_receive_data(int fd, int revents, void *cb_data) /* Retrieve requested value for this state. */ if (sr_scpi_get_float(scpi, NULL, &f) == SR_OK) { pch = devc->cur_channel->priv; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; analog.channels = g_slist_append(NULL, devc->cur_channel); analog.num_samples = 1; diff --git a/src/hardware/serial-dmm/protocol.c b/src/hardware/serial-dmm/protocol.c index edf8382b..8e9b3979 100644 --- a/src/hardware/serial-dmm/protocol.c +++ b/src/hardware/serial-dmm/protocol.c @@ -44,7 +44,7 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, struct dmm_info *dmm; float floatval; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct dev_context *devc; dmm = (struct dmm_info *)sdi->driver; @@ -52,7 +52,7 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, log_dmm_packet(buf); devc = sdi->priv; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.channels = sdi->channels; analog.num_samples = 1; @@ -67,7 +67,7 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, if (analog.mq != -1) { /* Got a measurement. */ - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); devc->num_samples++; diff --git a/src/hardware/serial-dmm/protocol.h b/src/hardware/serial-dmm/protocol.h index 4cdbea3b..1a0b5939 100644 --- a/src/hardware/serial-dmm/protocol.h +++ b/src/hardware/serial-dmm/protocol.h @@ -47,9 +47,9 @@ struct dmm_info { gboolean (*packet_valid)(const uint8_t *); /** Packet parsing function. */ int (*packet_parse)(const uint8_t *, float *, - struct sr_datafeed_analog *, void *); + struct sr_datafeed_analog_old *, void *); /** */ - void (*dmm_details)(struct sr_datafeed_analog *, void *); + void (*dmm_details)(struct sr_datafeed_analog_old *, void *); /** Size of chipset info struct. */ gsize info_size; }; diff --git a/src/hardware/teleinfo/protocol.c b/src/hardware/teleinfo/protocol.c index 94af473b..21b695bd 100644 --- a/src/hardware/teleinfo/protocol.c +++ b/src/hardware/teleinfo/protocol.c @@ -60,7 +60,7 @@ static void teleinfo_send_value(struct sr_dev_inst *sdi, const char *channel_nam { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_channel *ch; devc = sdi->priv; @@ -69,14 +69,14 @@ static void teleinfo_send_value(struct sr_dev_inst *sdi, const char *channel_nam if (!ch || !ch->enabled) return; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.channels = g_slist_append(analog.channels, ch); analog.num_samples = 1; analog.mq = mq; analog.unit = unit; analog.data = &value; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->session_cb_data, &packet); g_slist_free(analog.channels); diff --git a/src/hardware/testo/protocol.c b/src/hardware/testo/protocol.c index 9af799c5..e2c43c08 100644 --- a/src/hardware/testo/protocol.c +++ b/src/hardware/testo/protocol.c @@ -223,7 +223,7 @@ SR_PRIV void testo_receive_packet(const struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_channel *ch; GString *dbg; float value; @@ -242,7 +242,7 @@ SR_PRIV void testo_receive_packet(const struct sr_dev_inst *sdi) g_string_free(dbg, TRUE); } - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; analog.num_samples = 1; analog.mqflags = 0; diff --git a/src/hardware/tondaj-sl-814/protocol.c b/src/hardware/tondaj-sl-814/protocol.c index 44d12ec4..d09d19bf 100644 --- a/src/hardware/tondaj-sl-814/protocol.c +++ b/src/hardware/tondaj-sl-814/protocol.c @@ -34,7 +34,7 @@ enum { }; static void parse_packet(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog) + struct sr_datafeed_analog_old *analog) { gboolean is_a, is_fast; uint16_t intval; @@ -89,12 +89,12 @@ static void parse_packet(const uint8_t *buf, float *floatval, static void decode_packet(struct sr_dev_inst *sdi) { struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct dev_context *devc; float floatval; devc = sdi->priv; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); parse_packet(devc->buf, &floatval, &analog); @@ -102,7 +102,7 @@ static void decode_packet(struct sr_dev_inst *sdi) analog.channels = sdi->channels; analog.num_samples = 1; analog.data = &floatval; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); diff --git a/src/hardware/uni-t-dmm/protocol.c b/src/hardware/uni-t-dmm/protocol.c index a6a8c715..4bbe20d6 100644 --- a/src/hardware/uni-t-dmm/protocol.c +++ b/src/hardware/uni-t-dmm/protocol.c @@ -57,14 +57,14 @@ static void decode_packet(struct sr_dev_inst *sdi, const uint8_t *buf) struct dev_context *devc; struct dmm_info *dmm; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; float floatval; void *info; int ret; devc = sdi->priv; dmm = (struct dmm_info *)sdi->driver; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); info = g_malloc(dmm->info_size); /* Parse the protocol packet. */ @@ -85,7 +85,7 @@ static void decode_packet(struct sr_dev_inst *sdi, const uint8_t *buf) analog.channels = sdi->channels; analog.num_samples = 1; analog.data = &floatval; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); diff --git a/src/hardware/uni-t-dmm/protocol.h b/src/hardware/uni-t-dmm/protocol.h index 02810b72..9844f20e 100644 --- a/src/hardware/uni-t-dmm/protocol.h +++ b/src/hardware/uni-t-dmm/protocol.h @@ -37,8 +37,8 @@ struct dmm_info { int packet_size; gboolean (*packet_valid)(const uint8_t *); int (*packet_parse)(const uint8_t *, float *, - struct sr_datafeed_analog *, void *); - void (*dmm_details)(struct sr_datafeed_analog *, void *); + struct sr_datafeed_analog_old *, void *); + void (*dmm_details)(struct sr_datafeed_analog_old *, void *); gsize info_size; }; diff --git a/src/hardware/uni-t-ut32x/protocol.c b/src/hardware/uni-t-ut32x/protocol.c index beced8d4..7fd1a02a 100644 --- a/src/hardware/uni-t-ut32x/protocol.c +++ b/src/hardware/uni-t-ut32x/protocol.c @@ -62,7 +62,7 @@ static void process_packet(struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; GString *spew; float temp; int i; @@ -89,7 +89,7 @@ static void process_packet(struct sr_dev_inst *sdi) is_valid = FALSE; if (is_valid) { - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.mq = SR_MQ_TEMPERATURE; analog.mqflags = 0; switch (devc->packet[5] - 0x30) { @@ -128,7 +128,7 @@ static void process_packet(struct sr_dev_inst *sdi) if (is_valid) { analog.num_samples = 1; analog.data = &temp; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); g_slist_free(analog.channels); diff --git a/src/hardware/yokogawa-dlm/protocol.c b/src/hardware/yokogawa-dlm/protocol.c index aef6197b..22ba0e3d 100644 --- a/src/hardware/yokogawa-dlm/protocol.c +++ b/src/hardware/yokogawa-dlm/protocol.c @@ -953,7 +953,7 @@ static int dlm_analog_samples_send(GArray *data, struct dev_context *devc; struct scope_state *model_state; struct sr_channel *ch; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_datafeed_packet packet; devc = sdi->priv; @@ -987,7 +987,7 @@ static int dlm_analog_samples_send(GArray *data, analog.mq = SR_MQ_VOLTAGE; analog.unit = SR_UNIT_VOLT; analog.mqflags = 0; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(sdi, &packet); g_slist_free(analog.channels); diff --git a/src/input/wav.c b/src/input/wav.c index 2f01f7d8..428dc73c 100644 --- a/src/input/wav.c +++ b/src/input/wav.c @@ -181,7 +181,7 @@ static int find_data_chunk(GString *buf, int initial_offset) static void send_chunk(const struct sr_input *in, int offset, int num_samples) { struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct context *inc; float fdata[CHUNK_SIZE]; uint64_t sample; @@ -223,7 +223,7 @@ static void send_chunk(const struct sr_input *in, int offset, int num_samples) s += inc->unitsize; d += inc->unitsize; } - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; analog.channels = in->sdi->channels; analog.num_samples = num_samples; diff --git a/src/lcr/es51919.c b/src/lcr/es51919.c index 91aedbca..89656530 100644 --- a/src/lcr/es51919.c +++ b/src/lcr/es51919.c @@ -485,7 +485,7 @@ static float parse_value(const uint8_t *buf) } static void parse_measurement(const uint8_t *pkt, float *floatval, - struct sr_datafeed_analog *analog, + struct sr_datafeed_analog_old *analog, int is_secondary) { static const struct { @@ -617,7 +617,7 @@ static int send_model_update(struct sr_dev_inst *sdi, unsigned int model) static void handle_packet(struct sr_dev_inst *sdi, const uint8_t *pkt) { struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct dev_context *devc; unsigned int val; float floatval; @@ -658,7 +658,7 @@ static void handle_packet(struct sr_dev_inst *sdi, const uint8_t *pkt) frame = TRUE; } - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); @@ -675,7 +675,7 @@ static void handle_packet(struct sr_dev_inst *sdi, const uint8_t *pkt) frame = TRUE; } - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 95ac98f1..89ff993f 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -975,25 +975,25 @@ struct es519xx_info { SR_PRIV gboolean sr_es519xx_2400_11b_packet_valid(const uint8_t *buf); SR_PRIV int sr_es519xx_2400_11b_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); SR_PRIV gboolean sr_es519xx_2400_11b_altfn_packet_valid(const uint8_t *buf); SR_PRIV int sr_es519xx_2400_11b_altfn_parse(const uint8_t *buf, - float *floatval, struct sr_datafeed_analog *analog, void *info); + float *floatval, struct sr_datafeed_analog_old *analog, void *info); SR_PRIV gboolean sr_es519xx_19200_11b_5digits_packet_valid(const uint8_t *buf); SR_PRIV int sr_es519xx_19200_11b_5digits_parse(const uint8_t *buf, - float *floatval, struct sr_datafeed_analog *analog, void *info); + float *floatval, struct sr_datafeed_analog_old *analog, void *info); SR_PRIV gboolean sr_es519xx_19200_11b_clamp_packet_valid(const uint8_t *buf); SR_PRIV int sr_es519xx_19200_11b_clamp_parse(const uint8_t *buf, - float *floatval, struct sr_datafeed_analog *analog, void *info); + float *floatval, struct sr_datafeed_analog_old *analog, void *info); SR_PRIV gboolean sr_es519xx_19200_11b_packet_valid(const uint8_t *buf); SR_PRIV int sr_es519xx_19200_11b_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); SR_PRIV gboolean sr_es519xx_19200_14b_packet_valid(const uint8_t *buf); SR_PRIV int sr_es519xx_19200_14b_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); SR_PRIV gboolean sr_es519xx_19200_14b_sel_lpf_packet_valid(const uint8_t *buf); SR_PRIV int sr_es519xx_19200_14b_sel_lpf_parse(const uint8_t *buf, - float *floatval, struct sr_datafeed_analog *analog, void *info); + float *floatval, struct sr_datafeed_analog_old *analog, void *info); /*--- hardware/dmm/fs9922.c -------------------------------------------------*/ @@ -1010,8 +1010,8 @@ struct fs9922_info { SR_PRIV gboolean sr_fs9922_packet_valid(const uint8_t *buf); SR_PRIV int sr_fs9922_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); -SR_PRIV void sr_fs9922_z1_diode(struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); +SR_PRIV void sr_fs9922_z1_diode(struct sr_datafeed_analog_old *analog, void *info); /*--- hardware/dmm/fs9721.c -------------------------------------------------*/ @@ -1026,12 +1026,12 @@ struct fs9721_info { SR_PRIV gboolean sr_fs9721_packet_valid(const uint8_t *buf); SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); -SR_PRIV void sr_fs9721_00_temp_c(struct sr_datafeed_analog *analog, void *info); -SR_PRIV void sr_fs9721_01_temp_c(struct sr_datafeed_analog *analog, void *info); -SR_PRIV void sr_fs9721_10_temp_c(struct sr_datafeed_analog *analog, void *info); -SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog *analog, void *info); -SR_PRIV void sr_fs9721_max_c_min(struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); +SR_PRIV void sr_fs9721_00_temp_c(struct sr_datafeed_analog_old *analog, void *info); +SR_PRIV void sr_fs9721_01_temp_c(struct sr_datafeed_analog_old *analog, void *info); +SR_PRIV void sr_fs9721_10_temp_c(struct sr_datafeed_analog_old *analog, void *info); +SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog_old *analog, void *info); +SR_PRIV void sr_fs9721_max_c_min(struct sr_datafeed_analog_old *analog, void *info); /*--- hardware/dmm/m2110.c --------------------------------------------------*/ @@ -1039,7 +1039,7 @@ SR_PRIV void sr_fs9721_max_c_min(struct sr_datafeed_analog *analog, void *info); SR_PRIV gboolean sr_m2110_packet_valid(const uint8_t *buf); SR_PRIV int sr_m2110_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); /*--- hardware/dmm/metex14.c ------------------------------------------------*/ @@ -1058,7 +1058,7 @@ SR_PRIV int sr_metex14_packet_request(struct sr_serial_dev_inst *serial); #endif SR_PRIV gboolean sr_metex14_packet_valid(const uint8_t *buf); SR_PRIV int sr_metex14_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); /*--- hardware/dmm/rs9lcd.c -------------------------------------------------*/ @@ -1069,7 +1069,7 @@ struct rs9lcd_info { int dummy; }; SR_PRIV gboolean sr_rs9lcd_packet_valid(const uint8_t *buf); SR_PRIV int sr_rs9lcd_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); /*--- hardware/dmm/bm25x.c --------------------------------------------------*/ @@ -1080,7 +1080,7 @@ struct bm25x_info { int dummy; }; SR_PRIV gboolean sr_brymen_bm25x_packet_valid(const uint8_t *buf); SR_PRIV int sr_brymen_bm25x_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); /*--- hardware/dmm/ut71x.c --------------------------------------------------*/ @@ -1095,7 +1095,7 @@ struct ut71x_info { SR_PRIV gboolean sr_ut71x_packet_valid(const uint8_t *buf); SR_PRIV int sr_ut71x_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); /*--- hardware/dmm/vc870.c --------------------------------------------------*/ @@ -1116,7 +1116,7 @@ struct vc870_info { SR_PRIV gboolean sr_vc870_packet_valid(const uint8_t *buf); SR_PRIV int sr_vc870_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); /*--- hardware/lcr/es51919.c ------------------------------------------------*/ @@ -1148,7 +1148,7 @@ struct ut372_info { SR_PRIV gboolean sr_ut372_packet_valid(const uint8_t *buf); SR_PRIV int sr_ut372_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); /*--- hardware/scale/kern.c -------------------------------------------------*/ @@ -1161,6 +1161,6 @@ struct kern_info { 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 *analog, void *info); + struct sr_datafeed_analog_old *analog, void *info); #endif diff --git a/src/output/analog.c b/src/output/analog.c index 4018ec88..e2667fd8 100644 --- a/src/output/analog.c +++ b/src/output/analog.c @@ -278,7 +278,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p GString **out) { struct context *ctx; - const struct sr_datafeed_analog *analog; + const struct sr_datafeed_analog_old *analog_old; const struct sr_datafeed_analog2 *analog2; struct sr_channel *ch; GSList *l; @@ -299,16 +299,16 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p case SR_DF_FRAME_END: *out = g_string_new("FRAME-END\n"); break; - case SR_DF_ANALOG: - analog = packet->payload; - fdata = (float *)analog->data; + case SR_DF_ANALOG_OLD: + analog_old = packet->payload; + fdata = (float *)analog_old->data; *out = g_string_sized_new(512); - num_channels = g_slist_length(analog->channels); - for (si = 0; si < analog->num_samples; si++) { - for (l = analog->channels, c = 0; l; l = l->next, c++) { + num_channels = g_slist_length(analog_old->channels); + for (si = 0; si < analog_old->num_samples; si++) { + for (l = analog_old->channels, c = 0; l; l = l->next, c++) { ch = l->data; g_string_append_printf(*out, "%s: ", ch->name); - fancyprint(analog->unit, analog->mqflags, + fancyprint(analog_old->unit, analog_old->mqflags, fdata[si * num_channels + c], *out); } } diff --git a/src/output/csv.c b/src/output/csv.c index 9eff8238..250e6cf4 100644 --- a/src/output/csv.c +++ b/src/output/csv.c @@ -192,7 +192,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p { const struct sr_datafeed_meta *meta; const struct sr_datafeed_logic *logic; - const struct sr_datafeed_analog *analog; + const struct sr_datafeed_analog_old *analog_old; const struct sr_datafeed_analog2 *analog2; const struct sr_config *src; unsigned int num_samples; @@ -268,16 +268,16 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p g_string_append_printf(*out, "\n"); } break; - case SR_DF_ANALOG: + case SR_DF_ANALOG_OLD: case SR_DF_ANALOG2: - analog = packet->payload; + analog_old = packet->payload; analog2 = packet->payload; - if (packet->type == SR_DF_ANALOG) { - channels = analog->channels; + if (packet->type == SR_DF_ANALOG_OLD) { + channels = analog_old->channels; numch = g_slist_length(channels); - num_samples = analog->num_samples; - data = analog->data; + num_samples = analog_old->num_samples; + data = analog_old->data; } else { channels = analog2->meaning->channels; numch = g_slist_length(channels); diff --git a/src/output/wav.c b/src/output/wav.c index cd0694ab..212574da 100644 --- a/src/output/wav.c +++ b/src/output/wav.c @@ -236,7 +236,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p { struct out_context *outc; const struct sr_datafeed_meta *meta; - const struct sr_datafeed_analog *analog; + const struct sr_datafeed_analog_old *analog_old; const struct sr_datafeed_analog2 *analog2; const struct sr_config *src; struct sr_channel *ch; @@ -261,7 +261,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p outc->samplerate = g_variant_get_uint64(src->data); } break; - case SR_DF_ANALOG: + case SR_DF_ANALOG_OLD: case SR_DF_ANALOG2: if (!outc->header_done) { *out = gen_header(o); @@ -269,14 +269,14 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p } else *out = g_string_sized_new(512); - analog = packet->payload; + analog_old = packet->payload; analog2 = packet->payload; - if (packet->type == SR_DF_ANALOG) { - num_samples = analog->num_samples; - channels = analog->channels; - num_channels = g_slist_length(analog->channels); - data = analog->data; + if (packet->type == SR_DF_ANALOG_OLD) { + num_samples = analog_old->num_samples; + channels = analog_old->channels; + num_channels = g_slist_length(analog_old->channels); + data = analog_old->data; } else { num_samples = analog2->num_samples; channels = analog2->meaning->channels; @@ -297,7 +297,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p } if (num_samples > outc->chanbuf_size) { - if (realloc_chanbufs(o, analog->num_samples) != SR_OK) + if (realloc_chanbufs(o, analog_old->num_samples) != SR_OK) return SR_ERR_MALLOC; } @@ -312,7 +312,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p for (j = 0; j < num_channels; j++) { idx = chan_idx[j]; buf = outc->chanbuf[idx] + outc->chanbuf_used[idx]++ * 4; - f = analog->data[i * num_channels + j]; + f = analog_old->data[i * num_channels + j]; if (outc->scale != 0.0) f /= outc->scale; float_to_le(buf, f); diff --git a/src/scale/kern.c b/src/scale/kern.c index 0360030d..b4872ea4 100644 --- a/src/scale/kern.c +++ b/src/scale/kern.c @@ -110,7 +110,7 @@ static void parse_flags(const uint8_t *buf, struct kern_info *info) /* Byte LF: Always '\n' (newline, 0x0a, 10) */ } -static void handle_flags(struct sr_datafeed_analog *analog, float *floatval, +static void handle_flags(struct sr_datafeed_analog_old *analog, float *floatval, const struct kern_info *info) { (void)floatval; @@ -187,7 +187,7 @@ SR_PRIV gboolean sr_kern_packet_valid(const uint8_t *buf) * @param buf Buffer containing the protocol packet. Must not be NULL. * @param floatval Pointer to a float variable. That variable will contain the * result value upon parsing success. Must 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_old. The struct will be * filled with data according to the protocol packet. * Must not be NULL. * @param info Pointer to a struct kern_info. The struct will be filled @@ -197,7 +197,7 @@ SR_PRIV gboolean sr_kern_packet_valid(const uint8_t *buf) * 'analog' variable contents are undefined and should not be used. */ SR_PRIV int sr_kern_parse(const uint8_t *buf, float *floatval, - struct sr_datafeed_analog *analog, void *info) + struct sr_datafeed_analog_old *analog, void *info) { int ret; struct kern_info *info_local; diff --git a/src/session.c b/src/session.c index f058e072..4b3379f3 100644 --- a/src/session.c +++ b/src/session.c @@ -1000,7 +1000,7 @@ SR_API int sr_session_stopped_callback_set(struct sr_session *session, static void datafeed_dump(const struct sr_datafeed_packet *packet) { const struct sr_datafeed_logic *logic; - const struct sr_datafeed_analog *analog; + const struct sr_datafeed_analog_old *analog_old; const struct sr_datafeed_analog2 *analog2; /* Please use the same order as in libsigrok.h. */ @@ -1022,10 +1022,10 @@ static void datafeed_dump(const struct sr_datafeed_packet *packet) sr_dbg("bus: Received SR_DF_LOGIC packet (%" PRIu64 " bytes, " "unitsize = %d).", logic->length, logic->unitsize); break; - case SR_DF_ANALOG: - analog = packet->payload; - sr_dbg("bus: Received SR_DF_ANALOG packet (%d samples).", - analog->num_samples); + case SR_DF_ANALOG_OLD: + analog_old = packet->payload; + sr_dbg("bus: Received SR_DF_ANALOG_OLD packet (%d samples).", + analog_old->num_samples); break; case SR_DF_FRAME_BEGIN: sr_dbg("bus: Received SR_DF_FRAME_BEGIN packet."); @@ -1081,9 +1081,9 @@ SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi, return SR_ERR_BUG; } - if (packet->type == SR_DF_ANALOG) { + if (packet->type == SR_DF_ANALOG_OLD) { /* Convert to SR_DF_ANALOG2. */ - const struct sr_datafeed_analog *analog = packet->payload; + const struct sr_datafeed_analog_old *analog_old = packet->payload; struct sr_analog_encoding encoding; struct sr_analog_meaning meaning; struct sr_analog_spec spec; @@ -1091,8 +1091,8 @@ SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi, struct sr_datafeed_packet a2_packet; a2_packet.type = SR_DF_ANALOG2; a2_packet.payload = &analog2; - analog2.data = analog->data; - analog2.num_samples = analog->num_samples; + analog2.data = analog_old->data; + analog2.num_samples = analog_old->num_samples; analog2.encoding = &encoding; analog2.meaning = &meaning; analog2.spec = &spec; @@ -1110,10 +1110,10 @@ SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi, encoding.scale.q = 1; encoding.offset.p = 0; encoding.offset.q = 1; - meaning.mq = analog->mq; - meaning.unit = analog->unit; - meaning.mqflags = analog->mqflags; - meaning.channels = analog->channels; + meaning.mq = analog_old->mq; + meaning.unit = analog_old->unit; + meaning.mqflags = analog_old->mqflags; + meaning.channels = analog_old->channels; spec.spec_digits = 0; return sr_session_send(sdi, &a2_packet); } @@ -1466,8 +1466,8 @@ SR_PRIV int sr_packet_copy(const struct sr_datafeed_packet *packet, struct sr_datafeed_meta *meta_copy; const struct sr_datafeed_logic *logic; struct sr_datafeed_logic *logic_copy; - const struct sr_datafeed_analog *analog; - struct sr_datafeed_analog *analog_copy; + const struct sr_datafeed_analog_old *analog_old; + struct sr_datafeed_analog_old *analog_old_copy; const struct sr_datafeed_analog2 *analog2; struct sr_datafeed_analog2 *analog2_copy; uint8_t *payload; @@ -1499,18 +1499,18 @@ SR_PRIV int sr_packet_copy(const struct sr_datafeed_packet *packet, memcpy(logic_copy->data, logic->data, logic->length * logic->unitsize); (*copy)->payload = logic_copy; break; - case SR_DF_ANALOG: - analog = packet->payload; - analog_copy = g_malloc(sizeof(analog)); - analog_copy->channels = g_slist_copy(analog->channels); - analog_copy->num_samples = analog->num_samples; - analog_copy->mq = analog->mq; - analog_copy->unit = analog->unit; - analog_copy->mqflags = analog->mqflags; - analog_copy->data = g_malloc(analog->num_samples * sizeof(float)); - memcpy(analog_copy->data, analog->data, - analog->num_samples * sizeof(float)); - (*copy)->payload = analog_copy; + case SR_DF_ANALOG_OLD: + analog_old = packet->payload; + analog_old_copy = g_malloc(sizeof(analog_old)); + analog_old_copy->channels = g_slist_copy(analog_old->channels); + analog_old_copy->num_samples = analog_old->num_samples; + analog_old_copy->mq = analog_old->mq; + analog_old_copy->unit = analog_old->unit; + analog_old_copy->mqflags = analog_old->mqflags; + analog_old_copy->data = g_malloc(analog_old->num_samples * sizeof(float)); + memcpy(analog_old_copy->data, analog_old->data, + analog_old->num_samples * sizeof(float)); + (*copy)->payload = analog_old_copy; break; case SR_DF_ANALOG2: analog2 = packet->payload; @@ -1542,7 +1542,7 @@ void sr_packet_free(struct sr_datafeed_packet *packet) { const struct sr_datafeed_meta *meta; const struct sr_datafeed_logic *logic; - const struct sr_datafeed_analog *analog; + const struct sr_datafeed_analog_old *analog_old; const struct sr_datafeed_analog2 *analog2; struct sr_config *src; GSList *l; @@ -1571,10 +1571,10 @@ void sr_packet_free(struct sr_datafeed_packet *packet) g_free(logic->data); g_free((void *)packet->payload); break; - case SR_DF_ANALOG: - analog = packet->payload; - g_slist_free(analog->channels); - g_free(analog->data); + case SR_DF_ANALOG_OLD: + analog_old = packet->payload; + g_slist_free(analog_old->channels); + g_free(analog_old->data); g_free((void *)packet->payload); break; case SR_DF_ANALOG2: diff --git a/src/transform/invert.c b/src/transform/invert.c index 98d2240e..c1941d1a 100644 --- a/src/transform/invert.c +++ b/src/transform/invert.c @@ -30,7 +30,7 @@ static int receive(const struct sr_transform *t, struct sr_datafeed_packet **packet_out) { const struct sr_datafeed_logic *logic; - const struct sr_datafeed_analog *analog; + const struct sr_datafeed_analog_old *analog_old; const struct sr_datafeed_analog2 *analog2; struct sr_channel *ch; GSList *l; @@ -54,13 +54,13 @@ static int receive(const struct sr_transform *t, } } break; - case SR_DF_ANALOG: - analog = packet_in->payload; - fdata = (float *)analog->data; - num_channels = g_slist_length(analog->channels); - for (si = 0; si < analog->num_samples; si++) { + case SR_DF_ANALOG_OLD: + analog_old = packet_in->payload; + fdata = (float *)analog_old->data; + num_channels = g_slist_length(analog_old->channels); + for (si = 0; si < analog_old->num_samples; si++) { /* For now invert all values in all channels. */ - for (l = analog->channels, c = 0; l; l = l->next, c++) { + for (l = analog_old->channels, c = 0; l; l = l->next, c++) { ch = l->data; (void)ch; f = &fdata[si * num_channels + c]; diff --git a/src/transform/scale.c b/src/transform/scale.c index a65a4469..47937be9 100644 --- a/src/transform/scale.c +++ b/src/transform/scale.c @@ -49,7 +49,7 @@ static int receive(const struct sr_transform *t, struct sr_datafeed_packet **packet_out) { struct context *ctx; - const struct sr_datafeed_analog *analog; + const struct sr_datafeed_analog_old *analog_old; const struct sr_datafeed_analog2 *analog2; struct sr_channel *ch; GSList *l; @@ -62,14 +62,14 @@ static int receive(const struct sr_transform *t, ctx = t->priv; switch (packet_in->type) { - case SR_DF_ANALOG: - analog = packet_in->payload; - fdata = (float *)analog->data; - num_channels = g_slist_length(analog->channels); + case SR_DF_ANALOG_OLD: + analog_old = packet_in->payload; + fdata = (float *)analog_old->data; + num_channels = g_slist_length(analog_old->channels); factor = (float) ctx->factor.p / ctx->factor.q; - for (i = 0; i < analog->num_samples; i++) { + for (i = 0; i < analog_old->num_samples; i++) { /* For now scale all values in all channels. */ - for (l = analog->channels, c = 0; l; l = l->next, c++) { + for (l = analog_old->channels, c = 0; l; l = l->next, c++) { ch = l->data; (void)ch; fdata[i * num_channels + c] *= factor;