Index | Thread | Search

From:
Raf Czlonka <rczlonka@gmail.com>
Subject:
Re: upd(4): add more sensors (load, power..)
To:
Landry Breuil <landry@openbsd.org>
Cc:
tech@openbsd.org
Date:
Thu, 21 Nov 2024 09:22:20 +0000

Download raw body.

Thread
  • Raf Czlonka:

    upd(4): add more sensors (load, power..)

  • On Sat, Nov 16, 2024 at 11:30:47AM GMT, Landry Breuil wrote:
    > Index: upd.c
    > ===================================================================
    > RCS file: /cvs/src/sys/dev/usb/upd.c,v
    > diff -u -r1.32 upd.c
    > --- upd.c	23 May 2024 03:21:09 -0000	1.32
    > +++ upd.c	16 Nov 2024 11:15:52 -0000
    > @@ -34,6 +34,7 @@
    >  #include <dev/usb/usbhid.h>
    >  #include <dev/usb/uhidev.h>
    >  
    > +#define UPD_DEBUG
    >  #ifdef UPD_DEBUG
    >  #define DPRINTF(x)	do { printf x; } while (0)
    >  #else
    > @@ -60,6 +61,20 @@
    >  	    SENSOR_PERCENT,	 "RemainingCapacity" },
    >  	{ HUP_BATTERY,	HUB_FULLCHARGE_CAPACITY,
    >  	    SENSOR_PERCENT,	 "FullChargeCapacity" },
    > +	{ HUP_POWER,	HUP_PERCENT_LOAD,
    > +	    SENSOR_PERCENT,	 "PercentLoad" },
    > +	{ HUP_POWER,	HUP_ACTIVE_POWER,
    > +	    SENSOR_WATTS,	 "ActivePower" },
    > +	{ HUP_POWER,	HUP_CONFIG_APP_POWER,
    > +	    SENSOR_WATTS,	 "ConfigApparentPower" },
    > +	{ HUP_POWER,	HUP_APPARENT_POWER,
    > +	    SENSOR_WATTS,	 "ApparentPower" },
    > +	{ HUP_POWER,	HUP_OUTPUT,
    > +	    SENSOR_WATTS,	 "Output" },
    > +	{ HUP_POWER,	HUP_VOLTAGE,
    > +	    SENSOR_VOLTS_DC,	 "VoltageDc" },
                                             ^^
    May I suggest capitalising "DC" in "VoltageDc", given that "AC" is
    already capitalised in "ACPresent"?
    
    Regards,
    
    Raf
    
    
    
  • Raf Czlonka:

    upd(4): add more sensors (load, power..)