Skip to content

Commit

Permalink
fix: assign write event + remove infinte call
Browse files Browse the repository at this point in the history
  • Loading branch information
Cartermel committed May 23, 2024
1 parent abbb565 commit 98ee2ad
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gatts_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ func (a *Adapter) AddService(s *Service) error {
char.Handle.value = char.Value
char.Handle.valueMtx = &sync.Mutex{}
char.Handle.flags = char.Flags
char.Handle.writeEvent = char.WriteEvent
goChars[uuid] = char.Handle
}
}
Expand Down Expand Up @@ -244,10 +245,6 @@ func (c *Characteristic) Write(p []byte) (n int, err error) {
return 0, nil // nothing to do
}

if c.writeEvent != nil {
c.writeEvent(0, 0, p)
}

// writes are only actually processed on read events from clients, we just set a variable here.
c.valueMtx.Lock()
defer c.valueMtx.Unlock()
Expand Down

0 comments on commit 98ee2ad

Please sign in to comment.