Esempio n. 1
0
                    /*
                     * Pulls the correct bits out of m_SubFields, then converts
                     *  them into a long.
                     * @return the value of the destination component ID.
                     */
                    public uint getComponentID()
                    {
                        BitArray bfbs = JausUtils.setPV(m_SubFields);
                        BitArray sfbs = new BitArray(8);
                        int      i    = 0;

                        for (int index = 0; index <= 7; index++)
                        {
                            sfbs.Set(i++, bfbs.Get(index));
                        }

                        return(JausUtils.getPVint(sfbs));
                    }
Esempio n. 2
0
                    /*
                     * Pulls the correct bits out of m_SubFields, then converts
                     *  them into a long.
                     * @return the value of the subsystem node ID.
                     */
                    public long getSubsystemID()
                    {
                        BitArray bfbs = JausUtils.setPV(m_SubFields);
                        BitArray sfbs = new BitArray(8);
                        int      i    = 0;

                        for (int index = 16; index <= 31; index++)
                        {
                            sfbs.Set(i++, bfbs.Get(index));
                        }

                        return(JausUtils.getPVint(sfbs));
                    }
Esempio n. 3
0
                    /*
                     * Converts the value of the component ID into a BitSet, then
                     *  adds it to m_SubFields.
                     * @param the value of the destination component ID.
                     */
                    public void setComponentID(uint value)
                    {
                        if ((value >= 1) && (value <= 225))
                        {
                            BitArray bfbs = JausUtils.setPV(m_SubFields);
                            BitArray sfbs = JausUtils.setPV(value);
                            int      i    = 0;

                            for (int index = 0; index <= 7; index++)
                            {
                                bfbs.Set(index, sfbs.Get(i++));
                            }

                            m_SubFields = JausUtils.getPVint(bfbs);
                        }
                    }
Esempio n. 4
0
                    /*
                     * Converts the value of the subsystem ID into a BitSet, then
                     *  adds it to m_SubFields.
                     * @param the value of the destination subsystem ID.
                     */
                    public void setSubsystemID(uint value)
                    {
                        if ((value >= 1) && (value <= 65535))
                        {
                            BitArray bfbs = JausUtils.setPV(m_SubFields);
                            BitArray sfbs = JausUtils.setPV(value);
                            int      i    = 0;

                            for (int index = 16; index <= 31; index++)
                            {
                                bfbs.Set(index, sfbs.Get(i++));
                            }

                            m_SubFields = JausUtils.getPVint(bfbs);
                        }
                    }
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
 /*
  * @param index the index of the presence vector to check.
  * @return the bool value of the presence vector at the index.
  *
  */
 public bool checkPresenceVector(int index)
 {
     return(JausUtils.setPV((uint)m_PresenceVector).Get(index));
 }