Skip to content

Commit

Permalink
Add first version
Browse files Browse the repository at this point in the history
Add first version implementing single string descriptor retrieval,
parsing and output.
  • Loading branch information
spbnick committed Sep 22, 2013
0 parents commit 90a9615
Show file tree
Hide file tree
Showing 6 changed files with 419 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.o
.deps
/aclocal.m4
/autom4te.cache
/config.h
/config.h.in
/config.log
/config.status
/configure
/depcomp
/huion-probe
/install-sh
/missing
/stamp-h1
Makefile
Makefile.in
22 changes: 22 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (C) 2013 Nikolai Kondrashov
#
# This file is part of huion-probe.
#
# Huion-probe is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Huion-probe is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with huion-probe; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

dist_noinst_SCRIPTS = bootstrap
dist_doc_DATA = README.md
bin_PROGRAMS = huion-probe
huion_probe_SOURCES = huion-probe.c
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Huion-probe
===========

Huion-probe is an utility retrieving and displaying parameters of Huion
graphics tablets, while at the same time enabling proprietary mode.

Installation
------------

Requirements:

* libusb >= 1.0

Libusb development packages are usually named `libusb-dev` or `libusb-devel`.

To build from a distribution tarball the usual `./configure && make`
is sufficient.

To build from the Git tree autotools are required and `./bootstrap &&
./configure && make` is sufficient.

To install huion-probe, use `make install`.

Usage
-----

Huion-probe accepts two arguments: bus number and device address. You can find
them in `lsusb` output by looking for a device with vendor ID 256c and product
ID 006e.

For example, in this `lsusb` output:

Bus 001 Device 003: ID 256c:006e
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The first line corresponds to a Huion tablet, and so its bus number is 1,
device address is 3 and you probe it like this:

huion-probe 1 3

The output will be something like this:

RAW

00 7D 20 4E 03 00 FF 07 A0 0F 08 00 00 00 00 00

DECODED

Max X: 32000
Max Y: 20000
Max pressure: 2047
Resolution: 4000
27 changes: 27 additions & 0 deletions bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
#
# Copyright (c) 2013 Nikolai Kondrashov
#
# This file is part of huion-probe.
#
# Huion-probe is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Huion-probe is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with huion-probe; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# Fail on any error
set -e

aclocal
autoheader
automake --add-missing --copy
autoconf
54 changes: 54 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Copyright (C) 2013 Nikolai Kondrashov
#
# This file is part of huion-probe.
#
# Usbhid-dump is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Usbhid-dump is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with usbhid-dump; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT([huion-probe], [1])
AM_INIT_AUTOMAKE([1.9 -Wall foreign])
AM_MAINTAINER_MODE
AC_CONFIG_HEADER([config.h])

# Check for programs.
AC_PROG_CC
AC_PROG_INSTALL

# Check for libraries.
PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.0)
CFLAGS="$CFLAGS $LIBUSB_CFLAGS"
LIBS="$LIBS $LIBUSB_LIBS"

# Check for features
AC_ARG_ENABLE(
debug,
AS_HELP_STRING([--enable-debug], [enable debugging features]),
[], [enable_debug="no"])

# Output features to preprocessor and compiler
if test "$enable_debug" = "yes"; then
CPPFLAGS="$CPPFLAGS -UNDEBUG"
CFLAGS="$CFLAGS -Wall -Wextra -Werror -g -O0"
fi

# Check for library functions.
AC_CHECK_FUNCS(libusb_strerror)

# Output
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
Loading

0 comments on commit 90a9615

Please sign in to comment.