looking at your code it looks like what you are trying to send is a struct the signature for a struct should be "r"
or the actual signature surrounded by parenthesizes (
and )
. i.e. for Package
the signature would be "(sayiis)"
- With AllJoyn you can send an array but not an
ArrayList
and you must specify the type of data that is in the array. - Since your
DataSendType
specifiedTEXT
orIMAGE
I made the assumption that you want to send an array of bytes. - Most of the items I did not add a signature to because AllJoyn can figure out the signature using reflection. AllJoyn however does not know that enums will be transmitted as integers so I did have to specify the signature for the enums.
- Package did not have to implement BusObject. In your code when you implement your
SimpleInterface
that should extend theSimpleInterface
and `BusObject' Anything sent using AllJoyn should be public so the interface can read the member variables.
public class Package { public static enum DataSendType{ TEXT, IMAGE } public static enum PackageStatus { NONE, SENDING, DONE } @Position(0) public String m_id; @Position(1) public byte[] m_listPackage; @Position(2) @Signature("i") public PackageStatus m_status; @Position(3) @Signature("i") public DataSendType m_type; @Position(4) public String m_packageName; }
for the interface the signature should be "r"
for struct the signature "o"
means object path. This is an AllJoyn object path which means it just a string with path data.
@BusInterface (name="xxxx.simpleinterface")
public interface SimpleInterface {
@BusSignal (name="Chat", signature="r")
public void Chat(Package message) throws BusException;
}
If you really need to use an ArrayList convert the ArrayList to an actual array before sending the Chat
signal.