ILMKlvBuilder Interface

The ILMKlvBuilder interface is provided by the LEAD MPEG-2 Transport Multiplexer to simplify the task of parsing Key Length Value (KLV) data. It can be obtained from the multiplexer by reading the ILMMpg2MxT::KlvBuilder property.

Use the KlvBuilder to build and create private data conforming to SMPTE 336M-2007. There are two standards supported by this interface : Universal Metadata Set and Local Metadata Set.

In this standard, keys are formatted and identified as GIUD values indicated by a 16-bit hexadecimal string.

One example of an application of this standard is the one used for vehicles of type Predator UAV (Unmanned Aerial Vehicle): Basic Universal Metadata Set MISB EG 0104.4

In this standard, keys are formatted and identified as short values indicated by an ULONG type.

One example of an application of this standard is the one used for systems of type UAS (Unmanned Air System): Datalink Local Metadata Set Motion Industry Standards Board (MISB) STD 0601.5

The MISB STD 0902.1 provides a refinement of the 0601.5 standard and separates the local metadata described in 0601.5 into "slow" metadata (which changes less often and should be sent every 10 seconds) and "fast" metadata, which changes every time. For example, the MissionID or the plane's name are considered "slow", because they don't change during the recording. So you can save bandwidth by sending these at rare intervals. On the other hand, the metadata describing the position of the plane is considered "fast", because it changes all the time, so it should be written every time new metadata is generated by the plane's sensor. Also, throughout the standard, the plane is referred to as "platform", since the plane can be in fact an unmanned submarine or some other object other than a plane.

MISB Standard 0102.9 describes how to save Security Metadata using Universal or Local sets. You can save them in either format. Consult the standards to determine which keys and values to write and pass the correct information.

Data types:

Mpg2MxT_SearchKey

typedef enum Mpg2MxT_SearchKey 
{ 
   Mpg2MxT_SearchKey_Exact = 1,           /* Find only the exact key. The key version number must match. */ 
   Mpg2MxT_SearchKey_AnyVersion = 2,      /* Ignore the version number when doing the search. */ 
   Mpg2MxT_SearchKey_DesignatorOnly = 3,  /* Find the key by the designator only. Ignore the key representation and version number */ 
} Mpg2MxT_SearchKey; 

Mpg2MxT_Errors

typedef enum Mpg2MxT_Errors 
{ 
   Mpg2MxT_E_KEY_NOT_FOUND = 0x80050010,    /* The KLV data was not found */ 
   Mpg2MxT_E_BAD_KEY = 0x80050011,          /* The KLV key is bad */ 
} Mpg2MxT_Errors; 

Interface Properties:

Type

Name

Description

long

Count

The number of complete top-level KLV keys contained in the internal interface buffer. An incomplete KLV key will not be included in the count.

BYTE[]

GroupKey

Group key defined by the user that is an independent KLV builder; it can be added to the main KLV Builder.

float

SlowMmsRateInterval

Ratio of slowness of the Slow MMS data to the Fast MMS data. 10.0 is the default value which mean the slow data will be sent one time for every 10 seconds of Fast Data. If this value is one, both the slow and fast data are sent at the same rate. Valid values are between 0 and 10,000.

Call this property once to set the rate and then call the FilterMmsData method after you write all of the data (both slow and fast). The FilterMmsData method performs the actual filtering according to the rate set by this property.

Some MMS items change more rapidly than others. When sending MMS data in a bandwidth constrained environment, it is more efficient to dedicate the bulk of the available bandwidth to the rapidly changing values, and include the constant items less often. See MISB STD 0902.1 for more details.

VARIANT_BOOL

EnableMmsRecommendedSettings

Certain metadata items (strings) can be as much as 127 bytes in length. For efficiency, limit strings to the maximum recommended size of 20 bytes.

If EnableMmsRecommendedSettings is VARIANT_TRUE, then the long metatdata will be truncated to the recommended size. Otherwise, the long data will be set. See MISB STD 0902.1 for more details.

Interface Methods:

