Open / Closing device added to sendData
This commit is contained in:
parent
90ae4ac116
commit
3556fedfdd
|
@ -285,8 +285,13 @@ func setCfg(dev *QEncDevice, cfg QEncCfg, val uint8) (err error) {
|
|||
}
|
||||
|
||||
func sendDataWrapper(dev *QEncDevice, data []byte, cmd QEncCmd, id uint32) (ret []byte, err error) {
|
||||
dev.Lock()
|
||||
defer dev.UnLock()
|
||||
if err = dev.Open(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err = dev.Lock(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer dev.Close()
|
||||
|
||||
done := make(chan bool)
|
||||
msgc := make(chan string)
|
||||
|
|
Loading…
Reference in New Issue