Skip to content

Commit 4fab810

Browse files
committed
Source was not checked when querying by index.
1 parent 02aaa40 commit 4fab810

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

cmd/deviceparameter/deviceparameter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import "github.com/thinnect/go-devparam"
2020

2121
const ApplicationVersionMajor = 0
2222
const ApplicationVersionMinor = 2
23-
const ApplicationVersionPatch = 0
23+
const ApplicationVersionPatch = 1
2424

2525
var ApplicationBuildDate string
2626
var ApplicationBuildDistro string

deviceparameters.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,15 @@ func (self *DeviceParameterManager) waitValueSeqnum(seqnum uint8) (*DeviceParame
277277
select {
278278
case packet := <-self.receive:
279279
payload := packet.GetPayload()
280+
281+
if self.destination != 0 {
282+
msg, ok := packet.(*moteconnection.Message)
283+
if !ok || msg.Source() != self.destination {
284+
self.Debug.Printf("Ignoring packet %s\n", packet)
285+
payload = nil
286+
}
287+
}
288+
280289
if len(payload) > 0 {
281290
if payload[0] == DP_PARAMETER {
282291
p := new(DpParameter)

0 commit comments

Comments
 (0)