int ret;
ret = ftdi_write_data(&devc->ftdic, (unsigned char *)buf, size);
- if (ret < 0) {
+ if (ret < 0)
sr_err("ftdi_write_data failed: %s",
ftdi_get_error_string(&devc->ftdic));
- } else if ((size_t) ret != size) {
+ else if ((size_t) ret != size)
sr_err("ftdi_write_data did not complete write.");
- }
return ret;
}
if (match->match == SR_TRIGGER_ONE) {
devc->trigger.simplevalue |= channelbit;
devc->trigger.simplemask |= channelbit;
- }
- else if (match->match == SR_TRIGGER_ZERO) {
+ } else if (match->match == SR_TRIGGER_ZERO) {
devc->trigger.simplevalue &= ~channelbit;
devc->trigger.simplemask |= channelbit;
- }
- else if (match->match == SR_TRIGGER_FALLING) {
+ } else if (match->match == SR_TRIGGER_FALLING) {
devc->trigger.fallingmask |= channelbit;
trigger_set++;
- }
- else if (match->match == SR_TRIGGER_RISING) {
+ } else if (match->match == SR_TRIGGER_RISING) {
devc->trigger.risingmask |= channelbit;
trigger_set++;
}
dgt = bc(devc->buf[5 + cnt]);
if (dgt == 11) { /* Empty digit */
dgt = 0;
- }
- else if (dgt >= 12) { /* Overload */
+ } else if (dgt >= 12) { /* Overload */
devc->value = NAN;
devc->scale = 0;
break;
sr_err("Device: Unknown error code!");
}
retc = SR_ERR_ARG;
- }
- else if (!isreq && ((devc->buf[1] != 0x27) || (devc->buf[2] != 0x3f))) {
+ } else if (!isreq && ((devc->buf[1] != 0x27) || (devc->buf[2] != 0x3f))) {
sr_err("process_msg_14(): byte 1/2 unexpected!");
retc = SR_ERR_ARG;
}
devc->value = NAN;
devc->scale = 0;
break;
- }
- else if (dgt == 13) { /* FUSE */
+ } else if (dgt == 13) { /* FUSE */
sr_err("FUSE!");
- }
- else if (dgt == 14) { /* Function recognition mode, OPEN */
+ } else if (dgt == 14) { /* Function recognition mode, OPEN */
sr_info("Function recognition mode, OPEN!");
devc->value = NAN;
devc->scale = 0;
process_msg_inf_10(sdi);
devc->buflen = 0;
continue;
- }
- else if ((devc->buflen >= 5) &&
+ } else if ((devc->buflen >= 5) &&
(devc->buf[devc->buflen - 1] &
MSGID_MASK) != MSGID_DATA) {
/*
* of next message.
*/
process_msg_inf_5(sdi);
- devc->buf[0] =
- devc->buf[devc->buflen - 1];
+ devc->buf[0] = devc->buf[devc->buflen - 1];
devc->buflen = 1;
continue;
}
if (devc->cmd_seq % 10 == 0) {
if (req_stat14(sdi, FALSE) != SR_OK)
return FALSE;
- }
- else if (req_meas14(sdi) != SR_OK)
+ } else if (req_meas14(sdi) != SR_OK)
return FALSE;
}
}
return;
}
- if (!strcmp(label, "ADCO")) {
+ if (!strcmp(label, "ADCO"))
sr_sw_limits_update_samples_read(&devc->sw_limits, 1);
- } else if (!strcmp(label, "BASE")) {
+ else if (!strcmp(label, "BASE"))
teleinfo_send_value(sdi, "BASE", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "HCHP")) {
+ else if (!strcmp(label, "HCHP"))
teleinfo_send_value(sdi, "HP" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "HCHC")) {
+ else if (!strcmp(label, "HCHC"))
teleinfo_send_value(sdi, "HC" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "EJPHN")) {
+ else if (!strcmp(label, "EJPHN"))
teleinfo_send_value(sdi, "HN" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "EJPHPM")) {
+ else if (!strcmp(label, "EJPHPM"))
teleinfo_send_value(sdi, "HPM" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "BBRHPJB")) {
+ else if (!strcmp(label, "BBRHPJB"))
teleinfo_send_value(sdi, "HPJB", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "BBRHPJW")) {
+ else if (!strcmp(label, "BBRHPJW"))
teleinfo_send_value(sdi, "HPJW", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "BBRHPJR")) {
+ else if (!strcmp(label, "BBRHPJR"))
teleinfo_send_value(sdi, "HPJR", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "BBRHCJB")) {
+ else if (!strcmp(label, "BBRHCJB"))
teleinfo_send_value(sdi, "HCJB", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "BBRHCJW")) {
+ else if (!strcmp(label, "BBRHCJW"))
teleinfo_send_value(sdi, "HCJW", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "BBRHCJR")) {
+ else if (!strcmp(label, "BBRHCJR"))
teleinfo_send_value(sdi, "HCJR", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
- } else if (!strcmp(label, "IINST")) {
+ else if (!strcmp(label, "IINST"))
teleinfo_send_value(sdi, "IINST", v, SR_MQ_CURRENT, SR_UNIT_AMPERE);
- } else if (!strcmp(label, "PAPP")) {
+ else if (!strcmp(label, "PAPP"))
teleinfo_send_value(sdi, "PAPP", v, SR_MQ_POWER, SR_UNIT_VOLT_AMPERE);
- }
}
static gboolean teleinfo_parse_group(struct sr_dev_inst *sdi,