From: R0b0t1 <r030t1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Roderick Colenbrander
<thunderbird2k-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-input <linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: UHID Device Reports Do Not Generate OS Activity
Date: Sun, 11 Feb 2018 14:22:04 -0600 [thread overview]
Message-ID: <CAAD4mYio0Ke__0WM15J1yVWwWYeaJSGHUebJOupTkRe9uqou-w@mail.gmail.com> (raw)
In-Reply-To: <CAEc3jaAyQiNDLbOvNkT65n-Vju-LOHjoSuiOqDunBFna0YDaBQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Sun, Feb 11, 2018 at 1:46 PM, Roderick Colenbrander
<thunderbird2k-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> It is hard to say what is wrong. I would start with reading the uhid /
> hid code and see where you are getting stuck (and double check uhid
> docs). Even for others we would need to do that as it is not easy to
> see what is wrong.
>
The issue was that the device is not immediately able to give input to
userspace programs after being opened by the kernel.
Waiting 32ms (2 timeslices?) gives a 100% success rate, with 16ms
having a 50% success rate. Checking modern kernel sources timeslices
may no longer be 16ms.
> I'm not sure what your goal is obvious you want to simulate a keyboard
> for some purpose, but do you really need to operate at the HID layer?
> If not it is much more convenient to use uinput, which will create a
> evdev device for you.
>
My kernel was not originally compiled with uinput. I used uhid to
avoid rebooting. (I have since rebooted and ended 199 days of uptime.)
There were other reasons for doing it this way, one of them being that
I am going to be prototyping an HID device. A software model will
help. I also wanted more control of the keystrokes initially to see if
it would be necessary to maintain that control.
It might be best to switch to uinput, but once you have USB
descriptors USB is actually very simple.
Cheers,
R0b0t1
> Thanks,
> Roderick
>
> On Sat, Feb 10, 2018 at 1:33 AM, R0b0t1 <r030t1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Hello,
>>
>> I am trying to simulate a keyboard using the uhid interface. The fake
>> device shows up in dmesg, but attempting to press the "a" key does
>> nothing I can see. No input appears in the active terminal, nor in an
>> xev window.
>>
>> The program receives UHID_OPEN, UHID_START, and UHID_CLOSE.
>>
>> Many different report descriptors were tried. The one currently
>> uncommented is the one distributed with the USB implementor forum's
>> HID report descriptor tool. The other is one found in a description of
>> a boot device compatible keyboard.
>>
>> Thanks in advance,
>> R0b0t1
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2018-02-11 20:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-10 9:33 UHID Device Reports Do Not Generate OS Activity R0b0t1
2018-02-11 19:46 ` Roderick Colenbrander
[not found] ` <CAEc3jaAyQiNDLbOvNkT65n-Vju-LOHjoSuiOqDunBFna0YDaBQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-11 20:22 ` R0b0t1 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAD4mYio0Ke__0WM15J1yVWwWYeaJSGHUebJOupTkRe9uqou-w@mail.gmail.com \
--to=r030t1-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=thunderbird2k-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).