Bug 10394 - Creation of component to emulate keyboard with USB-KM232
Summary: Creation of component to emulate keyboard with USB-KM232
Status: RESOLVED FIXED
Alias: None
Product: Runtime Testing
Classification: QA/Testing
Component: general (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: High enhancement
Target Milestone: 2.3 M1
Assignee: Jair Gonzalez
QA Contact: Benjamin Esquivel
URL:
Whiteboard:
Depends on:
Blocks: devauto
  Show dependency tree
 
Reported: 2016-10-07 16:00 UTC by Jair Gonzalez
Modified: 2016-12-12 23:29 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
USBKM232 Manual (2.42 MB, application/pdf)
2016-10-07 16:11 UTC, Jair Gonzalez
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jair Gonzalez 2016-10-07 16:00:21 UTC
A remote keyboard input emulator is required to provide a library for sending keyboard inputs to a remote device. Inputs can be single keystrokes, key combinations or key sequences.
Comment 1 Jair Gonzalez 2016-10-07 16:11:29 UTC
Created attachment 3460 [details]
USBKM232 Manual
Comment 2 Plauchu Edwin 2016-10-07 16:49:12 UTC
Created a first approach of this library.
Such approach includes

* Dynamic loading of kbemulator module as per model.
* Written USB-KM232 kbemulator module.
* Written USB-KM232 mock module. (This matter is created with purposes of integration with other platforms "for instance AFT").
Comment 3 Plauchu Edwin 2016-10-07 16:56:02 UTC
https://www.youtube.com/watch?v=NKmDMSdVzG8 <-- Keyboard emulator video (DEMO)

This video shows how kbemulator  library is interacting with jed editor.
Comment 4 Jair Gonzalez 2016-10-07 20:05:20 UTC
I received a functional library package from benjamin.esquivel@intel.com after being integrated with https://bugzilla.yoctoproject.org/show_bug.cgi?id=10395 and https://bugzilla.yoctoproject.org/show_bug.cgi?id=10396. I'm currently working on a PoC using them with an actual device in order to test and document their functionality and integration.
Comment 5 Jair Gonzalez 2016-12-01 21:45:27 UTC
The Proof of Concept was executed successfully and the devauto library was able to control an USBKM232 device to emulate a keyboard and send a keystroke sequence to 1 MinnowBoard DUT. However, in its current form , the KBEMUControl class doesn't provide any option to select a different USB serial port, and the port auto detection method in the usbkm232 module is restricted to the default USB product and vendor id.

To be able to use the library to control more than 1 device, it's necessary to add a port configuration option in the control class and provide it as an argument to the selected hardware layer.
Comment 6 Benjamin Esquivel 2016-12-01 21:53:46 UTC
reopened for working on the scaling of more than 1 controlling device.
Comment 7 Jair Gonzalez 2016-12-07 02:05:00 UTC
A patch has been submitted to enhance the kbemu sub-package. Now the KBEMUControl class accepts any keyword arguments and passes them to the constructor of the dynamically loaded device class. Then the device class uses them to configure itself accordingly. This change makes possible to select a device by port with the ‘conn_tty’ parameter, or to autodetect it by using ‘usbpid_tty’ and ‘usbvid_tty’ parameters. In addition, the serial port parameter values could also be set if required.

I tested the changes by sequentially controlling and submitting a keystroke sequence to two different hardware keyboard emulators, to two instances of kbemutest and to one of each type.
Comment 8 Benjamin Esquivel 2016-12-07 17:04:30 UTC
Jair, can you include a link to the mail archive where you sent the review?
Comment 9 Benjamin Esquivel 2016-12-07 17:06:01 UTC
(In reply to comment #8)
> Jair, can you include a link to the mail archive where you sent the review?
Please disregard my message. This repo is pending publishing.
Comment 10 Benjamin Esquivel 2016-12-12 23:29:04 UTC
Merged at the devauto repo which is pending publishing.