public virtual void EnqueueAction(Send msg)
 {
     sendJausMessage(
     (uint)msg.getBody().getSendRec().getMessagePayload().getLength(),
     msg.getBody().getSendRec().getMessagePayload().getData(),
     new JausAddress((ushort)msg.getBody().getSendRec().getDestinationID().getSubsystemID(),
     (byte)msg.getBody().getSendRec().getDestinationID().getNodeID(),
     (byte)msg.getBody().getSendRec().getDestinationID().getComponentID()));
 }
Example #2
0
 public Send(Send r)
     : base(r)
 {
 }
Example #3
0
 /// <summary>
 /// Wraps the message buffer into a Send wrapper and sends it through
 /// the JausRouter.
 /// </summary>
 /// <param name="bufsize">the size of the given buffer in bytes</param>
 /// <param name="buffer">the bytes from the message to be sent</param>
 /// <param name="dest">the destination of the message</param>
 protected void sendJausMessage(uint bufsize, byte[] buffer, JausAddress dest)
 {
     Send response = new Send();
     response.getBody().getSendRec().getMessagePayload().set((int)bufsize, buffer);
     response.getBody().getSendRec().getDestinationID().setSubsystemID(dest.getSubsystemID());
     response.getBody().getSendRec().getDestinationID().setNodeID(dest.getNodeID());
     response.getBody().getSendRec().getDestinationID().setComponentID(dest.getComponentID());
     //Console.WriteLine("Sending response msg " + BitConverter.ToInt16(b, 0));
     jausRouter.sendMessage(ref response);
 }
Example #4
0
 public Send(Send r) : base(r)
 {
 }
                protected internal override void SendTransition(Transport_SendFSMContext context, Send msg)
                {
                    Transport_SendFSM ctxt = context.Owner;

                    #if TRACE
                    Trace.WriteLine(
                        "TRANSITION   : Transport_SendFSM_SM.Sending.SendTransition(, Send msg)");
                    #endif

                    Transport_SendFSMState endState = context.State;

                    context.ClearState();

                    try
                    {
                        ctxt.EnqueueAction(msg);
                    }
                    finally
                    {
                        context.State = endState;
                    }

                    return;
                }
 protected internal virtual void SendTransition(Transport_SendFSMContext context, Send msg)
 {
     Default(context);
 }
 public void SendTransition(Send msg)
 {
     transition_ = "SendTransition";
     State.SendTransition(this, msg);
     transition_ = "";
     return;
 }
Example #8
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());
            }
        }