Skip to content

Commit

Permalink
Included device serial number in FindDeviceRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
twystd committed Aug 13, 2020
1 parent 01108d4 commit 661525e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## IN PROGRESS

- [x] unit test for config.Write
- [x] MQTT CommandV
- [ ] get-device with serial number
- [x] MQTT Command
- [x] get-device with serial number

## TODO

Expand Down
3 changes: 2 additions & 1 deletion messages/find_devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
)

type FindDevicesRequest struct {
MsgType types.MsgType `uhppote:"value:0x94"`
MsgType types.MsgType `uhppote:"value:0x94"`
SerialNumber types.SerialNumber `uhppote:"offset:4"`
}

type FindDevicesResponse struct {
Expand Down
4 changes: 3 additions & 1 deletion uhppote/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ func (u *UHPPOTE) FindDevices() ([]types.Device, error) {
}

func (u *UHPPOTE) FindDevice(serialNumber uint32) (*types.Device, error) {
request := messages.FindDevicesRequest{}
request := messages.FindDevicesRequest{
SerialNumber: types.SerialNumber(serialNumber),
}
replies := []messages.FindDevicesResponse{}

if err := u.DirectedBroadcast(serialNumber, request, &replies); err != nil {
Expand Down

0 comments on commit 661525e

Please sign in to comment.