HRESULT AddData(VARIANT Data, long lDataLengh);

Parameters

Data

Variant containing the private data.

DataLength

The amount of data contained in Data.

Description

Use this method to begin building private data-containing KLV packets. The AddData method uses the smaller of the DataLength parameter and the actual array size. It is particularly useful from ILMMpgDmxCallback::DataAvailable when processing a source file containing KLV data. Build up the KLV data using this method and then edit the individual keys afterwards. This method appends the supplied data to the internal buffer. Call the Clear method to restart the process. The Data parameter must contain a pointer to a byte array.

Returns

S_OK if successful, < 0 if an error occurred.

Common Error Codes

E_POINTER                  [0x80004003] Data is NULL

E_INVALIDARG             [0x80070057] Data is not a byte array variant

HRESULT CreateSubBuilder(VARIANT GroupKey, ILMKlvBuilder1** pVal);

Parameters

GroupKey

Pointer to a VARIANT that holds the key for SubBuilder. The key will be a 16-byte array.

pVal

A pointer to a location to store a new builder interface pointer.

Description

Creates an independent builder for constructing subkeys.

Returns

S_OK if successful, < 0 if an error occurred.

Common Error Codes

Value

Meaning

E_POINTER

[0x80004003] ppBuilder is NULL

HRESULT DeleteKey(long keyIndex);

Parameters

keyIndex

The index of the key to delete. The index is 0-based, so allowed values are 0..Count - 1.

Description

Deletes an existing key.

Returns

S_OK if successful, < 0 if an error occurred.

Common Error Codes

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

HRESULT FindKey(VARIANT KeyToFind, long searchFlags, VARIANT *pKey, VARIANT *pKeyData, long *pDataSize);

Parameters

KeyToFind

Variant describing which key to look for.

searchFlags

One of the flags in the Mpg2MxT_SearchKey enumeration. These flags tell the parser whether the match should be exact.

pKey

Pointer to a VARIANT that will be updated with a key describing the data. The key will be a 16-byte array describing the variant data. This key tells you how to interpret the key data contained in pKeyData.

pKeyData

Pointer to a VARIANT that will be updated key data. The key data will be a byte array variant regardless of the real format of the key data.

pDataSize

Pointer to a long variable that will be updated with the number of bytes stored in pKeyData. This is the same as the size of the pKeyData variant.

Description

Use searchFlags to specify whether you require an exact match for the key for which you are looking. Possible values for searchFlags are:

Mpg2MxT_SearchKey_Exact

An exact match is required. All 16 bytes of the key must match.

Mpg2MxT_SearchKey_AnyVersion

For a match to be acceptable, all key bytes must match, with the exception of the version key (the 7th byte).

Mpg2MxT_SearchKey_DesignatorOnly

For a match to be acceptable, the key designator component must match. The key designator is stored in the last 8 bytes of the key.

This function goes through the top keys in the buffer and compares them with the key passed in KeyToFind. If the key from the buffer matches exactly or partially (as permitted by searchFlags), then the key found is stored in pKey, the key data is stored in pKeyData and the key length is stored in pDataSize.

Returns

S_OK if successful, < 0 if an error occurred.

Common Error Codes

Value

Meaning

E_POINTER

[0x80004003] pKey, pKeyData or pDataSize is NULL.

Mpg2MxT_E_KEY_NOT_FOUND

[0x80050010] There is no key matching KeyToFind and searchFlags.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the pKey or pKeyData variants.

HRESULT FindKeyStr(BSTR KeyToFind, long searchFlags, VARIANT *pKey, VARIANT *pKeyData, long *pDataSize);

Parameters

KeyToFind

String describing which key to look for.

searchFlags

One of the flags in the Mpg2MxT_SearchKey enumeration. These flags tell the parser whether the match should be exact

pKey

Pointer to a VARIANT that will be updated with a key describing the data. The key will be a 16-byte array describing the variant data. This key tells you how to interpret the key data contained in pKeyData.

pKeyData

