mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
fix
This commit is contained in:
parent
460bd9b159
commit
f9ebb1a77e
2 changed files with 2 additions and 4 deletions
|
@ -208,7 +208,6 @@ func (mod *HIDRecon) forceStop() error {
|
|||
return mod.SetRunning(false, func() {
|
||||
if mod.dongle != nil {
|
||||
mod.dongle.Close()
|
||||
mod.dongle = nil
|
||||
mod.Debug("device closed")
|
||||
}
|
||||
})
|
||||
|
@ -218,7 +217,6 @@ func (mod *HIDRecon) Stop() error {
|
|||
mod.waitGroup.Wait()
|
||||
if mod.dongle != nil {
|
||||
mod.dongle.Close()
|
||||
mod.dongle = nil
|
||||
mod.Debug("device closed")
|
||||
}
|
||||
})
|
||||
|
|
|
@ -27,7 +27,7 @@ func (mod *HIDRecon) doHopping() {
|
|||
mod.channel = 1
|
||||
}
|
||||
if err := mod.dongle.SetChannel(mod.channel); err != nil {
|
||||
if err == gousb.ErrorNoDevice {
|
||||
if err == gousb.ErrorNoDevice || err == gousb.TransferStall {
|
||||
mod.Error("device disconnected, stopping module")
|
||||
mod.forceStop()
|
||||
return
|
||||
|
@ -114,7 +114,7 @@ func (mod *HIDRecon) Start() error {
|
|||
|
||||
buf, err := mod.dongle.ReceivePayload()
|
||||
if err != nil {
|
||||
if err == gousb.ErrorNoDevice {
|
||||
if err == gousb.ErrorNoDevice || err == gousb.TransferStall {
|
||||
mod.Error("device disconnected, stopping module")
|
||||
mod.forceStop()
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue