I would like to store a dbus output into an array.
dbus-send --system --print-reply --dest="com.ac.comp" /com/ac/comp/IO com.ac.comp.Time.Get
When I execute the above command, I obtain the following output :
method return sender=:1.191 -> dest=:1.198 reply_serial=2
uint16 1
uint16 0
uint16 0
uint32 0
I have implemented my bash as follow :
if [ -f $file ]
then
IFS=".="
while read enum name ID x
do
if [ "$enum" == "IO" ] && [ "$name" == $IOname ]
then
array=($(dbus-send --system --print-reply --dest="com.ac.comp" /com/ac/comp/IO com.ac.comp.IO.Get uint16:16))
fi
done < $1
else
exit_error
fi
I can not explain why the following echo commands :
echo ${array[1]}
echo
echo ${array[2]}
echo
echo ${array[3]}
echo
echo ${array[4]}
echo
echo ${array[5]}
echo
echo ${array[6]}
echo
echo ${array[7]}
echo
echo ${array[8]}
echo
echo ${array[9]}
echo
echo ${array[10]}
echo
echo ${array[11]}
echo
echo ${array[12]}
echo
echo ${array[13]}
gives
:1
105 -> dest
:1
112 reply_serial
2
uint16 1
uint16 0
uint16 0
uint32 0
I would like to reuse the uint16 and uint32 values. But I though retrieve them in ${array[7]} ${array[9]} ${array[11]} and ${array[13]}
dbus-sendoutput intohexdumporxxd?dbus-send ... | xxdIFSis set to..