discovery

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiscoverPort = 65001
)

Variables

This section is empty.

Functions

func BuildDiscoverResponseFrame

func BuildDiscoverResponseFrame(resp DiscoverResponse) ([]byte, error)

Types

type Config

type Config struct {
	ListenAddr     string
	DeviceID       string
	DeviceAuth     string
	TunerCount     int
	HTTPAddr       string
	LegacyHTTPAddr string
	Logger         *slog.Logger
}

Config controls the UDP discovery responder.

type DiscoverQuery

type DiscoverQuery struct {
	DeviceTypes []uint32
	DeviceID    uint32
}

DiscoverQuery captures request filters from a discovery query.

func ParseDiscoverRequest

func ParseDiscoverRequest(frame []byte) (DiscoverQuery, error)

func (DiscoverQuery) WantsDeviceID

func (q DiscoverQuery) WantsDeviceID(deviceID uint32) bool

func (DiscoverQuery) WantsTuner

func (q DiscoverQuery) WantsTuner() bool

type DiscoverResponse

type DiscoverResponse struct {
	DeviceID   uint32
	TunerCount uint8
	BaseURL    string
	LineupURL  string
	DeviceAuth string
}

DiscoverResponse controls fields emitted by a discovery reply packet.

type Packet

type Packet struct {
	Type uint16
	Tags []TLV
}

Packet is an HDHomeRun discovery protocol frame.

func ParsePacket

func ParsePacket(frame []byte) (Packet, error)

func (Packet) Marshal

func (p Packet) Marshal() ([]byte, error)

type Server

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

Server handles HDHomeRun UDP discovery requests.

func NewServer

func NewServer(cfg Config) (*Server, error)

func (*Server) Addr

func (s *Server) Addr() net.Addr

func (*Server) Close

func (s *Server) Close() error

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) error

type TLV

type TLV struct {
	Tag   byte
	Value []byte
}

TLV is a discovery packet field.

Jump to

Keyboard shortcuts

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