Skip to main content

Module spvd_encode

Module spvd_encode 

Source
Expand description

PVD (pvData) Encoding Helpers

Minimal encoder for NTScalar introspection and value updates.

Functionsยง

compute_changed_bits
Walks desc in pre-order (matching the PVA wire convention that bit 0 represents the whole root structure and subsequent bits correspond to fields in pre-order) and returns a per-bit flag vector marking leaves whose value differs between prev and next.
decode_pv_request_fields
Parse a pvRequest structure from the INIT body bytes and return the list of requested field paths.
decoded_values_equal
Structural equality for DecodedValue with NaN treated as equal to NaN (avoids spurious monitor flaps when a float field is NaN on both sides).
encode_decoded_projected
Re-encode a DecodedValue::Structure against a (possibly narrowed) descriptor, omitting fields that are not present in the descriptor.
encode_decoded_value
Encode a DecodedValue back to PVA wire bytes.
encode_nt_enum_full
encode_nt_ndarray_full
encode_nt_payload_bitset
encode_nt_payload_bitset_parts
encode_nt_payload_delta
Encode a sparse monitor-data delta between prev and next projected onto filtered_desc. Returns None if nothing changed in the filtered view (caller should suppress the update). Otherwise returns (bitset, values) with only the changed leaves marked and encoded.
encode_nt_payload_filtered
Encode only the fields of an NtPayload whose paths appear in filtered_desc. The bitset and value bytes are computed against the filtered descriptor so that a client that received the filtered INIT descriptor will decode them correctly.
encode_nt_payload_full
encode_nt_payload_values_for_desc
Encode the value bytes of an NtPayload projected onto a (possibly narrowed) descriptor. Fields not represented in desc are omitted; sub-structures are encoded recursively.
encode_nt_scalar_array_full
encode_nt_scalar_bitset
encode_nt_scalar_bitset_parts
encode_nt_scalar_full
encode_nt_table_full
encode_pv_request
Build a pvRequest structure for the given field paths.
encode_pv_value
Encode a PvValue tree to PVA wire bytes (values only, no descriptor).
encode_size_pvd
encode_string_pvd
encode_structure_desc
filter_structure_desc
Filter a StructureDesc to include only the listed field paths.
nt_enum_desc
nt_ndarray_desc
nt_ndarray_desc_default
nt_payload_desc
nt_scalar_array_desc
nt_scalar_desc
nt_table_desc
pv_value_desc
Build a StructureDesc from a PvValue::Structure.