createItemsRequest

fun createItemsRequest(entriesToRequest: Map<String?, Collection<String?>>, docType: String?): ByteArray

Helper function to create a CBOR data for requesting data items. The IntentToRetain value will be set to false for all elements.

The returned CBOR data conforms to the following CDDL schema:

ItemsRequest = {
? "docType" : DocType,
"nameSpaces" : NameSpaces,
? "RequestInfo" : {* tstr => any} ; Additional info the reader wants to provide
}

NameSpaces = {
+ NameSpace => DataElements     ; Requested data elements for each NameSpace
}

DataElements = {
+ DataElement => IntentToRetain
}

DocType = tstr

DataElement = tstr
IntentToRetain = bool
NameSpace = tstr
*

Return

CBOR data conforming to the CDDL mentioned above.

TODO: docType is no longer optional so change docType to be NonNull and update all callers.

Parameters

entriesToRequest

The entries to request, organized as a map of namespace names with each value being a collection of data elements in the given namespace.

docType

The document type or null if there is no document type.