device

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusInternalServerError = uhppoted.StatusInternalServerError
	StatusBadRequest          = uhppoted.StatusBadRequest
	StatusUnauthorized        = uhppoted.StatusUnauthorized
	StatusNotFound            = uhppoted.StatusNotFound
)

Variables

This section is empty.

Functions

func SetProtocol added in v0.8.1

func SetProtocol(version string)

func Transmogrify added in v0.8.1

func Transmogrify(e uhppoted.Event) any

Types

type Device

type Device struct {
	AuthorizedCards []string
	Log             *log.Logger
}

func (*Device) ClearTimeProfiles added in v0.7.0

func (d *Device) ClearTimeProfiles(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) DeleteCard

func (d *Device) DeleteCard(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) DeleteCards

func (d *Device) DeleteCards(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) GetCard

func (d *Device) GetCard(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) GetCards

func (d *Device) GetCards(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) GetDevice

func (d *Device) GetDevice(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) GetDevices

func (d *Device) GetDevices(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) GetDoorControl

func (d *Device) GetDoorControl(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) GetDoorDelay

func (d *Device) GetDoorDelay(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) GetEvent

func (d *Device) GetEvent(impl uhppoted.IUHPPOTED, request []byte) (any, error)

func (*Device) GetEvents

func (d *Device) GetEvents(impl uhppoted.IUHPPOTED, request []byte) (any, error)

func (*Device) GetStatus

func (d *Device) GetStatus(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) GetTime

func (d *Device) GetTime(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) GetTimeProfile added in v0.7.0

func (d *Device) GetTimeProfile(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) GetTimeProfiles added in v0.7.0

func (d *Device) GetTimeProfiles(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) OpenDoor added in v0.7.0

func (d *Device) OpenDoor(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) PutCard

func (d *Device) PutCard(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) PutTaskList added in v0.7.1

func (d *Device) PutTaskList(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) PutTimeProfile added in v0.7.0

func (d *Device) PutTimeProfile(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) PutTimeProfiles added in v0.7.0

func (d *Device) PutTimeProfiles(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) RecordSpecialEvents added in v0.6.7

func (d *Device) RecordSpecialEvents(impl uhppoted.IUHPPOTED, request []byte) (any, error)

Handler for the special-events MQTT message. Extracts the 'enabled' value from the request and invokes the uhppoted-lib.RecordSpecialEvents API function to update the controller 'record special events' flag.

func (*Device) SetDoorControl

func (d *Device) SetDoorControl(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) SetDoorDelay

func (d *Device) SetDoorDelay(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

func (*Device) SetTime

func (d *Device) SetTime(impl uhppoted.IUHPPOTED, request []byte) (interface{}, error)

type Event added in v0.8.1

type Event struct {
	DeviceID      uint32         `json:"device-id"`
	Index         uint32         `json:"event-id"`
	Type          uint8          `json:"event-type"`
	TypeText      string         `json:"event-type-text"`
	Granted       bool           `json:"access-granted"`
	Door          uint8          `json:"door-id"`
	Direction     uint8          `json:"direction"`
	DirectionText string         `json:"direction-text"`
	CardNumber    uint32         `json:"card-number"`
	Timestamp     types.DateTime `json:"timestamp"`
	Reason        uint8          `json:"event-reason"`
	ReasonText    string         `json:"event-reason-text"`
}

type Status added in v0.8.1

type Status struct {
	DoorState      map[uint8]bool `json:"door-states"`
	DoorButton     map[uint8]bool `json:"door-buttons"`
	SystemError    uint8          `json:"system-error"`
	SystemDateTime types.DateTime `json:"system-datetime"`
	SequenceId     uint32         `json:"sequence-id"`
	SpecialInfo    uint8          `json:"special-info"`
	RelayState     uint8          `json:"relay-state"`
	InputState     uint8          `json:"input-state"`
	Event          any            `json:"event,omitempty"`
}

Jump to

Keyboard shortcuts

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