LibMISB - LibMISB Introduction - Functionalities supported

From RidgeRun Developer Wiki




Previous: LibMISB_Introduction/What_does_the_library_do Index Next: Getting_Started





LibMISB/Getting_Started

General

The functionalities of the library, regardless of the standard used, are as follows

Set Debugger Level

Sets the level at which messages will be recorded. The modes, ordered from least to most verbose, are as follows:

  1. MISB_NONE
  2. MISB_ERROR
  3. MISB_WARN
  4. MISB_INFO
  5. MISB_DEBUG

Set Formatter

Sets the Formatter object to convert between format and metadata object. In other words, the user chooses which file format to use for both encoding and decoding actions.

  • Composition input format: To encode the input file, it must follow the following structure (an example will be shown using the JSON format).
{ 
  "key": "<MISB KEY>",
  "items": [
    {
      "tag": "<TAG NUMBER>",
      "value": "<TAG VALUE>"
    }
  ]
}

Note: some tags are mandatories depending on the standard.

The method header is:

/**
   * @brief Set the Formatter object to convert between format to metadata
   * object and viceversa
   *
   * @param formatter Enum formatter that manages the format type that codec
   * will use
   */
  void SetFormatter(int formatter_number);

In which the formatter_number is dependent on formatter supported.

Example:

misb.SetFormatter(misb::formatter::JSON_FORMAT);

The misb::formatter::JSON_FORMAT parameter corresponds to an enum indicating which format type is to be implemented. At the moment, the enum is as follows:

enum Formats { JSON_FORMAT };



Encode

Performs the encoding of the metadata that was parsed by the Formatter. Encoding will depend on the MISB standard key found in the input file.

Decode

Performs decoding of the metadata found in a KLV byte packet. The decoding will depend on the MISB standard key found in the packet. Once decoded, it will return the data according to the configured format type.



Previous: LibMISB_Introduction/What_does_the_library_do Index Next: Getting_Started