} else if (buf[14] & 0x80) {
analog[0].meaning->mq = SR_MQ_CURRENT;
analog[0].meaning->unit = SR_UNIT_AMPERE;
} else if (buf[14] & 0x80) {
analog[0].meaning->mq = SR_MQ_CURRENT;
analog[0].meaning->unit = SR_UNIT_AMPERE;
- if (buf[14] & 0x40) { floatval[0] *= 1e-9; digits[0] += 9; } /* n */
- if (buf[15] & 0x08) { floatval[0] *= 1e-6; digits[0] += 6; } /* µ */
- if (buf[15] & 0x04) { floatval[0] *= 1e-3; digits[0] += 3; } /* m */
- if (buf[15] & 0x40) { floatval[0] *= 1e3; digits[0] -= 3; } /* k */
- if (buf[15] & 0x20) { floatval[0] *= 1e6; digits[0] -= 6; } /* M */
+ if (buf[14] & 0x40) { floatval[0] *= 1e-9; digits[0] += 9; } /* n */
+ if (buf[15] & 0x08) { floatval[0] *= 1e-6; digits[0] += 6; } /* µ */
+ if (buf[15] & 0x04) { floatval[0] *= 1e-3; digits[0] += 3; } /* m */
+ if (buf[15] & 0x40) { floatval[0] *= 1e3; digits[0] -= 3; } /* k */
+ if (buf[15] & 0x20) { floatval[0] *= 1e6; digits[0] -= 6; } /* M */
- if (buf[ 9] & 0x01) { floatval[1] *= 1e-6; digits[1] += 6; } /* µ */
- if (buf[ 9] & 0x02) { floatval[1] *= 1e-3; digits[1] += 3; } /* m */
- if (buf[14] & 0x02) { floatval[1] *= 1e3; digits[1] -= 3; } /* k */
- if (buf[14] & 0x01) { floatval[1] *= 1e6; digits[1] -= 6; } /* M */
+ if (buf[ 9] & 0x01) { floatval[1] *= 1e-6; digits[1] += 6; } /* µ */
+ if (buf[ 9] & 0x02) { floatval[1] *= 1e-3; digits[1] += 3; } /* m */
+ if (buf[14] & 0x02) { floatval[1] *= 1e3; digits[1] -= 3; } /* k */
+ if (buf[14] & 0x01) { floatval[1] *= 1e6; digits[1] -= 6; } /* M */
struct sr_analog_encoding encoding[2];
struct sr_analog_meaning meaning[2];
struct sr_analog_spec spec[2];
struct sr_analog_encoding encoding[2];
struct sr_analog_meaning meaning[2];
struct sr_analog_spec spec[2];
sr_analog_init(&analog[0], &encoding[0], &meaning[0], &spec[0], 0);
sr_analog_init(&analog[1], &encoding[1], &meaning[1], &spec[1], 0);
brymen_bm86x_parse(buf, floatval, analog);
sr_analog_init(&analog[0], &encoding[0], &meaning[0], &spec[0], 0);
sr_analog_init(&analog[1], &encoding[1], &meaning[1], &spec[1], 0);
brymen_bm86x_parse(buf, floatval, analog);
packet.type = SR_DF_ANALOG;
packet.payload = &analog[0];
sr_session_send(sdi, &packet);
g_slist_free(analog[0].meaning->channels);
}
packet.type = SR_DF_ANALOG;
packet.payload = &analog[0];
sr_session_send(sdi, &packet);
g_slist_free(analog[0].meaning->channels);
}
packet.type = SR_DF_ANALOG;
packet.payload = &analog[1];
sr_session_send(sdi, &packet);
g_slist_free(analog[1].meaning->channels);
}
packet.type = SR_DF_ANALOG;
packet.payload = &analog[1];
sr_session_send(sdi, &packet);
g_slist_free(analog[1].meaning->channels);
}
sr_dbg("Sending HID set report.");
ret = libusb_control_transfer(usb->devhdl,
sr_dbg("Sending HID set report.");
ret = libusb_control_transfer(usb->devhdl,
LIBUSB_RECIPIENT_INTERFACE |
LIBUSB_ENDPOINT_OUT,
9, /* bRequest: HID set_report */
LIBUSB_RECIPIENT_INTERFACE |
LIBUSB_ENDPOINT_OUT,
9, /* bRequest: HID set_report */