Esempio n. 1
0
                    /*
                     * @param bytes the container of bytes to be decoded.
                     * @param pos the position in the buffer to begin decoding.
                     *
                     * Pulls the DestinationID from the byte buffer.The number of bytes
                     *  each item occupies is based on the objects size in the JSIDL schema.
                     */
                    public void decode(byte[] bytes, int pos)
                    {
                        if (bytes == null)
                        {
                            return;
                        }


                        m_SubFields = BitConverter.ToUInt32(JausUtils.getFromBuffer(bytes, pos, INT_BYTES, false), 0);
                        pos        += INT_BYTES;
                    }
Esempio n. 2
0
                    /*
                     * Removes the MessagePayload data from the given buffer.
                     *
                     */
                    public void decode(byte[] bytes, int pos)
                    {
                        if (bytes == null)
                        {
                            return;
                        }
                        m_Length = BitConverter.ToUInt32(JausUtils.getFromBuffer(bytes, pos, JausUtils.UINT_BYTES, false), 0);
                        pos     += JausUtils.UINT_BYTES;

                        m_Data = JausUtils.getFromBuffer(bytes, pos, (int)m_Length, true);
                        pos   += JausUtils.UINT_BYTES;
                    }
Esempio n. 3
0
                /*
                 *  Removes the necessary data from the buffer begining at the given position.
                 */
                public void decode(byte[] bytes, int pos)
                {
                    if (bytes == null)
                    {
                        return;
                    }
                    m_SrcSubsystemID = BitConverter.ToUInt16(JausUtils.getFromBuffer(bytes, pos, JausUtils.USHORT_BYTES, false), 0);
                    pos += JausUtils.USHORT_BYTES;

                    m_SrcNodeID = bytes[pos];
                    pos        += JausUtils.BYTE_BYTES;

                    m_SrcComponentID = bytes[pos];
                    pos += JausUtils.BYTE_BYTES;
                }
Esempio n. 4
0
                    /*
                     * @param bytes buffer
                     * @param pos the current position in the buffer
                     *
                     * Removes the MessagePayload data from the buffer starting at the given position.
                     */
                    public void decode(byte[] bytes, int pos)
                    {
                        if (bytes == null)
                        {
                            return;
                        }

                        try
                        {
                            m_Length = BitConverter.ToInt32(JausUtils.getFromBuffer(bytes, pos, INT_BYTES, false), 0);
                            pos     += JausUtils.getNumBytes("int");

                            m_Data = JausUtils.getFromBuffer(bytes, pos, m_Length, true);
                            pos   += m_Length;
                        }
                        catch (Exception e)
                        {
                        }
                    }
Esempio n. 5
0
                /*
                 * Retrieves all of the data in the class from the buffer. The number of bytes
                 *  each item occupies is based on the objects size in the JSIDL schema.
                 */
                public void decode(byte[] bytes, int pos)
                {
                    if (bytes == null)
                    {
                        return;
                    }

                    m_PresenceVector = JausUtils.setPV(BitConverter.ToUInt32(JausUtils.getFromBuffer(bytes, pos, JausUtils.ULONG_BYTES, false), 0));
                    pos += JausUtils.UINT_BYTES;

                    m_DestSubsystemID = BitConverter.ToUInt16(JausUtils.getFromBuffer(bytes, pos, JausUtils.USHORT_BYTES, false), 0);
                    pos += JausUtils.USHORT_BYTES;

                    m_DestNodeID = bytes[pos];
                    pos         += JausUtils.BYTE_BYTES;

                    m_DestComponentID = bytes[pos];
                    pos += JausUtils.BYTE_BYTES;

                    if (isSrcSubsystemIDValid())
                    {
                        m_SrcSubsystemID = BitConverter.ToUInt16(JausUtils.getFromBuffer(bytes, pos, JausUtils.USHORT_BYTES, false), 0);
                        pos += JausUtils.USHORT_BYTES;
                    }
                    if (isSrcNodeIDValid())
                    {
                        m_SrcNodeID = bytes[pos];
                        pos        += JausUtils.BYTE_BYTES;
                    }
                    if (isPriorityValid())
                    {
                        m_Priority = bytes[pos];
                        pos       += JausUtils.BYTE_BYTES;
                    }

                    m_MessagePayload.decode(bytes, pos);
                    pos += m_MessagePayload.getSize();
                }
Esempio n. 6
0
                public void decode(byte[] bytes, int pos)
                {
                    if (bytes == null)
                    {
                        return;
                    }

                    // m_PresenceVector
                    m_PresenceVector = BitConverter.ToInt16(JausUtils.getFromBuffer(bytes, pos, SHORT_BYTES, false), 0);
                    pos += SHORT_BYTES;

                    //m_ReliableDelivery
                    m_ReliableDelivery = BitConverter.ToInt16(JausUtils.getFromBuffer(bytes, pos, SHORT_BYTES, false), 0);
                    pos += SHORT_BYTES;

                    //m_DestinationID
                    m_DestinationID.decode(bytes, pos);
                    pos += m_DestinationID.getSize();

                    //m_SourceID
                    if (checkPresenceVector(0))
                    {
                        m_SourceID.decode(bytes, pos);
                        pos += m_SourceID.getSize();
                    }

                    //m_Priority
                    if (checkPresenceVector(1))
                    {
                        m_ReliableDelivery = BitConverter.ToInt16(JausUtils.getFromBuffer(bytes, pos, SHORT_BYTES, false), 0);
                        pos += SHORT_BYTES;
                    }

                    m_MessagePayload.decode(bytes, pos);
                    pos += m_MessagePayload.getSize();
                }