Compile and execute the HID stub driver

This section explains how to compile and execute hid-joystick-stub.c.

To compile hid-joystick-stub.c, run:
qcc -V gcc_ntoaarch64le -o hid-joystick-stub hid-joystick-stub.c -lhiddi
Once you've copied hid-joystick-stub.c to the target device, and you're logged in as the root user, you can execute the driver in the same directory that it was copied to using the following example:
# ./hid-joystick-stub
Looking for device ffffffff ffffffff
Device inserted...
Device Address       : 0
Vendor               : 0x046d (USB Optical Mouse)
Product              : 0xc077 (USB Optical Mouse)
Serial Number        : 
Version              : r2.00
Input report found, NUM_Buttons 11
Device inserted...
Device Address       : 1
Vendor               : 0x413c ()
Product              : 0x2113 (Dell KB216 Wired Keyboard)
Serial Number        : 
Version              : r1.10
Device inserted...
Device Address       : 2
Vendor               : 0x413c ()
Product              : 0x2113 (Dell KB216 Wired Keyboard)
Serial Number        : 
Version              : r1.10
Device inserted...
Device Address       : 3
Vendor               : 0x046d (F0A2F28F)
Product              : 0xc216 (F0A2F28F)
Serial Number        : F0A2F28F
Version              : r2.00
Input report found, NUM_Buttons 32
Device inserted...
Device Address       : 4
Vendor               : 0x2d1f (ISD-V4)
Product              : 0x0156 (ISD-V4)
Serial Number        : 
Version              : r2.01
Device inserted...
Device Address       : 5
Vendor               : 0x2575 (CoolTouch® System)
Product              : 0x0915 (CoolTouch® System)
Serial Number        : 
Version              : r2.00
Device inserted...
Device Address       : 6
Vendor               : 0x0b05 ()
Product              : 0x19c1 ()
Serial Number        : 
Version              : r2.00
Once running, ensure a gamepad is attached to the target device and press a few buttons. Observe the output, which demonstrates the consumption and processing of the HID reports.:
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Pressed :0x2 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Released :0x2 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Pressed :0x4 
x= -3 y=  0 
x= -6 y=  0 
x= -4 y=  0 
x= -4 y=  0 
x= -3 y=  0 
x= -2 y=  0 
x= -3 y=  0 
x= -2 y=  0 
x= -3 y=  0 
x= -3 y=  0 
x= -3 y=  0 
x= -6 y=  0 
x= -5 y=  0 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Released :0x4 
x= -5 y=  0 
x= -5 y=  0 
x= -5 y=  0 
x= -3 y=  0 
x= -2 y=  0 
x= -1 y=  0 
x= -2 y=  0 
x= -2 y=  0 
x= -1 y=  1 
x= -2 y=  0 
x= -1 y=  0 
x= -1 y=  0 
x= -2 y=  2 
x= -3 y=  0 
x= -4 y=  1 
x= -1 y=  0 
x= -4 y=  1 
x= -4 y=  1 
x= -8 y=  2 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Pressed :0x1 
x= -9 y=  2 
x=-13 y=  5 
x=-13 y=  5 
x= -9 y=  5 
x= -6 y=  5 
x= -1 y=  1 
x=  0 y=  2 
x= -1 y=  0 
x= -1 y=  0 
x= -1 y=  0 
x= -3 y=  2 
x= -1 y=  0 
x= -1 y=  1 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Released :0x1 
x= -1 y=  1 
x=  0 y=  1 
x=  0 y=  1 
x=  0 y=  1 
x= -1 y=  1 
x= -1 y=  2 
x= -2 y=  1 
x= -1 y=  0 
x= -1 y=  1 
x= -1 y=  0 
x= -1 y=  0 
x= -1 y=  1 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Pressed :0x3 
x= -1 y=  0 
x= -1 y=  1 
x= -1 y=  1 
x= -1 y=  0 
x= -1 y=  0 
x= -1 y=  1 
x= -2 y=  1 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Released :0x3 
x= -1 y=  1 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Pressed :0x1 
x= -1 y=  1 
x= -1 y=  1 
x= -2 y=  0 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Released :0x1 
x= -1 y=  1 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Pressed :0x4 
x= -1 y=  1 
x= -1 y=  1 
x= -4 y=  3 
x= -1 y=  0 
x= -3 y=  1 
x= -1 y=  1 
x= -2 y=  2 
x=-128 y=127 Absolute Hatswitch= -8 Absolute Scaled Hatswitch= 56 Absolute RZ=127
Buttons Released :0x4 
x= -2 y=  1 
Page updated: