scratchlink

package
v0.0.0-...-af1b84c Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHandler

func GetHandler(adapter *bluetooth.Adapter) websocket.Handler

Types

type ConnectParams

type ConnectParams struct {
	PeripheralID string `json:"peripheralId"`
}

func ConnectParamsFromJSON

func ConnectParamsFromJSON(j json.RawMessage) (ConnectParams, error)

type Device

type Device struct {
	PeripheralID string `json:"peripheralId"`
	Name         string `json:"name"`
	RSSI         int16  `json:"rssi"`
}

type DiscoverFilter

type DiscoverFilter struct {
	Name       string      `json:"name"`
	NamePrefix string      `json:"namePrefix"`
	Services   []uuid.UUID `json:"services"`
}

type DiscoverParams

type DiscoverParams struct {
	Filters []DiscoverFilter `json:"filters"`
}

func DiscoverParamsFromJSON

func DiscoverParamsFromJSON(j json.RawMessage) (DiscoverParams, error)

type NotificationsParams

type NotificationsParams struct {
	ServiceID        uuid.UUID `json:"serviceId"`
	CharacteristicID uuid.UUID `json:"characteristicId"`
}

func NotificationsParamsFromJSON

func NotificationsParamsFromJSON(j json.RawMessage) (NotificationsParams, error)

type ReadParams

type ReadParams struct {
	ServiceID          uuid.UUID `json:"serviceId"`
	CharacteristicID   uuid.UUID `json:"characteristicId"`
	StartNotifications bool      `json:"startNotifications"`
}

func ReadParamsFromJSON

func ReadParamsFromJSON(j json.RawMessage) (ReadParams, error)

type UpdateParams

type UpdateParams struct {
	ServiceID        uuid.UUID `json:"serviceId"`
	CharacteristicID uuid.UUID `json:"characteristicId"`
	Message          string    `json:"message"`
	Encoding         string    `json:"encoding,omitempty"`
	WithResponse     bool      `json:"withResponse"`
}

func UpdateParamsFromJSON

func UpdateParamsFromJSON(j json.RawMessage) (UpdateParams, error)

Jump to

Keyboard shortcuts

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