Skip to content

Commit

Permalink
Preparing for v0.7.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
twystd committed Jan 26, 2022
1 parent eae86aa commit 58a77ee
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
go-version: ^1.17
id: go

- name: Check out code into the Go module directory
Expand Down
146 changes: 121 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Supported operating systems:

| *Version* | *Description* |
| --------- | ----------------------------------------------------------------------------------------- |
| v0.7.2 | Replaced event rollover with simple indexes to match controller behaviour |
| v0.7.1 | Added support for task list functions from the extended API |
| v0.7.0 | Added support for time profiles from the extended API |
| v0.6.12 | Improved handling of concurrent requests and invalid responses |
Expand Down Expand Up @@ -53,39 +54,38 @@ go build -o bin ./...

| *Dependency* | *Description* |
| ----------------------------------- | ------------------------------------------------------ |
| golang.org/x/lint/golint | Additional *lint* check for release builds |
| | |

## API

- [`GetDevices`](#getdevices)
- [`GetDevice`](#getdevice)
- SetAddress
- GetListener
- SetListener
- GetTime
- SetTime
- GetDoorControlState
- SetDoorControlState
- RecordSpecialEvents
- GetStatus
- GetCards
- GetCardById
- GetCardByIndex
- PutCard
- DeleteCard
- DeleteCards
- GetTimeProfile
- SetTimeProfile
- ClearTimeProfiles
- [`SetAddress`](#setaddress)
- [`GetListener`](#getlistener)
- [`SetListener`](#setlistener)
- [`GetTime`](#gettime)
- [`SetTime`](#settime)
- [`GetDoorControlState`](#getdoorcontrolstate)
- [`SetDoorControlState`](#setdoorcontrolstate)
- [`RecordSpecialEvents`](#recordspecialevents)
- [`GetStatus`](#getstatus)
- [`GetCards`](#getcards)
- [`GetCardById`](#getcardbyid)
- [`GetCardByIndex`](#getcardbyindex)
- [`PutCard`](#putcard)
- [`DeleteCard`](#deletecard)
- [`DeleteCards`](#deletecards)
- [`GetTimeProfile`](#gettimeprofile)
- [`SetTimeProfile`](#settimeprofile)
- [`ClearTimeProfiles`](#cleartimeprofiles)
- [`ClearTaskList`](#cleartasklist)
- [`AddTask`](#addtask)
- [`RefreshTaskList`](#refreshtasklist)
- SetTaskList
- GetEvent
- GetEventIndex
- SetEventIndex
- OpenDoor
- Listen
- [`GetEvent`](#getevent)
- [`GetEventIndex`](#geteventindex)
- [`SetEventIndex`](#seteventindex)
- [`OpenDoor`](#opendoor)
- [`Listen`](#listen)

Other than `GetDevices` API which specifically uses UDP broadcast to issue a request, the API will uses the configured controller IP address if possible, falling back to a broadcast request if necessary.

Expand All @@ -97,6 +97,78 @@ Retrieves a list of all UHPPOTE controllers that respond to a broadcast `get-dev

Retrieves the controller information for a specific UHPPOTE controller from the response to a `get-device` request.

#### `SetAddress`

Sets the IPv4 address, subnet mask and gateway address for a controller.

#### `GetListener`

Retrieves the IPv4 address of the host configured to receive events from the controller.

#### `SetListener`

Sets the IPv4 address of the host to receive events from the controller.

#### `GetTime`

Retrieves the controller date and time.

#### `SetTime`

Sets the controller date and time.

#### `GetDoorControlState`

Retrieves a door control state (`normally open`, `normally closed` or `controlled`) from the controller.

#### `SetDoorControlState`

Sets a door control state (`normally open`, `normally closed` or `controlled`) on the controller.

#### `RecordSpecialEvents`

Enables or disables the door and relay events on a controller.

#### `GetStatus`

Retrieves the controller current status.

#### `GetCards`

Retrieves the number of cards stored on a controller.

#### `GetCardByID`

Retrieves a stored card's information using the card number.

#### `GetCardByIndex`

Retrieves a stored card's information using an index into the card list.

#### `PutCard`

Adds or updates a card record on the controller.

#### `DeleteCard`

Deletes a card record from the controller.

#### `DeleteCards`

Deletes all card records from the controller.

#### `GetTimeProfile`

Retrieves a numbered time profile from the controller.

#### `SetTimeProfile`

Adds or updates a numbered time profile on the controller.

#### `ClearTimeProfiles`

Deletes all stored time profiles from a controller.

#### `ClearTaskList`

Clears the scheduled task list on a specific UHPPOTE controller, preparatory to using `AddTask` and `RefreshTask`.
Expand All @@ -109,5 +181,29 @@ Adds a scheduled task to the task list on a specific UHPPOTE controller. The tas

Activates all tasks added by `AddTask`.

#### `GetEvent`

Retrieves a single stored event (by index) from the controller.

#### `GetEventIndex`

Retrieves the current value of the controller event index (typically used as a marker for events
that have been retrieved).

#### `SetEventIndex`

Sets the current value of the controller event index (typically used to update the marker for events
that have been retrieved).

#### `OpenDoor`

Unlocks a door remotely.

#### `Listen`

Establishes a 'listening' UDP connection to receive events from a controller (or multiple controller) and invokes
a callback function to process each received event.




8 changes: 4 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
## v0.7.x
## v0.7.2

### IN PROGRESS

- [x] Remove _rollover_

## TODO

- [ ] Fix DateTime Unmarshal to set nanos etc to 0
- [ ] (?)EventNotFoundError
- [ ] (?)EventOverwrittenError
Expand All @@ -17,9 +20,6 @@
- [ ] See if there's anything worth taking from CloudFlare blog post on UDP:
https://blog.cloudflare.com/everything-you-ever-wanted-to-know-about-udp-sockets-but-were-afraid-to-ask-part-1/


## TODO

- [ ] Implement separate Get..All functions (??)
- [ ] Add https://odi.ch/weblog/posting.php?posting=731 to cookbook
- [ ] (?) Rename types.Time to types.DeviceTime
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/uhppoted/uhppote-core

go 1.16
go 1.17

2 changes: 1 addition & 1 deletion uhppote/uhppote.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/uhppoted/uhppote-core/types"
)

var VERSION string = "v0.7.x"
var VERSION string = "v0.7.2"

type driver interface {
Broadcast([]byte, *net.UDPAddr) ([][]byte, error)
Expand Down

0 comments on commit 58a77ee

Please sign in to comment.