Skip to content

Protocol

vstarlinger edited this page Aug 29, 2017 · 4 revisions

Protocols are an essential part for the Univeral Space Operation Center. They define the way in which the incoming data is interpreted.

Protocols are declared using .xml files. These files have the benefit of being both human- and machine-readable through the use of tags and attributes. An example of an xml file is shown below.

XML Structure

The protocol files used for the ground station has the following structure and key words:

Tag Attribute Description
sbd340message specifies the base element of the data structure.
protocol specifies the protocol type that is encoded in this xml file. This tells the MessageController how the incoming data should be treated. Currently only the protocol type ‘SEQUENTIAL’ is supported, further updates will be added in future iterations.
header This is a wrapper for all data that is not necessarily shared with the user.
metadata Metadata specifies a particular set of header data.
type This sets the MetadataType, currently the following options are available:
  • MSGNUMBER
  • CARRIER_CURRENT
  • CARRIER_MAX
  • NUM_VALIDEVENTS
  • SYSTEMEVENTS
  • TIME
The TIME metadata should be set because it is used as a reference point for all other sensor data.
name This allows to set a name for the specific meta data.
var All ground station data is stored in variables. The var tag allows to specify a specific variable that can be handled internally. An unlimited amount of var tags can be placed inside a metadata tag.
dataname Name of the variable as String.
start startposition in bit of the variable in the respective data package.
datatype Datatype of the variable. Currently available options are with length in brackets:
  • STRING (0)
  • FLOAT16 (16)
  • FLOAT32 (32)
  • UINT8 (8)
  • UINT16 (16)
  • UINT32 (32)
  • INT8 (8)
  • INT16 (16)
  • BIT (1)
  • BIT3 (3)
  • BIT10 (10)
unit Unit of the variable as String, currently this is only used for visualization.
numpoints Number of variables per data packet as Int. These data points must be next to each other. If this is not set it is automatically set to 1.
frequency If numpoints is greater than 1, frequency must be set. This is used to determine the time values for every data point.
isLittleEndian Boolean value to determine whether the incoming data is in little or big endian format.
data
sensor
type sensor type
name Name of the sensor.
sensorpoints Number of variables packs per data packet as Int. These data points must be next to each other. If this is not set it is automatically set to 1. If sensor points is not 1, all variables are read in their sequential order for the number of times stated.
sensorfrequency If sensorpoints is greater than 1, frequency must be set. This is used to determine the time values for every data point.
var same as var for metadata
All ground station data is stored in variables. The var tag allows to specify a specific variable that can be handled internally.
An unlimited amount of var tags can be placed inside a sensor tag.

XMLReader

The XMLReader class is implemented using the Java stax library. The protocol file is parsed using the XMLStreamReader class. If new tags are added to the protocol file they need to be added to the XMLReader either within the XMLStreamConstants.START_ELEMENT and/or the XMLStreamConstants.END_ELEMENT case.

XMLWriter

The XMLWriter class is implemented using the Java JAXB library. The writeXML method uses the JAXB.marshal(o, f); to write the current internal data structure to a xml file. This can be used in future iterations to automatically write protocol files.

Clone this wiki locally