public extern AJ_Status MarshalMethodCall(UInt32 bus,
                                           AJ_Message msg,
                                           UInt32 msgId,
                                           string destination,
                                           UInt32 sessionId,
                                           byte flags,
                                           UInt32 timeout);
 public extern AJ_Status MarshalSignal(UInt32 bus,
                                       AJ_Message msg,
                                       UInt32 msgId,
                                       UInt32 destination,
                                       UInt32 sessionId,
                                       byte flags,
                                       UInt32 ttl);
Exemple #3
0
        public AJ_Status AboutAnnounce(UInt32 bus, UInt32 busAboutPort)
        {
            AJ_Status  status       = AJ_Status.AJ_OK;
            AJ_Message announcement = new AJ_Message();

            if (!doAnnounce)
            {
                return(status);
            }
            doAnnounce = false;
            if (busAboutPort == 0)
            {
                return(status);
            }

            status = MarshalSignal(bus, announcement, AJ_SIGNAL_ABOUT_ANNOUNCE, 0, 0, (byte)ALLJOYN_FLAG_SESSIONLESS, 0);
            if (status != AJ_Status.AJ_OK)
            {
                goto ErrorExit;
            }
            status = MarshalArg(announcement, "q", ABOUT_VERSION);
            if (status != AJ_Status.AJ_OK)
            {
                goto ErrorExit;
            }
            status = MarshalArg(announcement, "q", busAboutPort);
            if (status != AJ_Status.AJ_OK)
            {
                goto ErrorExit;
            }
            status = MarshalObjectDescriptions(announcement);
            if (status != AJ_Status.AJ_OK)
            {
                goto ErrorExit;
            }

            if (AboutPropGetterCB != null)
            {
                //status = propStoreGetterCB(announcement, "", this);
                AboutPropGetterCB(announcement, "");
            }
            else
            {
                status = MarshalDefaultProps(announcement);
            }

            if (status != AJ_Status.AJ_OK)
            {
                goto ErrorExit;
            }

            return(DeliverMsg(announcement));

ErrorExit:
            return(status);
        }
Exemple #4
0
 static AJ_Status AboutGetPropCB(AJ_Message reply, AJ_Message msg, uint propId, AJ aj)
 {
     if (propId == AJ_PROPERTY_ABOUT_VERSION)
     {
         return(aj.MarshalArg(reply, "q", ABOUT_VERSION));
     }
     else
     {
         return(AJ_Status.AJ_ERR_UNEXPECTED);
     }
 }
Exemple #5
0
        AJ_Status AboutIconHandleGetURL(AJ_Message msg, AJ_Message reply)
        {
            AJ_Status status;

            status = MarshalReplyMsg(msg, reply);
            if (status != AJ_Status.AJ_OK)
            {
                goto ErrorExit;
            }
            return(MarshalArg(reply, "s", AboutIconURL));

ErrorExit:
            return(status);
        }
