diff --git a/qmk-cmd.go b/qmk-cmd.go index 021a619..5b8c2c4 100644 --- a/qmk-cmd.go +++ b/qmk-cmd.go @@ -286,9 +286,15 @@ func setCfg(dev *QEncDevice, cfg QEncCfg, val uint8) (err error) { func sendDataWrapper(dev *QEncDevice, data []byte, cmd QEncCmd, id uint32) (ret []byte, err error) { if err = dev.Open(); err != nil { + if QEncInfoHandler != nil { + QEncInfoHandler(err.Error()) + } return nil, err } if err = dev.Lock(); err != nil { + if QEncInfoHandler != nil { + QEncInfoHandler(err.Error()) + } return nil, err } defer dev.Close()