module documentation

The byte-string ceiling: one number, published once and applied once.

A bulk payload (an occupancy grid, an image) is as large as its source, not as large as this package chooses. OPC UA says how much a server can carry in Server/ServerCapabilities/MaxByteStringLength (OPC UA Part 5). The effective ceiling, derived from the transport limits the server actually runs with, is written there at init, and our own outbound values are capped at it inside the Projection that produces the bytes (opensmi.ros2.server.recipes). The send path has no second check.

The ceiling is smaller than the message size, because a byte string travels inside a DataValue, a Variant, a response and a chunked message. ENVELOPE_MARGIN holds back an allowance for that envelope.

Function byte_string_ceiling Return the largest byte string this server can carry, given its message budget.
Async Function publish_byte_string_ceiling Write this server's effective ceiling into its capability variable, and return it.
Constant ENVELOPE_MARGIN What is held back from the message budget for everything wrapped around the value itself.
Constant NO_CEILING What OPC UA writes in a capability variable to say a limit does not apply.
def byte_string_ceiling(*, max_message_size: int) -> int:

Return the largest byte string this server can carry, given its message budget.

A pure function of one number. A small budget gets a small ceiling and never zero: the envelope allowance is capped at half the budget, because zero in this capability variable means that no limit applies.

Parameters
max_message_size:intThe transport's limit in bytes, or 0 for no limit.
Returns
intUndocumented
async def publish_byte_string_ceiling(server: Server) -> int:

Write this server's effective ceiling into its capability variable, and return it.

Idempotent. The limits are read off the server, not off our configuration, so a client reads the number the transport will accept.

Parameters
server:ServerThe asyncua server the Machine was built on.
Returns
intUndocumented
ENVELOPE_MARGIN: int =

What is held back from the message budget for everything wrapped around the value itself.

Value
65536
NO_CEILING: int =

What OPC UA writes in a capability variable to say a limit does not apply.

Value
0