X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fatten-pps3xxx%2Fprotocol.c;h=06a1d2e90d93546af3602e41ac399c04a9816d63;hb=c50805d59ce85e00ef263c0a1edad2487bb8a9fe;hp=8e678a16867ea7024ec84c0e18a03cc6d00e64ce;hpb=8d5228015d0f07ce6626aa52ffb80bc4129f7dbe;p=libsigrok.git
diff --git a/src/hardware/atten-pps3xxx/protocol.c b/src/hardware/atten-pps3xxx/protocol.c
index 8e678a16..06a1d2e9 100644
--- a/src/hardware/atten-pps3xxx/protocol.c
+++ b/src/hardware/atten-pps3xxx/protocol.c
@@ -17,10 +17,11 @@
* along with this program. If not, see .
*/
+#include
#include
#include "protocol.h"
-static void dump_packet(char *msg, uint8_t *packet)
+static void dump_packet(const char *msg, uint8_t *packet)
{
int i;
char str[128];
@@ -36,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;
@@ -132,7 +133,6 @@ SR_PRIV int atten_pps3xxx_receive_data(int fd, int revents, void *cb_data)
struct dev_context *devc;
const struct sr_dev_inst *sdi;
struct sr_serial_dev_inst *serial;
- struct sr_datafeed_packet packet;
unsigned char c;
(void)fd;
@@ -155,8 +155,7 @@ SR_PRIV int atten_pps3xxx_receive_data(int fd, int revents, void *cb_data)
send_config(sdi);
else {
serial_source_remove(sdi->session, serial);
- packet.type = SR_DF_END;
- sr_session_send(sdi, &packet);
+ std_session_send_df_end(sdi, LOG_PREFIX);
}
}
}