X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fatten-pps3xxx%2Fprotocol.c;h=72b4a03ec5d4d9dc82e7777af14baf77627db97f;hb=b02bb45f4cf6378520e5a5b82ff39013cfa270b6;hp=e7d9d810c1c6dbfc2e5bf410192ce898f01d135c;hpb=2eb1612d463e9232af437d9a6c1b3897da2367e9;p=libsigrok.git diff --git a/src/hardware/atten-pps3xxx/protocol.c b/src/hardware/atten-pps3xxx/protocol.c index e7d9d810..72b4a03e 100644 --- a/src/hardware/atten-pps3xxx/protocol.c +++ b/src/hardware/atten-pps3xxx/protocol.c @@ -17,11 +17,11 @@ * along with this program. If not, see . */ +#include #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]; @@ -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; @@ -133,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; @@ -156,12 +155,10 @@ 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); } } } return TRUE; } -