Pointer to a VARIANT that will be updated key data. The key data will be a byte array variant regardless of the real format of the key data.

pDataSize

Pointer to a long variable that will be updated with the number of bytes stored in pKeyData. This is the same as the size of the pKeyData variant.

Description

This method works exactly like FindKey, except that the key to search for is passed as a string, rather than a VARIANT.

KeyToFind is a string containing a hexadecimal representation of the bytes in the key. Each byte should be represented by two hexadecimal digits. Each digit can be:

Space characters are ignored. For example, "06 0E 2B 34 01 0101 04 07 02 01 0101 05 00 00"; is equivalent to "060E2B34010101040702010101050000".

For more information on each parameter, see the description for FindKey.

Returns

S_OK if successful, < 0 if an error occurred.

Common Error Codes

Value

Meaning

E_POINTER

[0x80004003] pKey, pKeyData or pDataSize is NULL.

Mpg2MxT_E_KEY_NOT_FOUND

[0x80050010] There is no key matching KeyToFind and searchFlags.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the pKey or pKeyData variants.

Mpg2MxT_E__BAD_KEY

[0x80050011] The key string is invalid. A key string should contain a hexadecimal representation of a 16-byte value, with 2 digits per byte (32 digits total).

HRESULT GetData(VARIANT* pData);

Parameters

Data

Pointer to a variant that is filled with a byte array copy of the current data.

Description

Creates a copy of the current data.

Returns

S_OK if successful, < 0 if an error occurred.

Common Error Codes

E_POINTER                  [0x80004003] Data is NULL

E_OUTOFMEMORY      [0x80070057] The array for the copy could not be allocated.

HRESULT GetKey(long keyIndex, VARIANT *pKey, VARIANT *pKeyData, long *pDataSize);

Parameters

keyIndex

The index of the key to retrieve. The index is 0-based, so allowed values are 0..Count - 1

pKey

Pointer to a VARIANT that will be updated with a key describing the data. The key will be a 16-byte array describing the variant data. This key tells you how to interpret the key data contained in pKeyData.

pKeyData

Pointer to a VARIANT that will be updated key data. The key data will be a byte array variant regardless of the real format of the key data.

pDataSize

Pointer to a long variable that will be updated with the number of bytes stored in pKeyData. This is the same as the size of the pKeyData variant.

 Description

Use this method to enumerate all the keys contained in a private data sample. This method enumerates all the data passed to AddData.

The method allocates data for the pKey and pKeyData variants. Make sure you free the memory allocated in these variants if your programming language does not do so automatically. For example, VB automatically frees this memory, but C/C++ does not. In C++, free the variant memory by calling VariantClear. Please consult the documentation for your programming language for more information on how to free the variant data.

Examine pKey to find out how to interpret the key data. The IKlvBuilder will not interpret the key data for you. There is no one document describing all the KLV keys that can be found in a stream. You will find various documents describing certain lists of currently defined keys. Each company that generates MPEG-2 transport streams or files can write their own internal keys in a private data stream. At the time of writing this documentation, the following documents contained information on KLV keys and how to interpret their content:

Interpret key data based on this and other documents. For example:

Key: 06 0E 2B 34 01 0101 04 07 02 01 0101 05 00 00

Is a "User Defined Time Stamp (microseconds since 1970)" in msb bit order and the key should be 8 bytes long. In this case, you should verify that *pDataSize is 8. If *pDataSize is 8, you should convert the 8-byte array into a 64-bit unsigned integer (or a double floating point if your programming language does not support 64-bit integers). You would then convert the 64-bit value into a date and time by counting the microseconds since 1970.

Returns

S_OK if successful, < 0 if an error occurred.

 Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid (< 0).

E_POINTER

[0x80004003] pKey, pKeyData or pDataSize is NULL.

Mpg2MxT_E_KEY_NOT_FOUND

[0x80050010] The key was not found (keyIndex >= Count).

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the pKey or pKeyData variants.

HRESULT InsertKey(long keyIndex, VARIANT Key, VARIANT KeyData, long DataSize);

 Parameters

