/** * Unpacks a Pdu from the underlying data. * * @throws java.nio.BufferUnderflowException if buff is too small * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin reading * @since ?? */ public void unmarshal(java.nio.ByteBuffer buff) { super.unmarshal(buff); minefieldID.unmarshal(buff); requestingEntityID.unmarshal(buff); minefieldSequenceNumbeer = (int) (buff.getShort() & 0xFFFF); requestID = (short) (buff.get() & 0xFF); pduSequenceNumber = (short) (buff.get() & 0xFF); numberOfPdus = (short) (buff.get() & 0xFF); numberOfMinesInThisPdu = (short) (buff.get() & 0xFF); numberOfSensorTypes = (short) (buff.get() & 0xFF); pad2 = (short) (buff.get() & 0xFF); dataFilter = buff.getInt(); mineType.unmarshal(buff); for (int idx = 0; idx < numberOfSensorTypes; idx++) { TwoByteChunk anX = new TwoByteChunk(); anX.unmarshal(buff); sensorTypes.add(anX); } pad3 = (short) (buff.get() & 0xFF); for (int idx = 0; idx < numberOfMinesInThisPdu; idx++) { Vector3Float anX = new Vector3Float(); anX.unmarshal(buff); mineLocation.add(anX); } } // end of unmarshal method
/** * Packs a Pdu into the ByteBuffer. * * @throws java.nio.BufferOverflowException if buff is too small * @throws java.nio.ReadOnlyBufferException if buff is read only * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin writing * @since ?? */ public void marshal(java.nio.ByteBuffer buff) { super.marshal(buff); minefieldID.marshal(buff); requestingEntityID.marshal(buff); buff.putShort((short) minefieldSequenceNumbeer); buff.put((byte) requestID); buff.put((byte) pduSequenceNumber); buff.put((byte) numberOfPdus); buff.put((byte) mineLocation.size()); buff.put((byte) sensorTypes.size()); buff.put((byte) pad2); buff.putInt((int) dataFilter); mineType.marshal(buff); for (int idx = 0; idx < sensorTypes.size(); idx++) { TwoByteChunk aTwoByteChunk = (TwoByteChunk) sensorTypes.get(idx); aTwoByteChunk.marshal(buff); } // end of list marshalling buff.put((byte) pad3); for (int idx = 0; idx < mineLocation.size(); idx++) { Vector3Float aVector3Float = (Vector3Float) mineLocation.get(idx); aVector3Float.marshal(buff); } // end of list marshalling } // end of marshal method
/** * Unpacks a Pdu from the underlying data. * * @throws java.nio.BufferUnderflowException if buff is too small * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin reading * @since ?? */ public void unmarshal(java.nio.ByteBuffer buff) { recordType = (short) (buff.get() & 0xFF); changeIndicator = (short) (buff.get() & 0xFF); associationStatus = (short) (buff.get() & 0xFF); associationType = (short) (buff.get() & 0xFF); entityID.unmarshal(buff); ownStationLocation = (int) (buff.getShort() & 0xFFFF); physicalConnectionType = (short) (buff.get() & 0xFF); groupMemberType = (short) (buff.get() & 0xFF); groupNumber = (int) (buff.getShort() & 0xFFFF); } // end of unmarshal method
/** * Packs a Pdu into the ByteBuffer. * * @throws java.nio.BufferOverflowException if buff is too small * @throws java.nio.ReadOnlyBufferException if buff is read only * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin writing * @since ?? */ public void marshal(java.nio.ByteBuffer buff) { buff.put((byte) recordType); buff.put((byte) changeIndicator); buff.put((byte) associationStatus); buff.put((byte) associationType); entityID.marshal(buff); buff.putShort((short) ownStationLocation); buff.put((byte) physicalConnectionType); buff.put((byte) groupMemberType); buff.putShort((short) groupNumber); } // end of marshal method
/** * Packs a Pdu into the ByteBuffer. * * @throws java.nio.BufferOverflowException if buff is too small * @throws java.nio.ReadOnlyBufferException if buff is read only * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin writing * @since ?? */ public void marshal(java.nio.ByteBuffer buff) { super.marshal(buff); minefieldID.marshal(buff); requestingEntityID.marshal(buff); buff.put((byte) requestID); buff.put((byte) requestedPerimeterPoints.size()); buff.put((byte) pad2); buff.put((byte) sensorTypes.size()); buff.putInt((int) dataFilter); requestedMineType.marshal(buff); for (int idx = 0; idx < requestedPerimeterPoints.size(); idx++) { Point aPoint = (Point) requestedPerimeterPoints.get(idx); aPoint.marshal(buff); } // end of list marshalling for (int idx = 0; idx < sensorTypes.size(); idx++) { TwoByteChunk aTwoByteChunk = (TwoByteChunk) sensorTypes.get(idx); aTwoByteChunk.marshal(buff); } // end of list marshalling } // end of marshal method
/** * Unpacks a Pdu from the underlying data. * * @throws java.nio.BufferUnderflowException if buff is too small * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin reading * @since ?? */ public void unmarshal(java.nio.ByteBuffer buff) { super.unmarshal(buff); minefieldID.unmarshal(buff); requestingEntityID.unmarshal(buff); requestID = (short) (buff.get() & 0xFF); numberOfPerimeterPoints = (short) (buff.get() & 0xFF); pad2 = (short) (buff.get() & 0xFF); numberOfSensorTypes = (short) (buff.get() & 0xFF); dataFilter = buff.getInt(); requestedMineType.unmarshal(buff); for (int idx = 0; idx < numberOfPerimeterPoints; idx++) { Point anX = new Point(); anX.unmarshal(buff); requestedPerimeterPoints.add(anX); } for (int idx = 0; idx < numberOfSensorTypes; idx++) { TwoByteChunk anX = new TwoByteChunk(); anX.unmarshal(buff); sensorTypes.add(anX); } } // end of unmarshal method
/** * Packs a Pdu into the ByteBuffer. * * @throws java.nio.BufferOverflowException if buff is too small * @throws java.nio.ReadOnlyBufferException if buff is read only * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin writing * @since ?? */ public void marshal(java.nio.ByteBuffer buff) { super.marshal(buff); entityId.marshal(buff); buff.putShort((short) communicationsDeviceID); buff.putShort((short) encodingScheme); buff.putShort((short) tdlType); buff.putInt((int) sampleRate); buff.putShort((short) data.size()); buff.putShort((short) samples); for (int idx = 0; idx < data.size(); idx++) { OneByteChunk aOneByteChunk = (OneByteChunk) data.get(idx); aOneByteChunk.marshal(buff); } // end of list marshalling } // end of marshal method
/** * Unpacks a Pdu from the underlying data. * * @throws java.nio.BufferUnderflowException if buff is too small * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin reading * @since ?? */ public void unmarshal(java.nio.ByteBuffer buff) { super.unmarshal(buff); entityId.unmarshal(buff); communicationsDeviceID = (int) (buff.getShort() & 0xFFFF); encodingScheme = (int) (buff.getShort() & 0xFFFF); tdlType = (int) (buff.getShort() & 0xFFFF); sampleRate = buff.getInt(); dataLength = (int) (buff.getShort() & 0xFFFF); samples = (int) (buff.getShort() & 0xFFFF); for (int idx = 0; idx < dataLength; idx++) { OneByteChunk anX = new OneByteChunk(); anX.unmarshal(buff); data.add(anX); } } // end of unmarshal method
/** * Packs a Pdu into the ByteBuffer. * * @throws java.nio.BufferOverflowException if buff is too small * @throws java.nio.ReadOnlyBufferException if buff is read only * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin writing * @since ?? */ public void marshal(java.nio.ByteBuffer buff) { buff.putFloat((float) x); buff.putFloat((float) y); buff.putFloat((float) z); } // end of marshal method
/** * Unpacks a Pdu from the underlying data. * * @throws java.nio.BufferUnderflowException if buff is too small * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin reading * @since ?? */ public void unmarshal(java.nio.ByteBuffer buff) { x = buff.getFloat(); y = buff.getFloat(); z = buff.getFloat(); } // end of unmarshal method
/** * Unpacks a Pdu from the underlying data. * * @throws java.nio.BufferUnderflowException if buff is too small * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin reading * @since ?? */ public void unmarshal(java.nio.ByteBuffer buff) { for (int idx = 0; idx < otherParameters.length; idx++) { otherParameters[idx] = buff.get(); } // end of array unmarshaling } // end of unmarshal method
/** * Packs a Pdu into the ByteBuffer. * * @throws java.nio.BufferOverflowException if buff is too small * @throws java.nio.ReadOnlyBufferException if buff is read only * @see java.nio.ByteBuffer * @param buff The ByteBuffer at the position to begin writing * @since ?? */ public void marshal(java.nio.ByteBuffer buff) { for (int idx = 0; idx < otherParameters.length; idx++) { buff.put((byte) otherParameters[idx]); } // end of array marshaling } // end of marshal method