Skip to content

Run hidtest for no more than 10 seconds when no hid_read data#440

Merged
Youw merged 1 commit intomasterfrom
hidtest
Aug 14, 2022
Merged

Run hidtest for no more than 10 seconds when no hid_read data#440
Youw merged 1 commit intomasterfrom
hidtest

Conversation

@Youw
Copy link
Member

@Youw Youw commented Aug 13, 2022

Avoid infinite reading from the device if the device doesn't send any interrupt reports.
Otherwise hidtest has to be stopped by Ctrl+C interruption, which doesn't give a chance to close the device properly,
as a result this has negative side-effects when using LIBUSB backed.

Avoid infinite reading from the device if the device doesn't send any interrupt reports.
Otherwise hidtest has to be stopped by Ctrl+C interruption, which doesn't give a chance to close the device properly,
as a result this has negative side-effects when using LIBUSB backed.
@Youw
Copy link
Member Author

Youw commented Aug 13, 2022

As a follow-up from the previous conversation, @Julusian may I ask you to try running libusb backand before hidraw and check if kernel driver is reattached properly?
Don't use Ctrl+C, just wait 5 seconds for the hidtest to run.

@mcuee, same request to you.

Thanks.

@mcuee mcuee added the Example Related to hidtest or new examples label Aug 14, 2022
@mcuee
Copy link
Member

mcuee commented Aug 14, 2022

@Youw

The change to hidtest is good to have so that user do not need to hit CTRL-C.

But somehow the kernerl driver does not seem to re-attach.

mcuee@UbuntuSwift3:~/build/hidapi_pr440/build$ ./hidtest/hidtest_libusb 
hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 04d8 003f
  path: 3-2.3:1.0
  serial_number: (null)
  Manufacturer: Microchip Technology Inc.
  Product:      Simple HID Device Demo
  Release:      2
  Interface:    0
  Usage (page): 0x0 (0x0)

Device Found
  type: 16c0 05dc
  path: 3-1:1.1
  serial_number: 0001
  Manufacturer: www.fischl.de
  Product:      USBasp
  Release:      110
  Interface:    1
  Usage (page): 0x0 (0x0)

Manufacturer String: Microchip Technology Inc.
Product String: Simple HID Device Demo
Serial Number String: (1033) 
Device Found
  type: 04d8 003f
  path: 3-2.3:1.0
  serial_number: (null)
  Manufacturer: Microchip Technology Inc.
  Product:      Simple HID Device Demo
  Release:      2
  Interface:    0
  Usage (page): 0x1 (0xff00)

Indexed String 1: Microchip Technology Inc.
Unable to send a feature report.
Unable to get a feature report: hid_error is not implemented yet
waiting...
waiting...
waiting...
waiting...
waiting...
waiting...
waiting...
waiting...
waiting...
waiting...
read() timeout

mcuee@UbuntuSwift3:~/build/hidapi_pr440/build$ ./hidtest/hidtest_hidraw 
hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 16c0 05dc
  path: /dev/hidraw1
  serial_number: 0001
  Manufacturer: www.fischl.de
  Product:      USBasp
  Release:      110
  Interface:    1
  Usage (page): 0x1 (0xff00)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0x1)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x5 (0xd)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0xe (0xd)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xff00)

unable to open device

Copy link
Member

@mcuee mcuee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is good to have.

Copy link
Member

@mcuee mcuee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though it does not sort out the kernel driver re-attach issue (probably another issue to sort out), this chage itself is good to have.

@Youw
Copy link
Member Author

Youw commented Aug 14, 2022

thanks

@Youw Youw merged commit c3ae3d0 into master Aug 14, 2022
@Youw Youw deleted the hidtest branch August 14, 2022 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Example Related to hidtest or new examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments