<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444">Hello Lennat , thanks for your email.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444">I did try readin the message type with <span style="font-family:Arial,Helvetica,sans-serif;color:rgb(34,34,34)">sd_bus_message_peek_type and it retired </span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(34,34,34)">read message type =a hence it confirms that there an array of bytes sitting there to be read</span></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444"><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(34,34,34)"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444">below is the snippet </div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444">  char *borrowed=NULL;<br>   size_t datasize=0;<br>   dbrc=sd_bus_message_read_array(m,SD_BUS_TYPE_BYTE,(const void **)&borrowed,&datasize);<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#444444">in your earlier reply i did not get you message " <span style="font-family:Arial,Helvetica,sans-serif;color:rgb(34,34,34)">Note that sd_bus_message_read_array() should be called *without*</span></div>entering the array container first.<span class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(68,68,68)">"</span><div><font color="#444444" face="verdana, sans-serif">a<span class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(68,68,68)">ppreciate if you could eloborate on this</span></font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 5, 2021 at 7:58 AM Lennart Poettering <<a href="mailto:mzqohf@0pointer.de" target="_blank">mzqohf@0pointer.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Do, 04.11.21 22:04, Naseer Kalyandrug (<a href="mailto:naseer.in@gmail.com" target="_blank">naseer.in@gmail.com</a>) wrote:<br>
<br>
> Hello<br>
><br>
> I am trying to read array of bytes in using the sd_bus_message_read_array<br>
> by type 'y' , the sender also has the same format which send the array of<br>
> bytes as 'y'<br>
><br>
> However i see the read_array is failing with erro no -74<br>
><br>
> Can you please some help me in understanding the error and further triage .<br>
<br>
EBADMSG usually means that your message doesn't actually contain at<br>
the current read index what you try to read. You can use<br>
sd_bus_message_peek_type() to query what type should be read next.<br>
<br>
Note that sd_bus_message_read_array() should be called *without*<br>
entering the array container first.<br>
<br>
Lennart<br>
<br>
--<br>
Lennart Poettering, Berlin<br>
</blockquote></div>