/* * Wraps all of the data in the class into the buffer. The number of bytes * each item occupies is based on the objects size in the JSIDL schema. */ public void encode(byte[] bytes, int pos) { if (bytes == null) { return; } bytes = JausUtils.addToBuffer(bytes, BitConverter.GetBytes(JausUtils.getPVint(m_PresenceVector)), pos, JausUtils.UINT_BYTES, false); pos += JausUtils.UINT_BYTES; bytes = JausUtils.addToBuffer(bytes, BitConverter.GetBytes(m_DestSubsystemID), pos, JausUtils.USHORT_BYTES, false); pos += JausUtils.USHORT_BYTES; bytes[pos] = m_DestComponentID; pos += JausUtils.BYTE_BYTES; bytes[pos] = m_DestComponentID; pos += JausUtils.BYTE_BYTES; if (isSrcSubsystemIDValid()) { bytes = JausUtils.addToBuffer(bytes, BitConverter.GetBytes(m_SrcSubsystemID), pos, JausUtils.USHORT_BYTES, false); pos += JausUtils.USHORT_BYTES; } bytes[pos] = m_SrcComponentID; pos += JausUtils.BYTE_BYTES; if (isSrcNodeIDValid()) { bytes[pos] = m_SrcNodeID; pos += JausUtils.BYTE_BYTES; } m_MessagePayload.encode(bytes, pos); pos += m_MessagePayload.getSize(); }
/* * get presence vector from the given integer representatio */ public uint getPresenceVector() { return(JausUtils.getPVint(m_PresenceVector)); }