Go API for low-level access to the UT0311-L0x* TCP/IP Wiegand access control boards. This module implements the device level interface used by uhppote-cli, uhppoted-api, uhppoted-rest, etc.
Supported operating systems:
- Linux
- MacOS
- Windows
- RaspberryPi (ARM7)
v0.8.9 - 2024-09-06
- Implemented TCP/IP transport support.
- Reworked UT0311-L0x driver to use connected UDP sockets.
- Updated
put-card
API to fail with 'invalid card' for card numbers 0, 0xffffffff and 0x00ffffff. - Updated to Go 1.23.
Assuming you have Go
and make
installed:
git clone https://github.com/uhppoted/uhppote-core.git
cd uhppote-core
make build
If you prefer not to build manually:
git clone https://github.com/uhppoted/uhppote-core.git
cd uhppote-core
mkdir bin
go build -trimpath -o bin ./...
GetDevices
GetDevice
SetAddress
GetListener
SetListener
GetTime
SetTime
GetDoorControlState
SetDoorControlState
RecordSpecialEvents
GetStatus
GetCards
GetCardById
GetCardByIndex
PutCard
DeleteCard
DeleteCards
GetTimeProfile
SetTimeProfile
ClearTimeProfiles
ClearTaskList
AddTask
RefreshTaskList
GetEvent
GetEventIndex
SetEventIndex
OpenDoor
SetPCControl
ActivateKeypads
SetSuperPasswords
SetInterlock
RestoreDefaultParameters
Listen
Other than GetDevices
API which specifically uses UDP broadcast to issue a request, the API will use the configured controller IP address if possible, falling back to a broadcast request if necessary.
Retrieves a list of all UHPPOTE controllers that respond to a broadcast get-device
request.
Retrieves the controller information for a specific UHPPOTE controller from the response to a get-device
request.
Sets the IPv4 address, subnet mask and gateway address for a controller.
Retrieves the IPv4 configured address:port to which events are sent from the controller, along with the auto-send interval.
Sets the IPv4 address and port of the host to receive events from the controller, as well as the auto-send interval (the auto-send interval is the interval at which the controller will repeatedly send the most recent event along with the current system status).
Retrieves the controller date and time.
Sets the controller date and time.
Retrieves a door control state (normally open
, normally closed
or controlled
) from the controller.
Sets a door control state (normally open
, normally closed
or controlled
) on the controller.
Enables or disables the door and relay events on a controller.
Retrieves the controller current status.
Retrieves the number of cards stored on a controller.
Retrieves a stored card's information using the card number.
Retrieves a stored card's information using an index into the card list.
Adds or updates a card record on the controller.
NOTES:
-
The UHPPOTE access controller has a weird behaviour around the PIN field. According to the SDK documentation, valid PINs are in the range 0 to 999999. However the controller will accept a PIN number out of that range and only keep the lower 7 nibbles of the 32-bit unsigned value. e.g:
PIN Hex value Stored as (hex) Retrieved as (hex) Retrieved as (decimal) 0 0x000000 0x000000 0x000000 0 999999 0x0f423f 0x0f423f 0x0f423f 999999 1000000 0x0f4240 0x000000 0x000000 0 1000001 0x0f4241 0x000000 0x000000 0 1048576 0x100000 0x000000 0x000000 0 1048577 0x100001 0x000000 0x000001 1 1999999 0x1E847F 0x0E847F 0x000001 951423 To avoid unexpected behaviour, the uhppote-core
put-card
implementation returns an error if the PIN is out of range. -
As of release v0.8.5,
put-card
validates the card number against the Wiegand-26 standard. The development release allows the invoking function to provide a list of allowed formats:none
any
Wiegand-26
Deletes a card record from the controller.
Deletes all card records from the controller.
Retrieves a numbered time profile from the controller.
Adds or updates a numbered time profile on the controller.
Deletes all stored time profiles from a controller.
Clears the scheduled task list on a specific UHPPOTE controller, preparatory to using AddTask
and RefreshTask
.
Adds a scheduled task to the task list on a specific UHPPOTE controller. The task is not activated until RefreshTaskList
is invoked. ClearTaskList
should have been invoked prior to invoking a sequence of AddTask
invocations to put the task list in a known state.
Activates all tasks added by AddTask
.
Retrieves a single stored event (by index) from the controller.
Retrieves the current value of the controller event index (typically used as a marker for events that have been retrieved).
Sets the current value of the controller event index (typically used to update the marker for events that have been retrieved).
Unlocks a door remotely.
Enables or disables remote host access control.
If remote host access control is enabled, the access controller expects the host to communicate at least once every 30 seconds otherwise it reverts to local control of access using the stored list of cards (the communication is not required to be a 'set-pc-control' command - any command is sufficient). If the access controller has reverted to local control because no message has been received from the host for more than 30 seconds, any subsequent communication from the remote host will re-establish remote control mode again.
Enables or disables the reader access keypads.
Sets the super passwords for a door. The super passwords enable keypad access without a card and the controllers provide for up to 4 super passwords to be assigned individually to each door managed by a controller.
Sets the interlocking between doors, with support for the following operational modes:
disabled
doors 1&2
doors 3&4
doors 1&2 and 3&4
doors 1&2&3
doors 1&2&3&4
Resets the controller to the default manufacturer configuration.
Establishes a 'listening' UDP connection to receive events from a controller (or multiple controller) and invokes a callback function to process each received event.