waclib

package
v0.0.0-...-231b78a Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandler

type AuthHandler interface {
	SerialNumber() string
	SignRaw(input []byte) ([]byte, error)
	CertificateRawPKCS7() []byte
	Close() error
}

type ConfigCbFunc

type ConfigCbFunc func(cfg ConfigRequest) (ConfigResponse, error)

type ConfigRequest

type ConfigRequest struct {
	DeviceName string //0x8
	SSID       string //0xC
	Password   string //0xB
	AirplayKey string /* ???, 0x9 */
}

func (ConfigRequest) Marshal

func (config ConfigRequest) Marshal() []byte

func (*ConfigRequest) Unmarshal

func (config *ConfigRequest) Unmarshal(data []byte) error

type ConfigResponse

type ConfigResponse struct {
	IsEmpty bool

	DeviceName      string //0x8
	Model           string //0x7
	SerialNumber    string //0xA
	FirmwareVersion string //0x2
	HardwareVersion string //0x3
	BundleSeed      string //0x1
}

func (ConfigResponse) Marshal

func (config ConfigResponse) Marshal() []byte

func (*ConfigResponse) Unmarshal

func (config *ConfigResponse) Unmarshal(data []byte) error

type DoneCbFunc

type DoneCbFunc func()

type ServiceDiscoveryResult

type ServiceDiscoveryResult struct {
	DeviceID string
	Seed     int
	Addr     string
}

func ClientDiscoverService

func ClientDiscoverService(filterDeviceId string) (ServiceDiscoveryResult, error)

type WACBeacon

type WACBeacon struct {
	MACAddress [6]byte
	Flags      []byte
	Name       string
	Supplier   string
	Type       string
}

func (*WACBeacon) Marshal

func (ie *WACBeacon) Marshal() []byte

func (*WACBeacon) Unmarshal

func (ie *WACBeacon) Unmarshal(data []byte) error

type WACClient

type WACClient struct {
	Insecure bool
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *WACClient

func (*WACClient) Configure

func (c *WACClient) Configure(destination string, config ConfigRequest) (*ConfigResponse, error)

func (*WACClient) IsConfigured

func (c *WACClient) IsConfigured(destination string) (bool, error)

type WACServer

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

func NewServer

func NewServer(auth AuthHandler, singleSession bool, configCb ConfigCbFunc, doneCb DoneCbFunc) (*WACServer, error)

func (*WACServer) AckConfigurationChange

func (s *WACServer) AckConfigurationChange(sucess bool) error

func (*WACServer) ServeHTTP

func (s *WACServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WACServerDiscovery

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

func NewServerDiscovery

func NewServerDiscovery(deviceID string, name string, port int) *WACServerDiscovery

func (*WACServerDiscovery) CurrentAddress

func (w *WACServerDiscovery) CurrentAddress() string

func (*WACServerDiscovery) IncrementSeed

func (w *WACServerDiscovery) IncrementSeed()

func (*WACServerDiscovery) Start

func (w *WACServerDiscovery) Start(ifaceName string, maxWaitIP time.Duration) error

func (*WACServerDiscovery) Stop

func (w *WACServerDiscovery) Stop()

Directories

Path Synopsis
examples
httpaddhost adds a dummy Host: header to http requests.
httpaddhost adds a dummy Host: header to http requests.

Jump to

Keyboard shortcuts

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