gateway

package
v0.0.0-...-e89ab95 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownPort PortType = 0
	Fan                  = 2
	Light                = 3
	Plug                 = 4
	AC                   = 5
	Humidifer            = 6
	Dehumidifer          = 7
	Heater               = 8
)

Variables

View Source
var ACInfinitySvcUUID = ble.MustParse("70D51000-2C7F-4E75-AE8A-D758951CE4E0")
View Source
var ACInfinityWriteUUID = ble.MustParse("70D51001-2C7F-4E75-AE8A-D758951CE4E0")

var ACInfinityNotifyUUID = ble.MustParse("70D51002-2C7F-4E75-AE8A-D758951CE4E0")

View Source
var DeviceInformationUUID = ble.MustParse("180a")
View Source
var GenericAccessUUID = ble.MustParse("1800")
View Source
var HEAD = []byte{165, 0}

Functions

func Ptr

func Ptr[T any](v T) *T

Types

type ACDevice

type ACDevice struct {
	Type      int8
	Version   int8
	PortCount int8
	// contains filtered or unexported fields
}

func NewACDevice

func NewACDevice(g *Gateway, client ble.Client, scanData []byte) *ACDevice

func (*ACDevice) HandleNotification

func (c *ACDevice) HandleNotification(req []byte)

func (*ACDevice) SendCommand

func (c *ACDevice) SendCommand(d []byte)

type ACDevicePortInfo

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

type ACDeviceState

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

func (*ACDeviceState) FromNotif

func (s *ACDeviceState) FromNotif(req []byte)

func (*ACDeviceState) FromNotifV6

func (s *ACDeviceState) FromNotifV6(req []byte)

func (*ACDeviceState) String

func (s *ACDeviceState) String() string

type Gateway

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

func NewGateway

func NewGateway(config config.Config) *Gateway

func (*Gateway) HandleAdvertisement

func (g *Gateway) HandleAdvertisement(adv ble.Advertisement)

func (*Gateway) Start

func (g *Gateway) Start() context.Context

type PortType

type PortType int

Jump to

Keyboard shortcuts

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