[Nut-upsdev] Liebert ESP II driver

Robert Jobbagy jobbagy.robert at gmail.com
Sat Jul 31 11:35:49 UTC 2010


2010/7/30 Robert Jobbagy <jobbagy.robert at gmail.com>

> sorry , returns it's my fault,it was copy-paste from other function.


I fixed the returns but never happend, the ups didnt shutdown .
I think shutdown function cant performed, I dont know why

>
> but I checked the  upsdebug_hex function and I saw it use fprintf with
> stderr and I think it will be to work.
>
> 2010/7/30 Arjen de Korte <nut+devel at de-korte.org<nut%2Bdevel at de-korte.org>
> >
>
>> Citeren Robert Jobbagy <jobbagy.robert at gmail.com>:
>>
>>  This is my shutdown function:
>>>
>>> void upsdrv_shutdown(void)
>>> {
>>>    int ret;
>>>
>>>    fprintf(stderr,"SHUTDOWN 1");
>>>
>>
>> This doesn't work. The driver backgrounds before it reaches this point, so
>> you can't use fprintf at this point anymore.
>>
>>
>>     ret = ser_send_buf(upsfd, cmd_UPSShutdown0, SHUTDOWN_CMD_LEN);
>>>    if (ret < 0) {
>>>        upsdebug_with_errno(2, "send");
>>>        return -1;
>>>    }
>>>    else if (ret < 6) {
>>>        upsdebug_hex(2, "send: truncated", cmd_UPSShutdown0, ret);
>>>        return -1;
>>>    }
>>>
>>
>> A void function can't return a value. Does the above actually compile
>> without errors? If it does, change the compiler flags so that it doesn't.
>> Also make sure that you're running your freshly compiled driver.
>>
>> [...]
>>
>>
>>  These commands works other way , but in this function didnt work
>>>
>>> And I cant found the "SHUTDOWN 1,2,3" test texts in debug.log, so I think
>>> dont sent these commands to UPS.
>>>
>>
>> See above.
>>
>>
>> Best regards, Arjen
>> --
>> Please keep list traffic on the list
>>
>>
>> _______________________________________________
>> Nut-upsdev mailing list
>> Nut-upsdev at lists.alioth.debian.org
>> http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev
>>
>
>
>
> --
> Best Regards,
>
> Robert
>



-- 
Best Regards,

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20100731/76826b2b/attachment.htm>


More information about the Nut-upsdev mailing list