Jump to content

LibMISB/LibMISB Introduction/ Functionalities supported: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 9: Line 9:
Sets the level at which messages will be logged.
Sets the level at which messages will be logged.
The method header is:  
The method header is:  
<syntaxhighlight lang=C>
<syntaxhighlight lang="C">
/**
/**
   * @brief Sets the level for which the messages will be logged
   * @brief Sets the level for which the messages will be logged
Line 25: Line 25:


'''Use case''':
'''Use case''':
<syntaxhighlight lang=C>
<syntaxhighlight lang="C">
   libmisb::LibMisb libmisb;
   libmisb::LibMisb libmisb;
   libmisb.SetLogLevel(LIBMISB_DEBUG);
   libmisb.SetLogLevel(LIBMISB_DEBUG);
Line 45: Line 45:


* Composition input format: To encode the input file, it must follow the following structure (a use case will be shown using the JSON format).
* Composition input format: To encode the input file, it must follow the following structure (a use case will be shown using the JSON format).
<syntaxhighlight lang=json>
<syntaxhighlight lang="json">
{  
{  
   "key": "<MISB KEY>",
   "key": "<MISB KEY>",
Line 58: Line 58:


An example of the previous structure  is:
An example of the previous structure  is:
<syntaxhighlight lang=json>
<syntaxhighlight lang="json">
{  
{  
   "key": "060E2B34020B01010E01030101000000",
   "key": "060E2B34020B01010E01030101000000",
Line 86: Line 86:


The method header is:  
The method header is:  
<syntaxhighlight lang=C>
<syntaxhighlight lang="C">
/**
/**
   * @brief Set the Formatter object to convert between format to metadata
   * @brief Set the Formatter object to convert between format to metadata
Line 100: Line 100:
Remeber to include the formatter header in your code:
Remeber to include the formatter header in your code:


<syntaxhighlight lang=C>
<syntaxhighlight lang="C">
#include "libmisb/formatter/jsonformatter.hpp"
#include "libmisb/formatter/jsonformatter.hpp"
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=C>
<syntaxhighlight lang="C">
   libmisb::LibMisb libmisb;
   libmisb::LibMisb libmisb;
   std::shared_ptr<libmisb::formatter::iFormatter> json_formatter = std::make_shared<libmisb::formatter::JsonFormatter>();
   std::shared_ptr<libmisb::formatter::iFormatter> json_formatter = std::make_shared<libmisb::formatter::JsonFormatter>();
Line 114: Line 114:
   
   
The method header is:  
The method header is:  
<syntaxhighlight lang=C>
<syntaxhighlight lang="C">
/**
/**
   * @brief Receive string metadata that will convert to KLV
   * @brief Receive string metadata that will convert to KLV
Line 136: Line 136:
'''Use case''':
'''Use case''':


<syntaxhighlight lang=C>
<syntaxhighlight lang="C">
   libmisb::LibMisb libmisb;
   libmisb::LibMisb libmisb;
   // Remember to set formatter
   // Remember to set formatter
Line 147: Line 147:
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.
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.
The method header is:  
The method header is:  
<syntaxhighlight lang=C>
<syntaxhighlight lang="C">
/**
/**
   * @brief  Receive packet encoded metadata that will convert to the formatter
   * @brief  Receive packet encoded metadata that will convert to the formatter
Line 167: Line 167:
'''Use case''':
'''Use case''':


<syntaxhighlight lang=C>
<syntaxhighlight lang="C">
   libmisb::LibMisb libmisb;
   libmisb::LibMisb libmisb;
   // Remember to set formatter
   // Remember to set formatter
Cookies help us deliver our services. By using our services, you agree to our use of cookies.