Documentation
¶
Overview ¶
Package nativeinspection collects explicit native read observations without playback, storage, retries, device discovery or handle ownership of its own.
Index ¶
- Constants
- Variables
- func MarshalResult(value Result, serial string, request Request) ([]byte, error)
- func ValidateResult(value Result, serial string, request Request) error
- type ErrorInfo
- type Identity
- type LineRead
- type PlaybackRead
- type PlaybackResult
- type Profile
- type RAMResult
- type ReadReference
- type Reader
- type Reply
- type Report
- type Request
- type Result
- type Row
Constants ¶
const ( LiveNative = "live-native" NonAtomic = "sequential-best-effort-not-atomic" )
const ( Contract = "nb1-native-inspection/experimental-v1" RAM = "ram" Playback = "playback" )
const MaxResponseBytes = 64 << 10
Variables ¶
var ( ErrInvalid = errors.New("invalid native inspection request") ErrUnsupported = errors.New("native inspection unavailable") )
Functions ¶
func MarshalResult ¶
MarshalResult is a bounded final wire check, useful for HTTP and fixtures.
Types ¶
type ErrorInfo ¶
type ErrorInfo struct {
Code string `json:"code"`
Message string `json:"message"`
MessageTruncated bool `json:"message_truncated"`
MessageUTF8Replaced bool `json:"message_utf8_replaced"`
NativePlatform *string `json:"native_platform"`
NativeCode *string `json:"native_code"`
NativePlatformTruncated bool `json:"native_platform_truncated"`
NativePlatformUTF8Replaced bool `json:"native_platform_utf8_replaced"`
}
type PlaybackRead ¶
type PlaybackRead struct {
Fields devicesequence.PlaybackFields
Reply Reply
}
type PlaybackResult ¶
type PlaybackResult struct {
Fields devicesequence.PlaybackFields `json:"raw_fields"`
Report Report `json:"report"`
ConfiguredRange *devicesequence.Range `json:"configured_range"`
DecodingStatus string `json:"decoding_status"`
ProfileDigest string `json:"profile_digest"`
Issues []devicesequence.Issue `json:"issues"`
Deployable bool `json:"deployable"`
Error *ErrorInfo `json:"error"`
}
type Profile ¶
type Profile struct {
SDKModel string `json:"sdk_model"`
SDKReferenceFirmware *int `json:"sdk_reference_firmware"`
SDKApplicability string `json:"sdk_applicability"`
RAMLines *int `json:"ram_lines"`
ReadReference ReadReference `json:"read_reference"`
OperationQualification string `json:"operation_qualification"`
PlaybackProfile devicesequence.PlaybackProfile `json:"-"`
}
Profile is trusted adapter input; HTTP/CLI/MCP callers cannot supply it. SDK reference facts remain distinct from version-specific read interpretation.
type RAMResult ¶
type RAMResult struct {
RequestedRange devicesequence.Range `json:"requested_range"`
Rows []Row `json:"rows"`
UnreadPositions []int `json:"unread_positions"`
Sequence *devicesequence.Sequence `json:"sequence"`
SequenceDigest *string `json:"sequence_digest"`
DecodingStatus string `json:"decoding_status"`
Issues []devicesequence.Issue `json:"issues"`
Deployable bool `json:"deployable"`
}
type ReadReference ¶
type Reader ¶
type Reader interface {
ReadLine(position int) (LineRead, error)
ReadPlayback() (PlaybackRead, error)
}
Reader is called synchronously by the owning worker only. Cancellation cannot forcibly interrupt an in-flight native operation or close its handle.
type Reply ¶
type Reply struct {
RequestedReportID byte
BufferLength int
ReadAttempted bool
ReturnedLength int
LengthValid bool
Bytes []byte
}
Reply is an adapter's in-memory observation, never default-marshaled to wire.
type Report ¶
type Report struct {
Layout string `json:"layout"`
RequestedReportID byte `json:"requested_report_id"`
BufferLength int `json:"buffer_length"`
ReadAttempted bool `json:"read_attempted"`
ReturnedLength int `json:"returned_length"`
LengthValid bool `json:"length_valid"`
PrefixTrusted bool `json:"prefix_trusted"`
RawHex string `json:"raw_hex"`
UnknownTailHex string `json:"unknown_tail_hex"`
}
Report exports bytes as hexadecimal, including only the returned prefix. This is the SDK/GID buffer boundary, not a physical USB transaction capture.
type Request ¶
type Request struct {
Kind string
Range *devicesequence.Range
}
type Result ¶
type Result struct {
Contract string `json:"contract"`
Kind string `json:"kind"`
DaemonInstanceID string `json:"daemon_instance_id"`
DeviceSessionID string `json:"device_session_id"`
Device Identity `json:"device"`
Source string `json:"source"`
Consistency string `json:"consistency"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
DurationNS int64 `json:"duration_ns"`
Status string `json:"status"`
Complete bool `json:"complete"`
Profile Profile `json:"profile"`
RAM *RAMResult `json:"ram"`
Playback *PlaybackResult `json:"playback"`
Error *ErrorInfo `json:"error"`
}
func Collect ¶
func Collect(ctx context.Context, reader Reader, request Request, identity Identity, profile Profile) (Result, error)
Collect is called by the owner of an already-open reader. It neither opens nor closes it. It stops a batch on its first error and never retries or manufactures missing rows. Cancellation is checked between synchronous calls.
func DecodeResult ¶
DecodeResult accepts the complete nullable read-side shape. Existing request decoders intentionally forbid null and must not be reused for observations. Every field is explicit; omission is never filled with a plausible zero.
Directories
¶
| Path | Synopsis |
|---|---|
|
Command testfixturegen emits synthetic protocol vectors.
|
Command testfixturegen emits synthetic protocol vectors. |