<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
Attempting to send a signal using the dbus.service.signal decorator
(Python 2.6) I've encountered following problem:<br>
<br>
<font face="Courier New, Courier, monospace">
@dbus.service.signal('myInterface', 'v(sav(iii))' )<br>
def mySignal(self, message):<br>
pass</font><br>
<font face="Courier New, Courier, monospace"> ...<br>
e = Emitter(bus)<br>
e.mySignal( ('myString', [(1, 1, 1)]) )</font><br>
<br>
Raises the "signal signature is longer than the number of arguments
provided" error.<br>
<br>
The signal to be sent on wire is:<br>
<br>
<font face="Courier New, Courier, monospace">variant struct {<br>
string "myString"<br>
array [<br>
variant struct { <br>
int32 1<br>
int32 1<br>
int32 1<br>
}<br>
]<br>
}</font><br>
<br>
I think it is exactly what <font face="Courier New, Courier,
monospace">'v(sav(iii))'<font face="sans-serif"> defines (one
variant).<br>
also </font></font><font face="Courier New, Courier, monospace"><font
face="sans-serif"><font face="Courier New, Courier, monospace">('myString',
[(1, 1, 1)]) </font>defines one struct argument<br>
</font></font><br>
<font face="Courier New, Courier, monospace"><font face="sans-serif">I
don't understand the reason of the error in this solution.<br>
<br>
</font></font><font face="Courier New, Courier, monospace"><font
face="sans-serif">Using another approach:<br>
</font></font><br>
<font face="Courier New, Courier, monospace">
@dbus.service.signal('myInterface', 'v' )<br>
def mySignal(self, message):<br>
pass</font><br>
<font face="Courier New, Courier, monospace"> ...<br>
e = Emitter(bus)<br>
...<br>
arr = dbus.Array( [], </font><font face="Courier New, Courier,
monospace"><font face="Courier New, Courier, monospace">signature=</font>'(iii)'
)<br>
s1 = dbus.Struct( (1,1,1), signature='(iii)', variant_level=1 )<br>
arr.append(s1)<br>
e.mySignal( ('myString', arr) )<br>
<br>
<font face="sans-serif">works as requested.<br>
<br>
Thank you for your help,<br>
<br>
with best regards,<br>
</font></font>
<div class="moz-signature">-- <br>
<p><b>Bogdan Lotko</b></p>
<a class="moz-txt-link-abbreviated"
href="mailto:b.lotko@chello.at">b.lotko@chello.at</a>
<br>
Phone: +43 1 2852458
<br>
Mobile: +43 676 6615012
</div>
</body>
</html>