MISB metadata encoding
KlvInjector SDK can inject metadata in the following formats:
- RAW buffer
- JSON objects (JSON formatted KLV)
RAW buffers insertion
RAW buffer should contain MISB / KLV encoded metadata packet. The packet will be inserted "as is", without further processing into the STANAG stream. It is basically a binary buffer containing MISB601 encoded KLV data. It is a buffer that starts with
0x06, 0x0E, 0x2B, 0x34, 0x02, 0x0B, 0x01, 0x01, 0x0E, 0x01, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00
Something like this:

JSON formatted KLV
In addition to raw data packets insertion, you can use SDK to create such a binary buffers from the JSON objects. KlvInjector SDK will encode MISB metadata and wrap it into KLV.
JSON formatted KLV is valid JSON object that contains tag : data pairs, where tag corresponds to the MISB 601 (with nested MISB 0102 and MISB 0903 (VMTI) data).

\note For offline processing you must supply the klv timestamp (Tag 2), so injector could figure out where to insert the packet:
{
"2": 1283400392599311,
"3": "Frame 0, 00:00:000",
"13": 32.155127061,
"14": 34.834800006,
"15": 0.0,
"48": {
"1": 1,
"2": 1,
"4": "ImpleoTV Test Mission",
"12": 2,
"22": 9
},
"65": 9,
"72": 1490987362175778
}
Here is an example of JSON object encoding into Klv buffer:
string jsonPckt = @"{
2: 1283400392599311,
3: 'Frame 0, 00:00:000',
13: 32.155127061,
14: 34.834800006,
15: 0.0,
48: {
1: 1,
2: 1,
4: 'ImpleoTV Test Mission',
12: 2,
22: 9
},
65: 9,
72: 1490987362175778
}";
JsonMisb601 m_jsonMisb601 = new JsonMisb601();
// Encode Klv
byte[] buf = m_jsonMisb601.EncodeKlvPacket(jsonPckt);
// The resulted buffer can be inserted into the stream:
m_KlvInjector.WritePacketToOutputPid(m_KlvPid, buf);