*/
#include <config.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
+
#include <glib.h>
-#include <nettle/aes.h>
#include <libsigrok/libsigrok.h>
+#include <math.h>
+#include <nettle/aes.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "libsigrok-internal.h"
#include "protocol.h"
{ "D-", { 64 + 36, BVT_LE_UINT32, 1e-2, }, 2, SR_MQ_VOLTAGE, SR_UNIT_VOLT },
{ "E0", { 64 + 12, BVT_LE_UINT32, 1e-3, }, 3, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR },
{ "E1", { 64 + 20, BVT_LE_UINT32, 1e-3, }, 3, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR },
- { NULL, },
+ ALL_ZERO,
};
static int check_pac_crc(uint8_t *data)
}
}
-static int process_poll_pkt(struct dev_context *devc, uint8_t *dst)
+static int process_poll_pkt(struct dev_context *devc, uint8_t *dst)
{
struct aes256_ctx ctx;
return SR_OK;
}
-SR_PRIV int rdtech_tc_probe(struct sr_serial_dev_inst *serial, struct dev_context *devc)
+SR_PRIV int rdtech_tc_probe(struct sr_serial_dev_inst *serial, struct dev_context *devc)
{
int len;
uint8_t poll_pkt[TC_POLL_LEN];
if (serial_write_blocking(serial, &POLL_CMD, sizeof(POLL_CMD) - 1,
- SERIAL_WRITE_TIMEOUT_MS) < 0) {
+ SERIAL_WRITE_TIMEOUT_MS) < 0) {
sr_err("Unable to send probe request.");
return SR_ERR;
}
struct sr_serial_dev_inst *serial = sdi->conn;
if (serial_write_blocking(serial, &POLL_CMD, sizeof(POLL_CMD) - 1,
- SERIAL_WRITE_TIMEOUT_MS) < 0) {
+ SERIAL_WRITE_TIMEOUT_MS) < 0) {
sr_err("Unable to send poll request.");
return SR_ERR;
}
for (ch = sdi->channels, i = 0; ch; ch = g_slist_next(ch), i++) {
bv_send_analog_channel(sdi, ch->data,
- &devc->channels[i], poll_pkt, TC_POLL_LEN);
- }
+ &devc->channels[i], poll_pkt, TC_POLL_LEN);
+ }
sr_sw_limits_update_samples_read(&devc->limits, 1);
}