X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fvictor-dmm%2Fprotocol.c;h=18b0cd1f73ecb33087b5701ce1febef9678c91d2;hb=b15ff1c92aabeea04649de25a3a01f851ab0a1ec;hp=6f72d9470f1ee0b843599f77720382153f6eec5b;hpb=41caa31909882a34b88c8b8a844d555816b78453;p=libsigrok.git
diff --git a/src/hardware/victor-dmm/protocol.c b/src/hardware/victor-dmm/protocol.c
index 6f72d947..18b0cd1f 100644
--- a/src/hardware/victor-dmm/protocol.c
+++ b/src/hardware/victor-dmm/protocol.c
@@ -17,10 +17,11 @@
* along with this program. If not, see .
*/
+#include
#include
#include
#include
-#include "libsigrok.h"
+#include
#include "libsigrok-internal.h"
#include "protocol.h"
@@ -43,7 +44,7 @@ static uint8_t decode_digit(uint8_t in)
static void decode_buf(struct sr_dev_inst *sdi, unsigned char *data)
{
struct sr_datafeed_packet packet;
- struct sr_datafeed_analog2 analog;
+ struct sr_datafeed_analog analog;
struct sr_analog_encoding encoding;
struct sr_analog_meaning meaning;
struct sr_analog_spec spec;
@@ -259,22 +260,22 @@ static void decode_buf(struct sr_dev_inst *sdi, unsigned char *data)
analog.data = &fvalue;
analog.num_samples = 1;
- packet.type = SR_DF_ANALOG2;
+ packet.type = SR_DF_ANALOG;
packet.payload = &analog;
- sr_session_send(devc->cb_data, &packet);
+ sr_session_send(sdi, &packet);
- devc->num_samples++;
+ sr_sw_limits_update_samples_read(&devc->limits, 1);
}
SR_PRIV int victor_dmm_receive_data(struct sr_dev_inst *sdi, unsigned char *buf)
{
+ static const unsigned char obfuscation[DMM_DATA_SIZE] = "jodenxunickxia";
+ static const unsigned char shuffle[DMM_DATA_SIZE] = {
+ 6, 13, 5, 11, 2, 7, 9, 8, 3, 10, 12, 0, 4, 1
+ };
GString *dbg;
int i;
unsigned char data[DMM_DATA_SIZE];
- unsigned char obfuscation[DMM_DATA_SIZE] = "jodenxunickxia";
- unsigned char shuffle[DMM_DATA_SIZE] = {
- 6, 13, 5, 11, 2, 7, 9, 8, 3, 10, 12, 0, 4, 1
- };
for (i = 0; i < DMM_DATA_SIZE && buf[i] == 0; i++);
if (i == DMM_DATA_SIZE) {