Current system: Kuiper 1.2.1 uses device API 0.1.0-ip36-panel1, capability 3 and IIO profile ABI 1. See current source/RTL/metadata mapping and verified basic queries.
This chapter defines software IIO profile control, standard IQ buffers and the H102 USB v3 wire format. Match the device, version and configuration. A normal IIO buffer is not a USB frame.
Device h102-profile-control uses network iiod/libiio and has no IQ channels. The released control interface is ABI 1.
| Attribute | Access | Meaning |
|---|---|---|
| abi_version | R | Control-interface ABI version |
| available | R | Space-separated list of 58 exact IDs: 29 combinations × two LO modes |
| select | R/W | Write a profile ID to submit an asynchronous request; write success means acceptance only |
| active | R | Verified current profile ID |
| previous | R | Previous profile ID |
| status | R | unavailable/ready/queued/applying/applied/rolled_back/rejected |
| error | R | Backend error or information about an unknown request outcome |
| request_id | R | 64-bit sequence within the module instance; restarts after reload |
| configuration_id | R | 32-bit manager configuration ID within this boot |
| active_info | R | JSON snapshot: four-channel parameters, clock/SSI, API, SHA, boot and verification time |
The SHA in active_info identifies managed inputs, not a complete chip-configuration export. Clock values are manifest parameters, not native-counter readback. Attribute input accepts one trailing newline or NUL; embedded NUL is invalid.
Save the previous request_id, write select and record the new sequence. Poll that request with a bounded timeout. At a terminal state, also verify active and actual active_info parameters. Only one profile transaction may run on a device at a time.
| errno / state | Meaning and action |
|---|---|
| EBUSY | An earlier request or device operation is active; finish or wait for it |
| EINVAL | Unknown ID or invalid syntax; choose from available |
| ENOTCONN | Backend disconnected or heartbeat expired; inspect bootstrap/broker |
| ENODATA | No publishable active snapshot during queued/applying/unavailable |
| rolled_back | Apply failed; independent post-processing restored state. Query the actual rollback state |
| BACKEND_RECONNECTED_REQUEST_OUTCOME_UNKNOWN | Current configuration is verifiable but the interrupted request's terminal outcome is unknown; resynchronize application state |
The board broker is a root service communicating with the kernel character device. Applications normally use libiio attributes rather than constructing the internal character-device ABI or writing registers.
IIO development covers profile transactions, tuning, gain, IQ layout and data-workflow entry points. The attribute reference lists 13 actual devices, 95 channels and 761 attributes, including maintenance interfaces.
C++/Python examples and Source materials provide read-only queries and profile selection. Read-only example:
Development host · Use the library or recording specified here. Match the device address, channel and input file to your setup.
from h102_api import Context
with Context("ip:192.168.1.100") as context:
print(context.snapshot())
See the example chapter for working directories, dependencies and commands. Selecting a profile does not create an IQ buffer. Initialization involves chip state transitions and is not authorization to transmit a user waveform. Check Example prerequisites first.
The C lifecycle is create_context → find_device → enumerate/enable channels → create_buffer → refill (RX) / push (TX) → destroy_buffer → destroy_context. Check negative returns, timeouts, permits and actual scan layout for each allocation/read/submission. Release the buffer and context on failure too.
Data programs must follow the actual channel scan format for I/Q layout and check transfer length and errors. See the user guide for reception/recording and IIO development for interfaces.
A default frame is 128 header bytes + 8192 payload bytes = 8320 bytes, carrying 2048 I16/Q16 samples. Header overhead is about 1.53846% of the frame. All integers are little-endian. Each boolean occupies a uint8. Do not transmit padded C structures or bitfields directly.
RX and TX share the layout below, with different semantics described afterwards. Obtain the complete matching parser and dependencies from the authorized source package; do not mix protocol-version headers.
| Byte offset | Type / bytes | Field | Meaning |
|---|---|---|---|
| 0 | bytes / 4 |
magic |
ASCII H102 |
| 4 | u8 / 1 |
version |
3 |
| 5 | u8 / 1 |
type |
1=RX, 2=TX |
| 6 | u8 / 1 |
channel |
Physical channel 1 or 2 |
| 7 | u8 / 1 |
sample_format |
1=I16/Q16 |
| 8 | u16 / 2 |
header_bytes |
Fixed at 128 |
| 10 | u8 / 1 |
first_frame |
First frame of this channel |
| 11 | u8 / 1 |
end_frame |
Last complete frame of a finite stream |
| 12 | u8 / 1 |
gap_before |
RX gap before this frame; always 0 for TX |
| 13 | u8 / 1 |
timestamp_valid |
RX time validity; 0 for immediate TX |
| 14 | u8 / 1 |
time_source |
1 (GNSS) for valid RX time, otherwise 0 |
| 15 | u8 / 1 |
timestamp_reference |
1 (native IQ acceptance cycle) for valid RX time, otherwise 0 |
| 16 | u32 / 4 |
payload_bytes |
Valid payload length |
| 20 | u32 / 4 |
frame_sequence |
Per-channel complete-frame sequence, wrapping u32 |
| 24 | u64 / 8 |
first_sample_index |
Index of this channel's first sample in the frame |
| 32 | u64 / 8 |
stream_id |
Nonzero, matching the control session |
| 40 | u32 / 4 |
configuration_id |
Nonzero, associated with this configuration record |
| 44 | u32 / 4 |
time_epoch |
Valid RX time generation; 0 for TX |
| 48 | u64 / 8 |
sample_rate_num |
Effective sample-rate numerator, Hz |
| 56 | u32 / 4 |
sample_rate_den |
Effective sample-rate denominator |
| 60 | u32 / 4 |
sample_count |
IQ sample count, payload_bytes/4 |
| 64 | u64 / 8 |
center_frequency_hz |
Actual LO/center frequency |
| 72 | u32 / 4 |
rf_bandwidth_hz |
Actual RF bandwidth |
| 76 | i32 / 4 |
manual_gain_mdb |
RX manual gain; negative attenuation_mdb for TX |
| 80 | u64 / 8 |
utc_anchor_seconds |
Integer UTC POSIX seconds |
| 88 | u32 / 4 |
sample_offset_ticks |
First-sample tick offset from the anchor |
| 92 | u32 / 4 |
tick_hz |
Actual counter-clock frequency in Hz |
| 96 | u64 / 8 |
device_id |
Device identifier associated with the configuration record |
| 104 | u8 / 1 |
gain_mode |
0 unknown, 1 manual, 2 AGC |
| 105 | u8 / 1 |
sample_rate_valid |
Sample-rate validity; must be 1 in this version |
| 106 | u8 / 1 |
center_frequency_valid |
Center-frequency validity |
| 107 | u8 / 1 |
bandwidth_valid |
RF-bandwidth validity |
| 108 | u8 / 1 |
manual_gain_valid |
Manual-gain validity |
| 109 | u8 / 1 |
device_id_valid |
Device-ID validity |
| 110 | u8 / 1 |
time_scale |
1 (UTC) for valid RX time, otherwise 0 |
| 111 | u8 / 1 |
time_quality |
1 (uncalibrated RF delay) for valid RX time, otherwise 0 |
| 112 | bytes / 16 |
reserved_extension |
Bytes 112–127 must all be zero |
Output or format reference · Compare with actual data. No command or substitution.
+0 I0 low byte +1 I0 high byte +2 Q0 low byte +3 Q0 high byte
+4 I1 low byte +5 I1 high byte +6 Q1 low byte +7 Q1 high byte ...
I and Q are signed int16 and can be negative. Each channel has its own channel, sequence and sample_index. Assess continuity per channel. USB callback order does not establish simultaneity.
| Field | TX type2 requirement |
|---|---|
| first/end | Per-channel first / finite last complete frame; DONE after END consumption |
| gap_before | 0; TX sequence must be continuous |
| Time fields | Bytes 13..15, 44..47, 80..95 and 110..111 all zero; no scheduled transmission |
| Fs/LO/BW/device/valid | Exactly match the actual template frozen at ARM |
| manual_gain_mdb | Negative actual TX attenuation_mdb in manual mode; not RX gain |
| sequence/index | Independent per channel; default index increment 2048 per frame |
| payload/reserved | Fixed 8192-byte payload; all 16 extension bytes zero |
The sender fills dynamic first/end/sequence/index fields; all other bytes match the template. Further data for that channel is rejected after END. A complete bank is published only after validation. Underrun outputs zeros and latches the fault; the original stream does not resume automatically.
USB lengths, short completions and tlast mark transfer fragments, not H102 frame boundaries. Accumulate valid bytes, validate the header after at least 128 bytes, then wait for the complete payload. Deliver only complete frames. Report incomplete STOP-tail bytes separately; do not pad them into valid IQ.
This Python fragment reads fields from an already complete header. Use the reference parser for full semantic and streaming validation:
Development host · Use the library or recording specified here. Match the device address, channel and input file to your setup.
import struct
magic, version, kind, channel, sample_format, header_bytes = struct.unpack_from(
"<4sBBBBH", header, 0
)
assert (magic, version, kind, header_bytes) == (b"H102", 3, 1, 128)
payload_bytes, sequence = struct.unpack_from("<II", header, 16)
first_index, stream_id = struct.unpack_from("<QQ", header, 24)
rate_num = struct.unpack_from("<Q", header, 48)[0]
rate_den, samples = struct.unpack_from("<II", header, 56)
assert payload_bytes == samples * 4 and rate_num > 0 and rate_den > 0
Persist the configuration record before starting data and associate it by (device_id,stream_id,configuration_id). Include epoch/channel/first index for time diagnosis. Use a new stream after stop, retaining snapshots and failure reasons. Host ACK follows an actual board STOP and quiet DRAIN, not a client's assumption that the session ended.
Raw MMIO ABI is for driver/RTL maintenance; ordinary clients should use managed interfaces. TX ARM/DRAIN has a five-second hardware lease, with software stopping earlier. This does not establish the same hardware lease for RX. Use addresses/registers defined by the matching RTL version.
Only the newer sharedlo1 driver exports read-only adrv9002-phy.fdd_shared_lo_atomic=1. It identifies one common-carrier transaction across RX/TX ports sharing an LO in FDD. Writing an RX or TX LO updates all enabled ports on that LO and combines required initial calibrations. TDD and independent RX/TX LOs retain their respective carrier semantics.
This capability does not promise atomic submission of multiple IIO attributes or complete rollback on every failure. Enumerate actual channels, check device/profile identity, stop conflicting data operations and read all affected carriers/states. Do not hardcode iio:deviceN.
initial_calibrations=auto performs required calibration for large frequency changes. run is a command; afterwards the prior off/auto policy is read back, not run. The shared-LO path temporarily powers previously disabled TX into CALIBRATED and powers it down after RX passes Prime recovery. This is not authorization for user-waveform transmission. Confirm native transaction and independent post-recovery results after failure.