[Nut-upsdev] [nut-commits] svn commit r1534 - in trunk: . drivers scripts/subdriver

Arjen de Korte nut+devel at de-korte.org
Thu Sep 25 06:08:07 UTC 2008


Citeren "Charles Lepple" <clepple at gmail.com>:

> On Wed, Sep 24, 2008 at 2:27 PM, Arjen de Korte
> <adkorte-guest at alioth.debian.org> wrote:
>> -  /* Server side variables */
>> -  { "driver.version.internal", ST_FLAG_STRING,  
>> sizeof(DRIVER_VERSION), NULL, NULL, DRIVER_VERSION, HU_FLAG_ABSENT,  
>> NULL },
>> -  { "driver.version.data", ST_FLAG_STRING,  
>> sizeof(APC_HID_VERSION), NULL, NULL, APC_HID_VERSION,  
>> HU_FLAG_ABSENT, NULL },
>
> Just curious, why were the subdriver versions removed?

They weren't removed, they are just handled in a much more efficient  
way. All information is available by the time we run upsdrv_initinfo()  
in usbhid-ups.c:

839 	        dstate_setinfo("driver.version.data", subdriver->name);
840 	        dstate_setinfo("driver.version.internal", DRIVER_VERSION);

So instead of treating this as a pseudo HID path and having to decode  
this, we set these directly. The subdriver->name is available anyway.

The main reason for doing so, is that the HU_FLAG_ABSENT flag is now  
treated slightly different. It will now first check the presence of  
the HID path, before setting the server side variable to allow for  
conditional server side variables like 'ups.delay.start'. The latter  
will now only be set, if it is possible to set a delayed start,  
otherwise it won't show in the list of writeable variables.

Best regards, Arjen
-- 
Please keep list traffic on the list




More information about the Nut-upsdev mailing list