I did some more USB capture and was able to decode the Live mode packets;
they contain only x/y/pressure data. bytes 0-1 contain some ID info
(they're always 02 00), byte 2 is normally 0xa1, but appears to change to
0xa2 to indicate the start of a stroke. byte 3 is the size of the message
area in bytes, and bytes 4-end contain up to 3 6-byte messages. The
messages encode ushort values for x, y, and pressure, and are in the form [
x_low | x_high | y_low | y_high | p_low | p_high ]. A ff:ff:ff:ff:ff:ff
message is sent to indicate stroke stop.
I started looking into Sync mode and the structure of the data being
transmitted, but the actual drawing content appears to be
compressed/encoded in some way. So I decided to dig into the InkSpace
binary and realized it's all written in JavaScript, and the communication
layer appears to be totally unobfuscated. So we basically have all the info
we need to do anything with these new tablets laid out for us in plain
text. The relevant code (from v1.0.29) can be found here:
https://drive.google.com/file/d/0B8PMEPBxi1PpNzVMbFotTWJnaTA .
On Sat, Jan 28, 2017 at 2:14 PM, Edward Kaszubski <ekaszub...@gmail.com>
wrote:
> Hi all,
>
> My girlfriend recently purchased the PTH-660P (Intuos Pro Paper Edition,
> Medium variant) and nothing worked out-of-the-box in linux.
>
> I went ahead and captured some USB data using wireshark in Windows for
> most of the tasks I could think of; let me know if you want any of the
> capture files:
> - First plug-in/probe
> - Pro Pen 2 tip/eraser/buttons
> - ExpressKeys (they have both capacititive and click data)
> - TouchRing
> - TouchRing LED toggle via center button
> - Multitouch (up to 10 fingers tested, and HID data says only 10 are
> supported)
> - Touch enable/disable switch
> - Paper mode (no pen/cursor data is transmitted in this mode; the tablet
> just records what you draw)
> - Sync paper-mode drawings with InkSpace app (the InkSpace app appears to
> ping the tablet every few seconds; if a new drawing is available, the
> tablet sends it over endpoint 0x82)
> - Live mode (tablet streams paper-mode data to InkSpace app; what you draw
> on paper shows up on-screen, but only in InkSpace app; sent over endpoint
> 0x82 just like paper sync)
>
> Based on the above, I was able to tweak linux-wacom to add support for:
> - Pen
> - Touchpad
> - Touch ring
> - ExpressKeys (both capacititive and click)
>
> Before I submit a patch and/or work on extra features, I just wanted to
> ensure I'm following the relevant guidelines and standards.
>
> These new Intuos Pro tablets are PTH-660/860 (medium, large) and
> PTH-660P/860P (medium and large paper edition), whereas the last generation
> are PTH-451/651/851 (small, medium, large). They have some quirks that do
> not appear to be handled by any of the current device types, and the paper
> editions have extra features that need to be handled separately.
>
> In terms of naming, I added new INTUOSP2<M/L>[P] (e.g. INTUOSP2MP) enum
> entries and wacom_status_ip2_irq, wacom_ip2_touch, wacom_ip2_touch_msg
> functions (where ip2 = intuos pro 2). I also added WACOM_PKGLEN_IP2,
> WACOM_BYTES_PER_IP2_PACKET, WACOM_REPORT_IP2_USB, WACOM_REPORT_IP2_TOUCH,
> WACOM_HID_DG_CONTACTMAX.
>
> The PTH-660P sends touch events over endpoint 0x85, and
> pen/touchring/buttons/status over 0x81. So similar to BAMBOO_PAD, I'm
> setting the type to something specific, then in wacom_parse_and_register, I
> use pktlen to differentiate between the two endpoints, and override the
> type of endpoint 0x81 to be HID_GENERIC. Also similar to BAMBOO_PAD, I
> added a quirk to set device_type to WACOM_DEVICETYPE_TOUCH.
>
> The HID_GENERIC type picks up the pen, ring, and non-capacititive buttons
> (the cap buttons have usage 0x950 instead of 0x940, so I added an extra
> case for that and they work)
>
> The HID entry for CONTACTMAX is 0xFF000055 instead of 0x000D0055 so I
> added an extra case to detect it.
>
> The touch packets are similar to the bpt3 packets, but they encode up to 5
> 8-byte messages in a fixed-length 44-byte packet instead of 7 8-byte
> messages. Additionally, when there are more than five touches, two packets
> are sent, with the second packet encoding touches 6-10. Due to this
> difference, I created functions wacom_ip2_touch and wacom_ip2_touch_msg
> based on the bpt3 versions but specific to ip2.
>
> Do these changes sound reasonable at a high level? Please let me know so I
> can submit a cleaner patch. Thanks!
>
> - Edward
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel