Documentation
¶
Index ¶
- Constants
- Variables
- func SetOnEvent(handler func(dest netip.AddrPort, event any))
- type UT0311L04
- func (s *UT0311L04) ButtonPressed(door uint8, duration time.Duration) (bool, error)
- func (s *UT0311L04) Close(door uint8) (bool, error)
- func (s *UT0311L04) Delete() error
- func (s *UT0311L04) DeviceID() uint32
- func (s *UT0311L04) DeviceType() string
- func (s *UT0311L04) FilePath() string
- func (s *UT0311L04) Handle(rq messages.Request) (any, error)
- func (s *UT0311L04) Open(door uint8) (bool, error)
- func (s *UT0311L04) Passcode(door uint8, passcode uint32) (bool, error)
- func (s *UT0311L04) RunTasks()
- func (s *UT0311L04) Save() error
- func (s *UT0311L04) StoreCard(card uint32, from types.Date, to types.Date, doors []uint8, PIN uint32) error
- func (s *UT0311L04) Swipe(cardNumber uint32, door uint8, direction entities.Direction, PIN uint32) (bool, error)
- func (s *UT0311L04) Tick()
Constants ¶
const (
SupervisorAccessCode uint32 = 10
)
Variables ¶
var RELEASE_DATE = types.MustParseDate("2020-01-01")
Functions ¶
func SetOnEvent ¶ added in v0.8.9
Types ¶
type UT0311L04 ¶
type UT0311L04 struct {
SerialNumber types.SerialNumber `json:"serial-number"`
IpAddress net.IP `json:"address"`
SubnetMask net.IP `json:"subnet"`
Gateway net.IP `json:"gateway"`
MacAddress types.MacAddress `json:"MAC"`
Version types.Version `json:"version"`
Released types.Date `json:"released,omitempty"`
TimeOffset entities.Offset `json:"offset"`
Doors entities.Doors `json:"doors"`
Keypads entities.Keypads `json:"keypads"`
Listener netip.AddrPort `json:"listener"`
AntiPassback entities.AntiPassback `json:"anti-passback"`
AutoSend uint8 `json:"auto-send"`
RecordSpecialEvents bool `json:"record-special-events"`
PCControl bool `json:"pc-control"`
SystemError uint8 `json:"system-error"`
SequenceId uint32 `json:"sequence-id"`
SpecialInfo uint8 `json:"special-info"`
InputState uint8 `json:"input-state"`
TimeProfiles entities.TimeProfiles `json:"time-profiles,omitempty"`
TaskList entities.TaskList `json:"tasklist,omitempty"`
Cards entities.CardList `json:"cards"`
Events entities.EventList `json:"events"`
// contains filtered or unexported fields
}
func (*UT0311L04) ButtonPressed ¶ added in v0.6.7
Implements the REST 'press button' API.
Checks the device and unlocks the associated door as long as it is not configured as normally closed. The button is released the specified duration, with the door being held unlocked while the button is pressed.
A 'button pressed' event is generated and sent to the event listener (if any) if 'record special events' is enabled. An event will not be generated if a previous button press is still active but will extend the duration of the action.
func (*UT0311L04) Close ¶ added in v0.6.7
Implements the REST 'close door' API.
Checks the device and closes the door if is has been opened by a simulated open door.
A 'door close' event is generated and sent to the event listener (if any) if the door was closed and 'record special events' is enabled.
func (*UT0311L04) DeviceType ¶
func (*UT0311L04) Open ¶ added in v0.6.7
Implements the REST 'open door' API.
Checks the device and opens the door if has been unlocked by a simulated card swipe, associated button press or is configurated as normally open. The door remains open until closed.
A 'door open' event is generated and sent to the event listener (if any) if the door was opened and 'record special events' is enabled.
func (*UT0311L04) Passcode ¶ added in v0.8.7
Implements the REST 'passcode' API.
Checks the device and door passcodes and unlocks the associated door if appropriate, but does not simulate opening the door. A 'door open/supervisor password' event is generated and sent to the configured event listener (if any).
Note: the supervisor passcode overrides all access restrictions, including the door interlocks and
time/task profiles.
func (*UT0311L04) StoreCard ¶ added in v0.8.9
func (s *UT0311L04) StoreCard(card uint32, from types.Date, to types.Date, doors []uint8, PIN uint32) error
Implements the REST PUT 'card' API.
Adds the card to the controller cards list. Unlike the controller 'put-card' API, the REST API allows invalid start and end dates (for testing purposes).
func (*UT0311L04) Swipe ¶
func (s *UT0311L04) Swipe(cardNumber uint32, door uint8, direction entities.Direction, PIN uint32) (bool, error)
Implements the REST 'swipe' API.
Checks the device and card permissions and unlocks the associated door if appropriate, but does not simulate opening the door. A 'swiped' event is generated and sent to the configured event listener (if any).
Source Files
¶
- UTC0311L04.go
- actions.go
- activate_keypads.go
- add_task.go
- clear_task_list.go
- clear_time_profiles.go
- delete_card.go
- delete_cards.go
- get_anti_passback.go
- get_card.go
- get_cards.go
- get_device.go
- get_door_control_state.go
- get_event.go
- get_event_index.go
- get_listener.go
- get_status.go
- get_time.go
- get_time_profile.go
- open_door.go
- put_card.go
- record_special_events.go
- refresh_task_list.go
- restore_default_parameters.go
- set_address.go
- set_anti_passback.go
- set_door_control_state.go
- set_door_passcodes.go
- set_event_index.go
- set_interlock.go
- set_listener.go
- set_pc_control.go
- set_time.go
- set_time_profile.go