Skip to content
Start free evaluation

pdcomm::secsLimits

Function

Builds a PdcommSecsLimits structure with struct_size already set.

inline PdcommSecsLimits secsLimits(size_t messageBytes, size_t itemBytes, size_t itemCount, size_t nestingDepth)

Declared in: #include <pdcomm.hpp>

The limits are application policy. Every SECS-II item and GEM message checks them before it allocates or sends anything.

const auto limits = pdcomm::secsLimits(1024, 512, 64, 8);
auto value = pdcomm::SecsItem::primitive(PDCOMM_SECS_U4,
                                         std::vector<uint8_t>{0, 0, 0, 7}, limits);

Parameters

NameDescription
messageBytesMaximum encoded size of a whole item tree, headers included.
itemBytesMaximum payload size of any single primitive item.
itemCountMaximum number of items (lists and primitives) in one tree.
nestingDepthMaximum nesting depth. A primitive has depth 1. The native codec also caps the depth at 64.

Returns

A ready-to-use limits structure.