Exemple #1
0
        /// <summary>
        /// Determines if the outgoing message is local, or needs to be routed through
        /// the node manager.
        /// </summary>
        /// <param name="msg">the outgoing message wrapped in a Send wrapper.</param>
        public void sendMessage(ref Send msg)
        {
            // Pull the destination ID
            JausAddress destination = new JausAddress((ushort)msg.getBody().getSendRec().getDestinationID().getSubsystemID(),
                                                      (byte)msg.getBody().getSendRec().getDestinationID().getNodeID(),
                                                      (byte)msg.getBody().getSendRec().getDestinationID().getComponentID());

            // If the destination is local, loopback to the route message function
            if (destination.get() == jausAddress.get())
            {
                Receive message = new Receive();
                message.getBody().getReceiveRec().getSourceID().setSubsystemID(jausAddress.getSubsystemID());
                message.getBody().getReceiveRec().getSourceID().setNodeID(jausAddress.getNodeID());
                message.getBody().getReceiveRec().getSourceID().setComponentID(jausAddress.getComponentID());
                message.getBody().getReceiveRec().getMessagePayload().set(msg.getBody().getSendRec().getMessagePayload().getLength(),
                                                                          msg.getBody().getSendRec().getMessagePayload().getData());

                routeMessage(message);
            }
            // Otherwise, forward the message to NodeManager
            else
            {
                JrErrorCode ret = JuniorAPI.JrSend((int)jrHandle, destination.get(),
                                                   (uint)msg.getBody().getSendRec().getMessagePayload().getLength(),
                                                   msg.getBody().getSendRec().getMessagePayload().getData());
            }
        }
Exemple #2
0
        public static JrErrorCode JrSend(int handle, uint dest, uint size, byte[] BYTE)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrSend__SWIG_3(handle, dest, size, BYTE);

            return(ret);
        }
Exemple #3
0
        public static JrErrorCode JrSend(int handle, uint dest, uint size, byte[] BYTE, int priority, int flags)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrSend__SWIG_1(handle, dest, size, BYTE, priority, flags);

            return(ret);
        }
Exemple #4
0
        public static JrErrorCode JrConnect(int id, string cfg, ref int INOUT)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrConnect__SWIG_0(id, cfg, ref INOUT);

            return(ret);
        }
Exemple #5
0
        public static JrErrorCode JrDisconnect(int handle)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrDisconnect(handle);

            return(ret);
        }
Exemple #6
0
        public static JrErrorCode JrCheckAllHandles(SWIGTYPE_p_long list, SWIGTYPE_p_int size_of_list)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrCheckAllHandles(SWIGTYPE_p_long.getCPtr(list), SWIGTYPE_p_int.getCPtr(size_of_list));

            return(ret);
        }
Exemple #7
0
        public static JrErrorCode JrBroadcast(int handle, uint size, string buffer, int priority, ushort msg_id)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrBroadcast(handle, size, buffer, priority, msg_id);

            return(ret);
        }