forked from Elara6331/infinitime
Clarify DFU debug logs
This commit is contained in:
parent
a832c16d69
commit
9f0ee67c0f
4
dfu.go
4
dfu.go
@ -313,7 +313,7 @@ func (dfu *DFU) Reset() {
|
|||||||
// on waits for the given command to be received on
|
// on waits for the given command to be received on
|
||||||
// the control point characteristic, then runs the callback.
|
// the control point characteristic, then runs the callback.
|
||||||
func (dfu *DFU) on(cmd []byte, onCmdCb func(data []byte) error) error {
|
func (dfu *DFU) on(cmd []byte, onCmdCb func(data []byte) error) error {
|
||||||
log.Debug().Hex("expecting", cmd).Msg("Waiting for command")
|
log.Debug().Hex("expecting", cmd).Msg("Waiting for DFU command")
|
||||||
// Use for loop in case of invalid property
|
// Use for loop in case of invalid property
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
@ -328,7 +328,7 @@ func (dfu *DFU) on(cmd []byte, onCmdCb func(data []byte) error) error {
|
|||||||
log.Debug().
|
log.Debug().
|
||||||
Hex("expecting", cmd).
|
Hex("expecting", cmd).
|
||||||
Hex("received", data).
|
Hex("received", data).
|
||||||
Msg("Received command")
|
Msg("Received DFU command")
|
||||||
// If command has prefix of given command
|
// If command has prefix of given command
|
||||||
if bytes.HasPrefix(data, cmd) {
|
if bytes.HasPrefix(data, cmd) {
|
||||||
// Return callback with data after command
|
// Return callback with data after command
|
||||||
|
Loading…
Reference in New Issue
Block a user