discovery

package
v0.0.0-...-904a803 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Interesting note, some devices like WeMo switches don't respond to ssdp:all queries, but will
	// answer upnp:rootdevice queries.  Something to keep in mind, I'm sure it's not the only case
	DISCOVERY_ADDR_DEFAULT      = "239.255.255.250"
	DISCOVERY_PORT_DEFAULT      = 1900
	DISCOVERY_TARGET_DEFAULT    = "ssdp:all"
	DISCOVERY_WAIT_MIN_DURATION = 1 * time.Second
	DISCOVERY_WAIT_MAX_DURATION = 5 * time.Second
)

Variables

View Source
var Logger *log.Logger

Functions

func Discover

func Discover(req *SearchRequest, ch chan<- *SearchResponse) error

func ListenNotify

func ListenNotify(ch chan<- *NotifyResponse) error

Types

type Discoverer

type Discoverer interface {
	Discover(req *SearchRequest, ch chan<- *SearchResponse)
	ListenNotify(ch chan<- *NotifyResponse)
}

type NotifyResponse

type NotifyResponse struct {
	SSDPResponse
	NT         string
	NTS        string
	NextBootId int
}

type SSDPResponse

type SSDPResponse struct {
	Location     string
	CacheControl string
	Server       string
	USN          string
	BootId       int
	ConfigId     int
	SearchPort   int
}

type SearchRequest

type SearchRequest struct {
	Host   string
	Port   int
	Target string
	Wait   time.Duration
}

func NewSearchRequest

func NewSearchRequest() *SearchRequest

type SearchResponse

type SearchResponse struct {
	SSDPResponse
	ST string
}

Jump to

Keyboard shortcuts

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