X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fteleinfo%2Fprotocol.c;h=1938664d03c26dbf962ecda6a7034db6a6bca68b;hb=bc9aa94b92c5ac0271769af4605992d7a38e65bc;hp=88fbfac36838280303eaa2e2b2afa4c4d10276c2;hpb=869c83751149aa03cda072355c2b670569cdfc0d;p=libsigrok.git diff --git a/src/hardware/teleinfo/protocol.c b/src/hardware/teleinfo/protocol.c index 88fbfac3..1938664d 100644 --- a/src/hardware/teleinfo/protocol.c +++ b/src/hardware/teleinfo/protocol.c @@ -96,35 +96,34 @@ static void teleinfo_handle_measurement(struct sr_dev_inst *sdi, return; } - if (!strcmp(label, "ADCO")) { + if (!strcmp(label, "ADCO")) sr_sw_limits_update_samples_read(&devc->sw_limits, 1); - } else if (!strcmp(label, "BASE")) { - teleinfo_send_value(sdi, "BASE", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "HCHP")) { - teleinfo_send_value(sdi, "HP" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "HCHC")) { - teleinfo_send_value(sdi, "HC" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "EJPHN")) { - teleinfo_send_value(sdi, "HN" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "EJPHPM")) { - teleinfo_send_value(sdi, "HPM" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHPJB")) { - teleinfo_send_value(sdi, "HPJB", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHPJW")) { - teleinfo_send_value(sdi, "HPJW", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHPJR")) { - teleinfo_send_value(sdi, "HPJR", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHCJB")) { - teleinfo_send_value(sdi, "HCJB", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } else if (!strcmp(label, "BBRHCJW")) { - teleinfo_send_value(sdi, "HCJW", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR); - } 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, "BASE")) + teleinfo_send_value(sdi, "BASE", v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + else if (!strcmp(label, "HCHP")) + teleinfo_send_value(sdi, "HP" , v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + else if (!strcmp(label, "HCHC")) + teleinfo_send_value(sdi, "HC" , v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + else if (!strcmp(label, "EJPHN")) + teleinfo_send_value(sdi, "HN" , v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + else if (!strcmp(label, "EJPHPM")) + teleinfo_send_value(sdi, "HPM" , v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + else if (!strcmp(label, "BBRHPJB")) + teleinfo_send_value(sdi, "HPJB", v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + else if (!strcmp(label, "BBRHPJW")) + teleinfo_send_value(sdi, "HPJW", v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + else if (!strcmp(label, "BBRHPJR")) + teleinfo_send_value(sdi, "HPJR", v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + else if (!strcmp(label, "BBRHCJB")) + teleinfo_send_value(sdi, "HCJB", v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + else if (!strcmp(label, "BBRHCJW")) + teleinfo_send_value(sdi, "HCJW", v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + else if (!strcmp(label, "BBRHCJR")) + teleinfo_send_value(sdi, "HCJR", v, SR_MQ_ENERGY, SR_UNIT_WATT_HOUR); + 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, @@ -221,7 +220,7 @@ SR_PRIV int teleinfo_receive_data(int fd, int revents, void *cb_data) } if (sr_sw_limits_check(&devc->sw_limits)) - sdi->driver->dev_acquisition_stop(sdi); + sr_dev_acquisition_stop(sdi); return TRUE; }