Expand description
Minimal MIDI-CI Property Exchange (PE) framing.
Handles Set Property Inquiry (sub-ID2 = 0x36) and replies with ACK (0x37). Spec reference: MIDI-CI 1.2, §7 Property Exchange.
SysEx7 message layout: F0 7E <device_id> 0D <sub_id2> <ci_version> <source_muid: 4 bytes> <dest_muid: 4 bytes> <request_id> <header_len_lo> <header_len_hi> <header_data…> <num_chunks_lo> <num_chunks_hi> <chunk_num_lo> <chunk_num_hi> <body_len_lo> <body_len_hi> <body_data…> F7
Reply header format: [status] (1 byte for Set Reply) or [status, resource] (2 bytes for Get Reply).
Structs§
- SetProperty
Data - Parsed Set Property Inquiry with resource identifier and body.
Enums§
- PeStatus
- PE reply status codes (HTTP-inspired).
Constants§
- PE_
GET_ INQUIRY - Sub-ID2: Inquiry Get Property Data (MIDI-CI 1.2)
- PE_
GET_ REPLY - Sub-ID2: Reply to Get Property Data
- PE_
SET_ INQUIRY - Sub-ID2: Inquiry Set Property Data (MIDI-CI 1.2)
- PE_
SET_ REPLY - Sub-ID2: Reply to Set Property Data
Functions§
- build_
get_ inquiry - Build a Get Property Inquiry message (CLI → device).
- build_
get_ reply - Build a Get Property Reply with status and body data.
- build_
set_ inquiry - Build a Set Property Inquiry message (CLI → device).
resourceis the preset index (carried in header).bodymust contain only 7-bit safe bytes. - build_
set_ reply - Build a Set Property Reply with status.
- decode_
mcoded7 - Decode mcoded7 data back to original bytes.
Returns the number of bytes written to
out. - encode_
mcoded7 - Encode data using mcoded7 (MIDI-CI spec): every 7 input bytes → 8 output bytes.
The first byte of each group carries the high bits (bit 7) of the following 7 bytes.
Returns the number of bytes written to
out. - extract_
body - Legacy helper: extract just the body (ignores resource).
- extract_
get_ body - Extract body from a Get Property Reply.
- extract_
get_ resource - Extract the resource identifier from a Get Property Inquiry.
- extract_
reply_ status - Extract status from a Set Property Reply or Get Property Reply. Status is the first header byte in replies.
- extract_
set_ property - Extract resource identifier and body from a Set Property Inquiry.
- is_
ci_ message - Check if a SysEx buffer is a MIDI-CI message.
- is_
get_ property - Check if the message is a Get Property Inquiry.
- is_
get_ reply - Check if the message is a Get Property Reply.
- is_
set_ property - Check if the message is a Set Property Inquiry.
- request_
id - Extract the request_id field.
- source_
muid - Extract the source MUID (4 bytes).