Exemple #6
0
        static AJ_Status AboutIconGetPropCB(AJ_Message reply, AJ_Message msg, uint propId, AJ aj)
        {
            AJ_Status status = AJ_Status.AJ_ERR_UNEXPECTED;

            if (propId == AJ_PROPERTY_ABOUT_ICON_VERSION_PROP)
            {
                status = aj.MarshalArg(reply, "q", ABOUT_ICON_VERSION);
            }
            else if (propId == AJ_PROPERTY_ABOUT_ICON_MIMETYPE_PROP)
            {
                status = aj.MarshalArg(reply, "s", aj.AboutIconMime);
            }
            else if (propId == AJ_PROPERTY_ABOUT_ICON_SIZE_PROP)
            {
                status = aj.MarshalArg(reply, "u", aj.AboutIconSize);
            }
            return(status);
        }
        private AJ_Status ProcessProperty(AJ_Message msg, PropertyCB propCB, uint propType)
        {
            AJ_Status status = AJ_Status.AJ_OK;
            UInt32    propId = 0;

            string sig = UnmarshalPropertyArgs(msg, ref propId);

            AJ_Message reply = new AJ_Message();

            MarshalReplyMsg(msg, reply);

            if (propType == AJ.AJ_PROP_GET)
            {
                MarshalVariant(reply, sig);
                if (propCB != null)
                {
                    status = propCB(reply, msg, propId, this);
                }
            }
            else
            {
                string variant = UnmarshalVariant(msg);
                if (0 == String.Compare(variant, sig))
                {
                    if (propCB != null)
                    {
                        status = propCB(reply, msg, propId, this);
                    }
                }
                else
                {
                    status = AJ_Status.AJ_ERR_SIGNATURE;
                }
            }

            if (status != AJ_Status.AJ_OK)
            {
                //AJ_MarshalStatusMsg(msg, &reply, status);
            }

            DeliverMsg(reply);

            return(status);
        }
        public AJ_Status BusHandleBusMessage(AJ_Message msg, UInt32 bus, UInt32 busAboutPort)
        {
            AJ_Status  status = AJ_Status.AJ_OK;
            AJ_Message reply  = new AJ_Message();

            switch (msg.msgId)
            {
            case AJ_METHOD_ABOUT_GET_PROP:
                return(AboutHandleGetProp(msg));

            case AJ_METHOD_ABOUT_GET_ABOUT_DATA:
                status = AboutHandleGetAboutData(msg, reply);
                break;

            case AJ_METHOD_ABOUT_ICON_GET_PROP:
                return(AboutIconHandleGetProp(msg));

            case AJ_METHOD_ABOUT_ICON_GET_CONTENT:
                status = AboutIconHandleGetContent(msg, reply, AboutIconContent);
                break;

            case AJ_METHOD_ABOUT_ICON_GET_URL:
                status = AboutIconHandleGetURL(msg, reply);
                break;

            default:
                return(BusHandleBusMessageInner(msg));
            }

            if ((status == AJ_Status.AJ_OK) /*&& (msg->hdr->msgType == AJ_MSG_METHOD_CALL)*/)
            {
                status = DeliverMsg(reply);
            }
            if (status == AJ_Status.AJ_OK)
            {
                AboutAnnounce(bus, busAboutPort);
            }
            return(status);
        }
Exemple #9
0
        public AJ_Status AboutHandleGetAboutData(AJ_Message msg, AJ_Message reply)
        {
            AJ_Status status   = AJ_Status.AJ_OK;
            string    language = String.Empty;

            language = UnmarshalArgs(msg, "s");
            if (status == AJ_Status.AJ_OK)
            {
                MarshalReplyMsg(msg, reply);
                if (AboutPropGetterCB != null)
                {
                    status = AboutPropGetterCB(reply, language);
                }
                else
                {
                    status = MarshalDefaultProps(reply);
                }
                if (status != AJ_Status.AJ_OK)
                {
                    //status = AJ_MarshalErrorMsg(msg, reply, AJ_ErrLanguageNotSuppored);
                }
            }
            return(status);
        }
 public extern AJ_Status UnmarshalArg(AJ_Message msg, UInt32 argPtr);
 public extern AJ_Status MarshalArgs(AJ_Message msg, string sig, string val1, string val2, string val3);
 public extern AJ_Status BusReplyAcceptSession(AJ_Message msg, UInt32 accept);
 public extern void CloseMsg(AJ_Message msg);
 public extern AJ_Status UnmarshalMsg(UInt32 bus, AJ_Message msg, UInt32 timeout);
 public extern AJ_Status MarshalCloseContainer(AJ_Message msg, UInt32 argPtr);
 public extern AJ_Status MarshalReplyMsg(AJ_Message msg, AJ_Message replyMsg);
Exemple #17
0
 public AJ_Status AboutHandleGetProp(AJ_Message msg)
 {
     return(BusGetProp(msg, AboutGetPropCB));
 }
 public extern string UnmarshalPropertyArgs(AJ_Message msg, ref UInt32 propId);
Exemple #19
0
 public extern AJ_Status MarshalObjectDescriptions(AJ_Message msg);
 public extern AJ_Status UnmarshalArgs(AJ_Message msg, string sig, ref uint arg1, ref uint arg2);
 public extern string UnmarshalArgs(AJ_Message msg, string sig);
 public extern AJ_Status UnmarshalArgs(AJ_Message msg, string sig, UInt16 port, UInt32 sessionId, string joiner);
 public extern AJ_Status MarshalVariant(AJ_Message msg, string sig);
 public extern string UnmarshalVariant(AJ_Message msg);
Exemple #25
0
 public extern AJ_Status MarshalDefaultProps(AJ_Message msg);
 public extern AJ_Status MarshalArgs(AJ_Message msg, string sig, string val1, byte[] val2);
 public extern AJ_Status BusHandleBusMessageInner(AJ_Message msg);
 public extern AJ_Status MarshalContainer(AJ_Message msg, UInt32 argPtr, byte typeId);
 public extern AJ_Status MarshalArg(AJ_Message msg, string sig, string val);
 public extern AJ_Status DeliverMsg(AJ_Message msg);