Skip to content

usb-gotemp: USB thermometer emulation

Scott Tsai qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyIn review
  2. v23 patches 17 repliesSuperseded
  3. v13 patches 0 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3usb: move HID request defines to hw/usb.hhw/usb-hid.c hw/usb.h+14 -140 replies
2/3usb-gotemp: new module emulating a USB thermometerMakefile hw/usb-gotemp.c monitor.c +2 more+916 -10 replies
3/3Documentation: -usbdevice thermometer optionqemu-options.hx+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [Qemu-devel] [PATCH V3 0/3] usb-gotemp: USB thermometer emulation

I reworked the second patch in this series to add generic monitor commands to change the temperature reported from thermometers.
Thermometer devices can now include "sensor.h" and call 'qemu_add_therm_temp_handler' to register themselves.

I went with separate 'therm_set DEVICE_INDEX' and 'therm_temp TEMPERATURE' commands since a 'therm_temp' command that only requires one argument seems easier to use on the monitor command line and doesn't require searching the list of thermometers repeatedly.

To cater to my original "driver tutorial" use case,
by default the temperature would still automatically increment unless the 'controlled_by_monitor' qdev property is set.
Even when auto incrementing the temperature is now always bounded between 25C ~ 40C. (previously the temperature would increment until int16_t overflows)