dut

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeviceTypeWLBV1 = "WLBV1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DUTComponent

type DUTComponent struct {
	// contains filtered or unexported fields
}

This follows a manufacturer-based component pattern

func NewDUTComponent

func NewDUTComponent() *DUTComponent

NewDUTComponent creates a new DUT component

func (*DUTComponent) CanHandle

func (c *DUTComponent) CanHandle(deviceType components.DeviceType, payload *components.RawPayload) bool

CanHandle checks if this component can handle the given device type and payload

func (*DUTComponent) GetInfo

func (c *DUTComponent) GetInfo() components.ComponentInfo

GetInfo returns component metadata

func (*DUTComponent) GetSupportedDevices

func (c *DUTComponent) GetSupportedDevices() []components.DeviceType

GetSupportedDevices returns the device types this component supports

func (*DUTComponent) GetSupportedEntityTypes

func (c *DUTComponent) GetSupportedEntityTypes(deviceType components.DeviceType) []string

GetSupportedEntityTypes returns the entity types this device supports

func (*DUTComponent) GetSupportedPorts

func (c *DUTComponent) GetSupportedPorts(deviceType components.DeviceType) []int

GetSupportedPorts returns the fPorts this device type uses

func (*DUTComponent) Parse

Parse converts raw payload into structured ParsedData (DEPRECATED: Use ParseToEntities)

func (*DUTComponent) ParseToEntities

func (c *DUTComponent) ParseToEntities(ctx context.Context, orgSlug, model string, deviceType components.DeviceType, payload *components.RawPayload, deviceLocation *components.Location) (*components.ParseResult, error)

ParseToEntities converts raw payload into multiple entities

func (*DUTComponent) SupportsGPS

func (c *DUTComponent) SupportsGPS(deviceType components.DeviceType) bool

SupportsGPS returns true if the device has built-in GPS

func (*DUTComponent) Validate

func (c *DUTComponent) Validate(deviceType components.DeviceType, data *components.ParsedData) error

Validate performs device-specific validation on the parsed data

type DeviceParser

type DeviceParser interface {
	ParsePayload(payload *components.RawPayload) (*components.ParsedData, error)
	ParseToEntities(orgSlug, model string, payload *components.RawPayload, deviceLocation *components.Location) ([]components.Entity, error)
	SupportsGPS() bool
	GetSupportedPorts() []int
	GetSupportedEntityTypes() []string
}

DeviceParser handles device-specific parsing logic

type WLBV1Parser

type WLBV1Parser struct{}

WLBV1Parser handles parsing of WLB V1 device payloads

func NewWLBV1Parser

func NewWLBV1Parser() *WLBV1Parser

NewWLBV1Parser creates a new WLB V1 parser

func (*WLBV1Parser) GetSupportedEntityTypes

func (p *WLBV1Parser) GetSupportedEntityTypes() []string

GetSupportedEntityTypes returns entity types supported by WLB V1

func (*WLBV1Parser) GetSupportedPorts

func (p *WLBV1Parser) GetSupportedPorts() []int

GetSupportedPorts returns the fPorts typically used by WLB V1

func (*WLBV1Parser) ParsePayload

func (p *WLBV1Parser) ParsePayload(payload *components.RawPayload) (*components.ParsedData, error)

ParsePayload parses WLB V1 device payload and extracts GPS coordinates

func (*WLBV1Parser) ParseToEntities

func (p *WLBV1Parser) ParseToEntities(orgSlug, model string, payload *components.RawPayload, deviceLocation *components.Location) ([]components.Entity, error)

ParseToEntities creates entities for WLB V1 device

func (*WLBV1Parser) SupportsGPS

func (p *WLBV1Parser) SupportsGPS() bool

SupportsGPS returns true since WLB V1 can have GPS capability depending on configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL