<br><br><div class="gmail_quote">2010/7/30 Robert Jobbagy <span dir="ltr">&lt;<a href="mailto:jobbagy.robert@gmail.com">jobbagy.robert@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
sorry , returns it&#39;s my fault,it was copy-paste from other function.</blockquote><div><br>I fixed the returns but never happend, the ups didnt shutdown .<br>I think shutdown function cant performed, I dont know why <br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><br></div><div>but I checked the <span style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;"> upsdebug_hex function and I saw it use fprintf with stderr and I think it will be to work.</span><br>

<br><div class="gmail_quote"><div class="im">2010/7/30 Arjen de Korte <span dir="ltr">&lt;<a href="mailto:nut%2Bdevel@de-korte.org" target="_blank">nut+devel@de-korte.org</a>&gt;</span><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div>Citeren Robert Jobbagy &lt;<a href="mailto:jobbagy.robert@gmail.com" target="_blank">jobbagy.robert@gmail.com</a>&gt;:<br>
<br>
</div><div><div></div><div class="h5"><div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
This is my shutdown function:<br>
<br>
void upsdrv_shutdown(void)<br>
{<br>
    int ret;<br>
<br>
    fprintf(stderr,&quot;SHUTDOWN 1&quot;);<br>
</blockquote>
<br></div>
This doesn&#39;t work. The driver backgrounds before it reaches this point, so you can&#39;t use fprintf at this point anymore.<div><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
    ret = ser_send_buf(upsfd, cmd_UPSShutdown0, SHUTDOWN_CMD_LEN);<br>
    if (ret &lt; 0) {<br>
        upsdebug_with_errno(2, &quot;send&quot;);<br>
        return -1;<br>
    }<br>
    else if (ret &lt; 6) {<br>
        upsdebug_hex(2, &quot;send: truncated&quot;, cmd_UPSShutdown0, ret);<br>
        return -1;<br>
    }<br>
</blockquote>
<br></div>
A void function can&#39;t return a value. Does the above actually compile without errors? If it does, change the compiler flags so that it doesn&#39;t. Also make sure that you&#39;re running your freshly compiled driver.<br>


<br>
[...]<div><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
These commands works other way , but in this function didnt work<br>
<br>
And I cant found the &quot;SHUTDOWN 1,2,3&quot; test texts in debug.log, so I think<br>
dont sent these commands to UPS.<br>
</blockquote>
<br></div>
See above.<div><div></div><div><br>
<br>
Best regards, Arjen<br>
-- <br>
Please keep list traffic on the list<br>
<br>
<br>
_______________________________________________<br>
Nut-upsdev mailing list<br>
<a href="mailto:Nut-upsdev@lists.alioth.debian.org" target="_blank">Nut-upsdev@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev</a><br>
</div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br><br>Robert <br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br><br>Robert <br>