All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.esi.metis.aisparser.impl.AISMessageAcknowledgeUnitImpl Maven / Gradle / Ivy

Go to download

This package supports the parsing of AIS messages in Java. AIS, the Automatic Identification System, is a system aiming at improving maritime safety by exchanging messages between ships, other vehicles in particular aircraft involved in search-and-rescue (SAR), and (fixed) base stations. To be precise, this package support the ITU-R M.1371-4 AIS standard. See our extensive javadoc and in particular the class AISParser for more information on how to use this package. The parser was used in the Poseidon project, and is improved in the Metis project to better handle uncertain information. Both projects were led by the Embedded Systems Institute. In both projects Thales Nederlands was the carrying industrial partner, and multiple Dutch universities participated.

The newest version!
/* ESI AIS Parser
 * 
 * Copyright 2011/2012 by Pierre van de Laar & Pierre America (Embedded Systems Institute)
 * Copyright 2008 by Brian C. Lane 
 * All Rights Reserved
 * 
 */
package nl.esi.metis.aisparser.impl;

import nl.esi.metis.aisparser.AISMessageAcknowledgeUnit;
import nl.esi.metis.aisparser.Sixbit;

/** Implementation of units of acknowledgements.
 * 
 * Field Nr     Field Name                          NrOf Bits   (from, to )
 * ------------------------------------------------------------------------
 *  1	destinationID                          	  30	(  0,   29)
 *  2	Sequence Number                            2	(  30,  31)
 *  
* @author Pierre America * @author Pierre van de Laar */ class AISMessageAcknowledgeUnitImpl implements AISMessageAcknowledgeUnit { private static final int DESTINATIONID_FROM = 0; private static final int DESTINATIONID_TO = 29; private int destinationID; /** destinationID * @return int value of destinationID1 (30 bits offset+[0,29]) */ public int getDestinationID() { return destinationID; } private static final int SEQUENCENUMBERFORID_FROM = 30; private static final int SEQUENCENUMBERFORID_TO = 31; private int sequenceNumberForID; /** sequenceNumberForID * @return int value of sequenceNumberForID (2 bits offset + [30,31]) */ public int getSequenceNumberForID() { return sequenceNumberForID; } public AISMessageAcknowledgeUnitImpl (int offset, Sixbit content) { assert(content.length() >= offset + SEQUENCENUMBERFORID_TO); destinationID = content.getIntFromTo(offset+DESTINATIONID_FROM,offset+DESTINATIONID_TO); sequenceNumberForID = content.getIntFromTo(offset+SEQUENCENUMBERFORID_FROM, offset+SEQUENCENUMBERFORID_TO); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy