sadiscover

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeHello added in v1.9.1

func DecodeHello(buf []byte) (id []byte, model string, err error)

func Decrypt added in v1.9.1

func Decrypt(enc []byte, token []byte) (result []byte, err error)

func Encode added in v1.9.1

func Encode(msg, token, deviceID []byte, serialNum uint32) (buf []byte)

func EncodeKey added in v1.9.1

func EncodeKey(key, deviceID []byte) (buf []byte)

func Encrypt added in v1.9.1

func Encrypt(msg, token []byte) (dst []byte)

Types

type Info

type Info struct {
	Model string `json:"model"`
	SwVer string `json:"sw_ver"`
	HwVer string `json:"hw_ver"`
	Port  int    `json:"port"`
	SaID  string `json:"sa_id"`
}

type Packet

type Packet struct {
	Head      []byte
	Len       int
	Reserve   []byte
	DeviceID  []byte
	SerialNum uint32
	MD5Sum    []byte
	Data      []byte
}

func Decode added in v1.9.1

func Decode(buf []byte) (packet Packet, err error)

type Protocol

type Protocol struct {
}

type Result

type Result struct {
	ID int  `json:"id"`
	Re Info `json:"result"`
}

type Server

type Server struct {
}

func NewSaDiscoverServer

func NewSaDiscoverServer() *Server

func (*Server) Run

func (s *Server) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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