keyIndex

The index of the keys insertion point. The index is 0-based, so allowed values are 0..Count - 1. However, a special value of -1 will append the key to the end of the current data.

Key

VARIANT a key describing the data. The key will be a 16-byte array describing the variant data. This key tells you how to interpret the key data contained in KeyData.

KeyData

VARIANT containing key data. The key data will be a byte array variant regardless of the real format of the key data.

DataSize

Long variable describing the number of bytes stored in KeyData. This is the same as the size of the KeyData variant.

 Description

Inserts a new key.

Returns

S_OK if successful, < 0 if an error occurred.

Common Error Codes

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT SetKey(long keyIndex, VARIANT Key, VARIANT KeyData, long DataSize);

Parameters

keyIndex

The index of the key to replace. The index is 0-based, so allowed values are 0..Count - 1

Key

VARIANT a key describing the data. The key will be a 16-byte array describing the variant data. This key tells you how to interpret the key data contained in KeyData.

KeyData

VARIANT containing key data. The key data will be a byte array variant regardless of the real format of the key data.

DataSize

Long variable describing the number of bytes stored in KeyData. This is the same as the size of the KeyData variant.

Description

Replaces an existing key.

Returns

S_OK if successful, < 0 if an error occurred.

Common Error Codes

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT CreateGroup(BSTR GroupKey,  ILMKlvBuilder **pVal);

Parameters

GroupKey

A hexadecimal string that defines the Key of the group.

pVal

A pointer to a location to store a new builder interface pointer.

Description

Creates an independent builder for constructing subkeys. This builder is referred to as a group and identified by the GroupKey.

Returns

S_OK if successful, < 0 if an error occurred.
 

Common error codes:

Value

Meaning

E_POINTER

[0x80004003] pVal is NULL

HRESULT InsertGroup( long keyIndex, BSTR key, ILMKlvBuilder *pGroup);

Parameters

keyIndex

The index of the Groupkey's insertion position. The index is 0-based, However, a special value of -1 appends the group at the end of the set.

key

A hexadecimal string representing the groups key. This value can be NULL or an empty string to indicate the GroupKey is defined within the group.

pGroup

The pointer to the group's interface to be added.

Description

Inserts the group into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

E_POINTER

