Documentation
¶
Index ¶
- type ReleaseDate
- 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(src *net.UDPAddr, rq messages.Request)
- func (s *UT0311L04) Open(door uint8, duration *time.Duration) (bool, error)
- func (s *UT0311L04) Save() error
- func (s *UT0311L04) SetTxQ(txq chan entities.Message)
- func (s *UT0311L04) Swipe(cardNumber uint32, door uint8) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReleaseDate ¶ added in v0.6.7
Firmware release date.
func DefaultReleaseDate ¶ added in v0.6.7
func DefaultReleaseDate() *ReleaseDate
Returns a fixed firmware release date to 2020-01-01 for default simulator initialisation.
func (ReleaseDate) MarshalJSON ¶ added in v0.6.7
func (d ReleaseDate) MarshalJSON() ([]byte, error)
Custom JSON marshaller to format the release date as a string of the form 'YYYY-mm-dd'.
func (*ReleaseDate) UnmarshalJSON ¶ added in v0.6.7
func (d *ReleaseDate) UnmarshalJSON(bytes []byte) error
Custom JSON unmarshaller to parse a date string of the form 'YYYY-mm-dd'.
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 *ReleaseDate `json:"released"`
TimeOffset entities.Offset `json:"offset"`
Doors map[uint8]*entities.Door `json:"doors"`
Listener *net.UDPAddr `json:"listener"`
RecordSpecialEvents bool `json:"record-special-events"`
SystemError uint8 `json:"system-error"`
SequenceId uint32 `json:"sequence-id"`
SpecialInfo uint8 `json:"special-info"`
InputState uint8 `json:"input-state"`
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 is closed again after the open duration. A 'nil' duration will keep the door open until a 'door close' action closes it.
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.
Source Files
¶
- UTC0311L04.go
- actions.go
- delete_card.go
- delete_cards.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
- open.go
- put_card.go
- record_special_events.go
- set_address.go
- set_door_control_state.go
- set_event_index.go
- set_listener.go
- set_time.go
- types.go