Hi,<br><br><div class="gmail_quote">On Fri, Jul 24, 2009 at 7:36 AM, Alex Bunnett <span dir="ltr">&lt;<a href="mailto:alexb@fusionelectronics.com">alexb@fusionelectronics.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">










<div link="blue" vlink="purple" lang="EN-GB">

<div>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Got the dbus messages up and running but I keep getting a
assertion error from time to time.</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Im unsure how the message can become locked as im not
setting it locked before sending.</span></font></p></div></div></blockquote><div>--  The message is a bit strange, I have not came across it, are you using dbus in multi threaded environment? and what is you pass serial as NULL if you are not interested in serial number?<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-GB"><div><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"></span></font></p>


<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">This is the code</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">   DBusMessage*                       message = NULL;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">    dbus_uint32_t                        serial ; // TODO
What is this?</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> -- Message serial number, could be NULL is you are not interested in. The same serial number you can check in dbus-monitor.<br></span></font></p>


<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            message =
dbus_message_new_signal(SERVER_SEND_OBJECT , // object name of the signal</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">                                                                                                             
SEND_INTERFACE_SERVER , // interface name of the signal</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">                                                                                                             
&quot;MessageServer&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            DBusMessageIter iter, sub;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            dbus_message_iter_init_append(message,
&amp;iter);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            char buf[2];</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            buf[0] = DBUS_TYPE_BYTE;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            buf[1] = &#39;\0&#39;;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            dbus_message_iter_open_container(&amp;iter,
DBUS_TYPE_ARRAY, buf, &amp;sub);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> -- Why not just dbus_message_iter_open_container (&amp;iter, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING, &amp;sub); ?<br></span></font></p>


<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            if(!dbus_message_iter_append_fixed_array(&amp;sub,
DBUS_TYPE_BYTE, &amp;pBuff, len))</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            {</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">                        __ALEX(&quot;couldnt append
message&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">                        dbus_message_unref(message);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">                return 0;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            }</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            dbus_message_iter_close_container(&amp;iter,
&amp;sub);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            if(!dbus_connection_send(_connection, message,
&amp;serial))</span></font></p></div></div></blockquote><div>-- Could you try with serial as NULL (_connection, message, NULL) <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-GB"><div><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"></span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">   {</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            __ALEX(&quot;Couldn&#39;t Send message&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            dbus_message_unref(message);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">            return 0;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">   }</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">   dbus_connection_flush(_connection); // force message to
be sent now</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">   dbus_message_unref(message);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">   return len;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">process 790: arguments to dbus_message_set_serial() were
incorrect, assertion &quot;!message-&gt;locked&quot; failed in file
dbus-message.c line 178.</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">This is normally a bug in some application using the D-Bus
library.</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">  D-Bus not compiled with backtrace support so unable to
print a backtrace</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Thanks </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p></div></div></blockquote><div>-Br<br>Naveen<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-GB"><div><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"></span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-US"> </span></font></p>

<table style="width: 951.9pt;" summary="" border="0" cellpadding="0" width="1269">
 <tbody><tr>
  <td colspan="2" style="padding: 0cm 5.4pt; width: 926.95pt;" width="1236">
  <p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><a href="http://www.fusioncaraudio.com/" target="_blank"><font color="black"><span style="color: windowtext; text-decoration: none;"><img src="cid:image001.jpg@01CA0C7C.D9E10040" border="0" height="71" width="222"></span></font></a></span></font></p>

  </td>
  <td style="border: medium none ; padding: 0cm;" width="27"><p> </p></td>
 </tr>
 <tr>
  <td style="padding: 0.75pt; width: 9.55pt;" width="13">
  <p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
  </td>
  <td colspan="2" style="padding: 0.75pt; width: 937.85pt;" width="1250">
  <div>
  <div>
  <p><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">Alex Bunnett</span></font></b></p>
  </div>
  <div>
  <p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">Embedded Software Engineer</span></font></p>
  </div>
  <div>
  <p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">Ph: +64-9-369-2900<br>
  DDI: +64-9-369-2940</span></font></p>
  </div>
  <div>
  <p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">Fax: +64-9-369-2907<br>
  Email: <font color="blue"><span style="color: blue;"><a href="mailto:alexb@fusionelectronics.co.nz" target="_blank">alexb@fusionelectronics.co.nz</a></span></font></span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"><br>

  </span></font><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">Website: <u><font color="blue"><span style="color: blue;"><a href="http://www.fusionelectronics.com" target="_blank">http://www.fusionelectronics.com</a></span></font></u></span></font><font color="black" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: black;"><br>

  <br>
  </span></font><font color="black" face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; color: black;">The information in this email and any
  attachments is confidential. This information may be subject to legal,
  professional, or other privilege. It must not be disclosed to any person
  without our authority. If you are not the intended recipient you are not
  authorised to and must not disclose, copy, distribute, or retain this message
  or any part of it. Please return this message to the sender immediately and
  delete any and all copies from your system.</span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"></span></font></p>
  </div>
  </div>
  </td>
 </tr>
 <tr height="0">
  <td style="border: medium none ;" width="16"></td>
  <td style="border: medium none ;" width="1223"></td>
  <td style="border: medium none ;" width="30"></td>
 </tr>
</tbody></table>

<div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;" lang="EN-US"> </span></font><span lang="EN-US"></span></p>

</div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

</div>

</div>


<br>_______________________________________________<br>
dbus mailing list<br>
<a href="mailto:dbus@lists.freedesktop.org">dbus@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dbus" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dbus</a><br>
<br></blockquote></div><br>