[0x80004003] pGroup is NULL

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertString(long keyIndex, BSTR key, BSTR val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (string) to be inserted.

Description

Inserts a string value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertUInt8(long keyIndex, BSTR key, BYTE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (BYTE) to be inserted.

Description

Inserts an 8-bit unsigned integer value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertUInt16(long keyIndex, BSTR key, USHORT val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (USHORT) to be inserted.

Description

Inserts a 16-bit unsigned integer value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertUInt32(long keyIndex, BSTR key, ULONG val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (ULONG) to be inserted.

Description

Inserts a 32-bit unsigned integer value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertUInt64(long keyIndex, BSTR key, ULONGLONG val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (ULONGLONG) to be inserted.

Description

Inserts a 64-bit unsigned integer value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertInt8(long keyIndex, BSTR key, CHAR val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (CHAR) to be inserted.

Description

Inserts an 8-bit signed integer value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertInt16(long keyIndex, BSTR key, SHORT val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (SHORT) to be inserted.

Description

Inserts a 16-bit signed integer value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertInt32(long keyIndex, BSTR key, LONG val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (LONG) to be inserted.

Description

Inserts a 32-bit signed integer value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertInt64(long keyIndex, BSTR key, LONGLONG val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (LONGLONG) to be inserted.

Description

Inserts a 64-bit signed integer value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertFloat(long keyIndex, BSTR key, FLOAT val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (FLOAT) to be inserted.

Description

Inserts a float value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertDouble(long keyIndex, BSTR key, DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

The simple value (DOUBLE) to be inserted.

Description

Inserts a double value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertArray(long keyIndex, BSTR key, VARIANT val, long valSize);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A hexadecimal string that represents the key.

val

VARIANT containing key value, that will be a byte array.

valSize

forces the actual size of the data. Specify -1 to use all of the array data.

Description

Inserts an array value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT AppendChecksum(BSTR key, BSTR outerKey);

Parameters

key

A hexadecimal string that represents the key.

outerKey

Use this parameter to specify a different group key to use for  checksum calculations. Use NULL or an empty string to default to the predefined GroupKey.

Description

Appends a 16 bit checksum to the end of the builder data.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalGroup(long keyIndex, ULONG key, ILMKlvBuilder* pGroup);

Parameters

keyIndex

The index of the Groupkey's insertion position. The index is 0-based, However, a special value of -1 will append the group at the end of the set.

key

A local dataset ULONG key.

pGroup

The group interface pointer to be added.

Description

Inserts the group into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

E_POINTER

[0x80004003] pGroup is NULL

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalString(long keyIndex, ULONG key, BSTR val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (string) to be inserted.

Description

Inserts a string value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalUInt8(long keyIndex, ULONG key, BYTE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (BYTE) to be inserted.

Description

Inserts an 8-bit unsigned integer value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalUInt16(long keyIndex, ULONG key, USHORT val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (USHORT) to be inserted.

Description

Inserts a 16-bit unsigned integer value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalUInt32(long keyIndex, ULONG key, ULONG val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (ULONG) to be inserted.

Description

Inserts a 32-bit unsigned integer value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalUInt64(long keyIndex, ULONG key, ULONGLONG val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (ULONGLONG) to be inserted.

Description

Inserts a 64-bit unsigned integer value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalInt8(long keyIndex, ULONG key, CHAR val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (CHAR) to be inserted.

Description

Inserts an 8-bit signed integer value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalInt16(long keyIndex, ULONG key, SHORT val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (SHORT) to be inserted.

Description

Inserts a 16-bit signed integer value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalInt32(long keyIndex, ULONG key, LONG val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (LONG) to be inserted.

Description

Inserts a 32-bit signed integer value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalInt64(long keyIndex, ULONG key, LONGLONG val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (LONGLONG) to be inserted.

Description

Inserts a 64-bit signed integer value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalFloat(long keyIndex, ULONG key, FLOAT val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (FLOAT) to be inserted.

Description

Inserts a float value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalDouble(long keyIndex, ULONG key, DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (DOUBLE) to be inserted.

Description

Inserts a double value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalArray(long keyIndex, ULONG key, VARIANT val, long valSize);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

VARIANT containing key value, that will be a byte array.

valSize

Actual data size. Specify -1 to use all of the array data.

Description

Inserts an array value into the builder using the local dataset short key.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT AppendLocalChecksum(BSTR ULONG , BSTR outerKey);

Parameters

key

A local dataset short key.

outerKey

Use this parameter to specify a different group key to use for the checksum calculation. Use NULL or an empry string to default to the predefined GroupKey.

Description

Appends a 16-bit checksum to the end of the builder data using the local dataset short key.

The checksum value is used for error detection and it is highly recommended that a 16-bit checksum is included in every Local Data Set packet.
This value is running a 16-bit sum through the entire LDS packet. The sum is composed of the local data set key and the length field that indicates the data size.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertUnicodeString(long keyIndex, ULONG key, BSTR val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (string) to be inserted.

Description

Inserts a unicode string value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertLocalUnicodeString(long keyIndex, ULONG key, BSTR val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

key

A local dataset ULONG key.

val

The simple value (string) to be inserted.

Description

Inserts a local unicode string value into the builder.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT CreateMmsGroup( ILMKlvBuilder **pVal);

Parameters

pVal

A pointer to a location to store a new builder interface pointer.

Description

Creates an MISB Minimum Metadata Set (MMS) builder. This is a helper function and is equivalent to:

CreateGroup(CComBSTR(L"06 0E 2B 34 02 0B 01 01 0E 01 03 01 01 00 00 00"), pVal);

Returns

S_OK if successful, < 0 if an error occurred.
 

Common error codes:

Value

Meaning

E_POINTER

[0x80004003] pVal is NULL

HRESULT InsertMmsUNIXTimeStamp(long keyIndex, ULONGULONG val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

UNIX Time Stamp (Tag 2).

Description

Microseconds since 00:00:00 Jan 1, 1970 (UTC). Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsMissionID(long keyIndex,  BSTR val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Mission ID (Tag 3).

Description

String containing the mission identifier. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsPlatformHeadingAngle(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Platform Heading Angle (Tag 5). see standard MISB STD 0902.1.

Description

Aircraft heading angle (in degrees) of the longitudinal axis and the North. Should be between 0 and 360. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

This is the horizontal angle. Together with tag 18, this forms the Look Angle, giving the true 3D angle of the plane.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsPlatformPitchAngle(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, the special value of -1 will append the key at the end of the current data.

val

Platform Pitch (Tag 6).

Description

Plane pitch angle (in degrees, should be between -20 and +20). Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsPlatformRollAngle(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Platform Roll (Tag 7).

Description

Plane roll angle (in degrees, should be between -50 and +50). Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsPlatformDesignation(long keyIndex,  BSTR val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Platform Designation (Tag 10).

Description

String containing the name of the plane model ('Predator", "Reaper", etc). Should be less than 127 characters. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsImageSourceSensor(long keyIndex,  BSTR val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Image Source Sensor (Tag 11).

Description

String containing the sensor name ("EO Nose", "EO Spotter", etc). Should be one of the available sensors available for the current PlatformDesignation (Tag 10). Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsImageCoordinateSystem(long keyIndex,  BSTR val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

ImageCoordinateSystem (Tag 12).

Description

String containing the image coordinate system ("Geodetic WGS84", UTM", etc). Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsSensorLatitude(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Sensor Latitude (Tag 13).

Description

Sensor Latitude, based on WGS84 ellipsoid in degrees (should be between -90 and +90). Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsSensorLongitude(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Sensor Longitude (Tag 14).

Description

Sensor Longitude, based on WGS84 ellipsoid in degrees (should be between -180 and +180). Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsSensorTrueAltitude(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Sensor True Altitude (Tag 15).

Description

Sensor altitude compared to the mean sea level (MSL), in meters. Should be between -900 and +19,000. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsSensorHorizontalFoV(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Sensor Field of View (H) (Tag 16).

Description

Horizontal field of view of the sensor, in degrees. Should be between 0 and 180. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsSensorVerticalFoV(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Sensor Field of View (V) (Tag 17).

Description

Vertical sensor field of view of the sensor, in degrees. Should be between 0 and 180. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsSensorRelAzAngle(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Sensor Rel. Azimuth Angle (Tag 18).

Description

Angle (in degrees) of the sensor to the platform longitudinal axis as seen from above the platform. Should be between 0 and 360. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

This is the vertical angle; together with tag 5, this forms the Look Angle, giving the true 3D angle of the plane.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsSensorRelElAngle(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Sensor Relative Elevation Angle (Tag 19):.

Description

Elevation angle of the sensor relative to the platform's longitudinal-transverse plane, in degrees. Should be between -180 and +180. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsSensorRelRollAngle(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Sensor Rel. Roll Angle (Tag 20).

Description

Roll angle of the sensor, in degrees. Should be between -180 and +180. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsSlantRange(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Slant Range (Tag 21).

Description

Slant range (distance to target) in meters. Should be between 0 and 5,000,000. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsTargetWidth(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Target Width (Tag 22).

Description

Width of the target as it appears on the sensor, in meters. Should be between 0 and 10,000. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsFrameCenterLat(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Frame Center Latitude (Tag 23).

Description

Latitude of the terrain in the center of the frame based on the WGS84 ellipsoid, in degrees. Should be between -90 and +90. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsFrameCenterLon(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Frame Center Longitude (Tag 24).

Description

Longitude of the terrain in the center of the frame, based on the WGS84 ellipsoid, in degrees. Should be between -180 and +180. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsFrameCenterEl(long keyIndex,  DOUBLE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

Frame Center Elevation (Tag 25).

Description

Elevation of the terrain in the center of the frame relative to the mean sea level (MSL), in meters. Should be between -900 and 19000. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsSecurity(long keyIndex,  BYTE securityClassification,BYTE classifyingCountryEncoding, BSTR classifyingCountry, BSTR securityInformation, BSTR caveats,BSTR releasingInstructions, BYTE objectCountryEncoding, BSTR objectCountryCodes, USHORT metadataVersion);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

securityClassification

Security Classification (Tag 48/1)

classifyingCountryEncoding

Classifying Country (Tag 48/2 )

classifyingCountry

Classifying Country and

Releasing Instructions

Country Coding Method5 (Tag 48/3 )

securityInformation

Security-SCI/SHI Information (Tag 48/4 )

caveats

Caveats (Tag 48/5 )

releasingInstructions

Releasing Instructions (Tag 48/6 )

objectCountryEncoding

Object Country Coding Method (Tag 48/12 )

objectCountryCodes

Object Country Codes (Tag 48/13 )

metadataVersion

Security Metadata Version (Tag 48/22 )

Description

This method inserts the security local metadata set. Note that you will need to pass the byte value, not the string for securityClassification and classifyingCountry encoding, not the strings. Please refer to standards MISB Standard 0102.9, MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT InsertMmsUASLDSVersion(long keyIndex,  BYTE val);

Parameters

keyIndex

The index of the key's insertion point. The index is 0-based, hence the allowed values are 0...Count - 1. However, a special value of -1 will append the key at the end of the current data.

val

UAS LDS Version (Tag 65).

Description

Version of the LDS document used to generate the values (0 for pre-release and 1..255 for standards 0601.1 through 0601.255). If you use MISB STD 0601.5, then you should set this to 4. Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

DISP_E_BADINDEX

[0x8002000B] keyIndex is invalid.

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT AppendMmslChecksum();

Description

Instructs the KLV Builder to calculate and append a 16-bit checksum (Tag 1) to the end of the builder data using the values inserted up to this point. You should call this method AFTER you add all the other values. It is recommended that you generate this checksum to give the receiver the ability to detect whether corruption has occurred during transmission.

Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

E_OUTOFMEMORY

[0x8007000E] Could not allocate memory for the new data.

HRESULT FilterMmsData(long Flags,  double PTS);

Parameters

Flags

Flags define the PTS format, and uses the values from Mpg2MxT_WriteFlag enumeration for convenience.

PTS

The user passes the current timestamp

Description

After writing all of the MMS metadata, call FilterMmsData to filter out the slow data according to the interval set in SlowMmsRateInterval and MISB STD 0902.1. The 0902.1 Standard identifies which tags are considered "slow" tags (so should be sent less often) and which tags should be considered "fast" (and should be sent every time). The SlowMmsRateInterval determines how often the slow data tags should be written. For example, if the SlowMmsRateInterval is 10.0, the slow data will be sent every 10 seconds (which is the recommended behavior in MISB STD 0902.1).

To write data compatible with MISB STD 0902.1), you have two choices:

1. Filter the data yourself and add slow data every 10 seconds (or however often you wish). In this case, you do not need to call FilterMmsData or set SlowMmsRateInterval.

2. Add all the data every time, set SlowMmsRateInterval to the desired frequency for the slow data and call FilterMmsData right before calling WriteKlvData to remove the remove the slow tags if less than 'SlowMmsRateInterval' number of seconds have passed since the last time the slow data has been sent.

If this function is not called, all the data will be sent every time WriteKlvData() is called (which means SlowMmsRateInterval will have no effect).

Please refer to standards MISB STD 0601.5 and 0902.1 for more details.

Returns

S_OK if successful, < 0 if an error occurred.

Common error codes:

Value

Meaning

VFW_E_WRONG_STATE

[0x80040227L] Conversion is stopped.

Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Filters C API Help
Click or drag to resize