sorry , returns it&#39;s my fault,it was copy-paste from other function.<div><br></div><div>but I checked the <span class="Apple-style-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">2010/7/30 Arjen de Korte <span dir="ltr">&lt;<a href="mailto:nut%2Bdevel@de-korte.org">nut+devel@de-korte.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Citeren Robert Jobbagy &lt;<a href="mailto:jobbagy.robert@gmail.com" target="_blank">jobbagy.robert@gmail.com</a>&gt;:<br>
<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 class="h5"><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></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br><br>Robert <br>
</div>