Commit 4983223a authored by DreamSourceLab's avatar DreamSourceLab
Browse files

update INSTALL process and firmware files

parent c71404a3
{
{
"Device": "DSCope",
"DeviceMode": 1,
"Horizontal trigger position": "0",
......
No preview for this file type
{
{
"Device": "DSLogic",
"DeviceMode": 0,
"Filter Targets": "None",
......
No preview for this file type
......@@ -4,118 +4,74 @@ INSTALL
Requirements
------------
libsigrok4DSL
- git
- gcc (>= 4.0)
- g++
- make
- libtool
- autoconf >= 2.63
- automake >= 1.11
- cmake >= 2.6
- Qt >= 5.0
- libtool
- pkg-config >= 0.22
This is part of the standard OpenBSD install (not an extra package), apparently.
- libglib >= 2.32.0
- libzip >= 0.10
- libusb-1.0 >= 1.0.16
On FreeBSD, this is an integral part of the FreeBSD libc, not an extra package/library.
This is part of the standard OpenBSD install (not an extra package), apparently.
- check >= 0.9.4 (optional, only needed to run unit tests)
DSLgoic-gui
- git
- g++
- make
- libtool
- pkg-config >= 0.22
- cmake >= 2.6
- libglib >= 2.28.0
- Qt >= 4.5
- libboost >= 1.42 (including the following libs):
- libboost-system
- libboost-thread
- libsigrok4DSL >= 0.2.0
- pkg-config >= 0.22
This is part of the standard OpenBSD install (not an extra package), apparently.
- check >= 0.9.4 (optional, only needed to run unit tests)
Building and installing
-----------------------
Get the DSView source code from: www.dreamsourcelab.com/download.html
Step1: Build libusbx-1.0.18
Building:
$ cd libusbx-1.0.18
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
Step1: Installing the requirements:
Step2: Build libsigrok4DSL
please check your respective distro's package manager tool if you use other distros
Debian/Ubuntu:
$ sudo apt-get install git-core gcc g++ make autoconf automake libtool pkg-config \
libglib2.0-dev libzip-dev libudev-dev libusb-1.0-0-dev \
python3-dev qt5-default libboost-dev libboost-test-dev libboost-thread-dev libboost-system-dev check
Installing the requirements:
Fedora (18, 19):
$ sudo yum install git gcc g++ make autoconf automake libtool pkgconfig glib2-devel \
libzip-devel libudev-devel libusb1-devel \
python3-devel qt-devel boost-devel check
Example on Debian/Ubuntu (please check your respective distro's package manager tool if you use other distros):
$ sudo apt-get install git-core gcc make autoconf automake libtool pkg-config \
libglib2.0-dev libzip-dev libudev-dev libasound2-dev check
Arch:
$ pacman -S git gcc make autoconf autoconf-archive automake libtool \
pkg-config glib2 glibmm libzip libusb check
python boost qt5 qt5-base qt5-svg
Fedora (18, 19):
$ sudo yum install git gcc make autoconf automake libtool pkgconfig glib2-devel \
libzip-devel libudev-devel alsa-lib-devel check
Step2: Get the DSView source code
OpenSuSE (12.2):
$ zypper install git gcc make autoconf automake libtool pkg-config glib2-devel \
libzip-devel libudev-devel alsa-devel check
$ clone git://github.com/DreamSourceLab/DSView
Building:
Step3: Building
$ cd libsigrok4DSL
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ cd ..
$ git clone git://sigrok.org/libsigrokdecode
$ cd libsigrokdecode
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ cd ..
Step3: Build libsigrokdecode
Installing the requirements:
Example on Debian/Ubuntu (please check your respective distro's package manager tool if you use other distros):
$ sudo apt-get install git-core gcc make autoconf automake libtool pkg-config libglib2.0-dev python3-dev
Fedora (18, 19, 20):
$ sudo yum install git gcc make autoconf automake libtool pkgconfig glib2-devel python3-devel check-devel
Building:
$ git clone git://sigrok.org/libsigrokdecode
$ cd libsigrokdecode
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
Step4: Build DSView
Installing the requirements:
Example on Debian/Ubuntu (please check your respective distro's package manager tool if you use other distros):
$ sudo apt-get install git-core g++ make cmake libtool pkg-config \
libglib2.0-dev libqt4-dev libboost-dev libboost-test-dev libboost-thread-dev libboost-system-dev
Fedora (18, 19):
$ sudo yum install git gcc cmake libtool pkgconfig glib2-devel \
boost-devel qt-devel boost-devel
Building:
$ cd DSView
$ cmake .
$ make
$ sudo make install
$ cd DSView
$ cmake .
$ make
$ sudo make install
See the following wiki page for more (OS-specific) instructions:
......
Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>
Copyright © 2010-2012 Peter Stuge <peter@stuge.se>
Copyright © 2008-2013 Nathan Hjelm <hjelmn@users.sourceforge.net>
Copyright © 2009-2013 Pete Batard <pete@akeo.ie>
Copyright © 2009-2013 Ludovic Rousseau <ludovic.rousseau@gmail.com>
Copyright © 2010-2012 Michael Plante <michael.plante@gmail.com>
Copyright © 2011-2013 Hans de Goede <hdegoede@redhat.com>
Copyright © 2012-2013 Martin Pieuchot <mpi@openbsd.org>
Copyright © 2012-2013 Toby Gray <toby.gray@realvnc.com>
Other contributors:
Alan Ott
Alan Stern
Alex Vatchenko
Andrew Fernandes
Anthony Clay
Artem Egorkine
Aurelien Jarno
Bastien Nocera
Bei Zhang
Benjamin Dobell
Chris Dickens
Colin Walters
Dave Camarillo
David Engraf
David Moore
Davidlohr Bueso
Federico Manzan
Felipe Balbi
Florian Albrechtskirchinger
Francesco Montorsi
Francisco Facioni
Graeme Gill
Gustavo Zacarias
Hans Ulrich Niedermann
Hector Martin
Hoi-Ho Chan
Ilya Konstantinov
James Hanko
Joshua Blake
Karsten Koenig
Konrad Rzepecki
Kuangye Guo
Lars Wirzenius
Luca Longinotti
Martin Koegler
Matthias Bolte
Mike Frysinger
Mikhail Gusarov
Moritz Fischer
Nicholas Corgan
Omri Iluz
Orin Eman
Paul Fertser
Pekka Nikander
Rob Walker
Sean McBride
Sebastian Pipping
Simon Haggett
Thomas Röfer
Tim Roberts
Toby Peterson
Trygve Laugstøl
Uri Lublin
Vasily Khoruzhick
Vegard Storheil Eriksen
Vitali Lovich
Xiaofan Chen
Zoltán Kovács
Роман Донченко
xantares
This diff is collapsed.
For detailed information about the changes below, please see the git log or
visit: http://log.libusbx.org
2014-01-25: v1.0.18 *FINAL RELEASE*
* Last release of libusbx, as the project is merging back again with libusb.
As a result, continuation of the project will now occur from the following:
o Main site: http://libusb.info
o Git repository: https://github.com/libusb/libusb
o SF repository: https://sourceforge.net/projects/libusb/
o Mailing list: libusb-devel@lists.sourceforge.net (registration req.)
* Fix multiple memory leaks
* Fix a crash when HID transfers return no data on Windows
* Ensure all pending events are consumed
* Improve Android and ucLinux support
* Multiple Windows improvements (error logging, VS2013, VIA xHCI support)
* Multiple OS X improvements (broken compilation, SIGFPE, 64bit support)
2013-09-06: v1.0.17
* Hotplug callbacks now always get passed a libusb_context, even if it is
the default context. Previously NULL would be passed for the default context,
but since the first context created is the default context, and most apps
use only 1 context, this meant that apps explicitly creating a context would
still get passed NULL
* Android: Add .mk files to build with the Android NDK
* Darwin: Add Xcode project
* Darwin: Fix crash on unplug (#121)
* Linux: Fix hang (deadlock) on libusb_exit
* Linux: Fix libusbx build failure with --disable-udev (#124)
* Linux: Fix libusb_get_device_list() hang with --disable-udev (#130)
* OpenBSD: Update OpenBSD backend with support for control transfers to
non-ugen(4) devices and make get_configuration() no longer generate I/O.
Note that using this libusbx version on OpenBSD requires using
OpenBSD 5.3-current or later. Users of older OpenBSD versions are advised
to stay with the libusb shipped with OpenBSD (mpi)
* Windows: fix libusb_dll_2010.vcxproj link errors (#129)
* Various other bug fixes and improvements
The (#xx) numbers are libusbx issue numbers, see ie:
https://github.com/libusbx/libusbx/issues/121
2013-07-11: v1.0.16
* Add hotplug support for Darwin and Linux (#9)
* Add superspeed endpoint companion descriptor support (#15)
* Add BOS descriptor support (#15)
* Make descriptor parsing code more robust
* New libusb_get_port_numbers API, this is libusb_get_port_path without
the unnecessary context parameter, libusb_get_port_path is now deprecated
* New libusb_strerror API (#14)
* New libusb_set_auto_detach_kernel_driver API (#17)
* Improve topology API docs (#95)
* Logging now use a single write call per log-message, avoiding log-message
"interlacing" when using multiple threads.
* Android: use Android logging when building on Android (#101)
* Darwin: make libusb_reset reenumerate device on descriptors change (#89)
* Darwin: add support for the LIBUSB_TRANSFER_ADD_ZERO_PACKET flag (#91)
* Darwin: add a device cache (#112, #114)
* Examples: Add sam3u_benchmark isochronous example by Harald Welte (#109)
* Many other bug fixes and improvements
The (#xx) numbers are libusbx issue numbers, see ie:
https://github.com/libusbx/libusbx/issues/9
2013-04-15: v1.0.15
* Improve transfer cancellation and avoid short read failures on broken descriptors
* Filter out 8-bit characters in libusb_get_string_descriptor_ascii()
* Add WinCE support
* Add library stress tests
* Add Cypress FX3 firmware upload support for fxload sample
* Add HID and kernel driver detach support capabilities detection
* Add SuperSpeed detection on OS X
* Fix bInterval value interpretation on OS X
* Fix issues with autoclaim, composite HID devices, interface autoclaim and
early abort in libusb_close() on Windows. Also add VS2012 solution files.
* Improve fd event handling on Linux
* Other bug fixes and improvements
2012-09-26: v1.0.14
* Reverts the previous API change with regards to bMaxPower.
If this doesn't matter to you, you are encouraged to keep using v1.0.13,
as it will use the same attribute as v2.0, to be released soon.
* Note that LIBUSBX_API_VERSION is *decreased* to 0x010000FF and the previous
guidelines with regards to concurrent use of MaxPower/bMaxPower still apply.
2012-09-20: v1.0.13
* [MAJOR] Fix a typo in the API with struct libusb_config_descriptor where
MaxPower was used instead of bMaxPower, as defined in the specs. If your
application was accessing the MaxPower attribute, and you need to maintain
compatibility with libusb or older versions, see APPENDIX A below.
* Fix broken support for the 0.1 -> 1.0 libusb-compat layer
* Fix unwanted cancellation of pending timeouts as well as major timeout related bugs
* Fix handling of HID and composite devices on Windows
* Introduce LIBUSBX_API_VERSION macro
* Add Cypress FX/FX2 firmware upload sample, based on fxload from
http://linux-hotplug.sourceforge.net
* Add libusb0 (libusb-win32) and libusbK driver support on Windows. Note that while
the drivers allow it, isochronous transfers are not supported yet in libusbx. Also
not supported yet is the use of libusb-win32 filter drivers on composite interfaces
* Add support for the new get_capabilities ioctl on Linux and avoid unnecessary
splitting of bulk transfers
* Improve support for newer Intel and Renesas USB 3.0 controllers on Windows
* Harmonize the device number for root hubs across platforms
* Other bug fixes and improvements
2012-06-15: v1.0.12
* Fix a potential major regression with pthread on Linux
* Fix missing thread ID from debug log output on cygwin
* Fix possible crash when using longjmp and MinGW's gcc 4.6
* Add topology calls: libusb_get_port_number(), libusb_get_parent() & libusb_get_port_path()
* Add toggleable debug, using libusb_set_debug() or the LIBUSB_DEBUG environment variable
* Define log levels in libusb.h and set timestamp origin to first libusb_init() call
* All logging is now sent to to stderr (info was sent to stdout previously)
* Update log messages severity and avoid polluting log output on OS-X
* Add HID driver support on Windows
* Enable interchangeability of MSVC and MinGW DLLs
* Additional bug fixes and improvements
2012-05-08: v1.0.11
* Revert removal of critical Windows event handling that was introduced in 1.0.10
* Fix a possible deadlock in Windows when submitting transfers
* Add timestamped logging
* Add NetBSD support (experimental) and BSD libusb_get_device_speed() data
* Add bootstrap.sh alongside autogen.sh (bootstrap.sh doesn't invoke configure)
* Search for device nodes in /dev for Android support
* Other bug fixes
2012-04-17: v1.0.10
* Public release
* Add libusb_get_version
* Add Visual Studio 2010 project files
* Some Windows code cleanup
* Fix xusb sample warnings
2012-04-02: v1.0.9
* First libusbx release
* Add libusb_get_device_speed (all, except BSD) and libusb_error_name
* Add Windows support (WinUSB driver only)
* Add OpenBSD support
* Add xusb sample
* Tons of bug fixes
2010-05-07: v1.0.8
* Bug fixes
2010-04-19: v1.0.7
* Bug fixes and documentation tweaks
* Add more interface class definitions
2009-11-22: v1.0.6
* Bug fixes
* Increase libusb_handle_events() timeout to 60s for powersaving
2009-11-15: v1.0.5
* Use timerfd when available for timer management
* Small fixes/updates
2009-11-06: v1.0.4 release
* Bug fixes including transfer locking to fix some potential threading races
* More flexibility with clock types on Linux
* Use new bulk continuation tracking in Linux 2.6.32 for improved handling
of short/failed transfers
2009-08-27: v1.0.3 release
* Bug fixes
* Add libusb_get_max_iso_packet_size()
2009-06-13: v1.0.2 release
* Bug fixes
2009-05-12: v1.0.1 release
* Bug fixes
* Darwin backend
2008-12-13: v1.0.0 release
* Bug fixes
2008-11-21: v0.9.4 release
* Bug fixes
* Add libusb_attach_kernel_driver()
2008-08-23: v0.9.3 release
* Bug fixes
2008-07-19: v0.9.2 release
* Bug fixes
2008-06-28: v0.9.1 release
* Bug fixes
* Introduce contexts to the API
* Compatibility with new Linux kernel features
2008-05-25: v0.9.0 release
* First libusb-1.0 beta release
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
APPENDIX A - How to maintain code compatibility with versions of libusb and
libusbx that use MaxPower:
If you must to maintain compatibility with versions of the library that aren't
using the bMaxPower attribute in struct libusb_config_descriptor, the
recommended way is to use the new LIBUSBX_API_VERSION macro with an #ifdef.
For instance, if your code was written as follows:
if (dev->config[0].MaxPower < 250)
Then you should modify it to have:
#if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x01000100)
if (dev->config[0].bMaxPower < 250)
#else
if (dev->config[0].MaxPower < 250)
#endif
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip
ACLOCAL_AMFLAGS = -I m4
DISTCLEANFILES = libusb-1.0.pc
EXTRA_DIST = TODO PORTING msvc libusb/libusb-1.0.def libusb/version_nano.h \
examples/getopt/getopt.c examples/getopt/getopt1.c examples/getopt/getopt.h \
android Xcode
SUBDIRS = libusb doc
if BUILD_EXAMPLES
SUBDIRS += examples
endif
if BUILD_TESTS
SUBDIRS += tests
endif
pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA=libusb-1.0.pc
.PHONY: dist-up
reldir = .release/$(distdir)
dist-up: dist
rm -rf $(reldir)
mkdir -p $(reldir)
cp $(distdir).tar.bz2 $(reldir)
rsync -rv $(reldir) frs.sourceforge.net:/home/frs/project/l/li/libusb/libusb-1.0/
rm -rf $(reldir)
For the latest libusbx news, please refer to the ChangeLog file, or visit:
http://libusbx.org
PORTING LIBUSBX TO OTHER PLATFORMS
Introduction
============
This document is aimed at developers wishing to port libusbx to unsupported
platforms. I believe the libusbx API is OS-independent, so by supporting
multiple operating systems we pave the way for cross-platform USB device
drivers.
Implementation-wise, the basic idea is that you provide an interface to
libusbx's internal "backend" API, which performs the appropriate operations on
your target platform.
In terms of USB I/O, your backend provides functionality to submit
asynchronous transfers (synchronous transfers are implemented in the higher
layers, based on the async interface). Your backend must also provide
functionality to cancel those transfers.
Your backend must also provide an event handling function to "reap" ongoing
transfers and process their results.
The backend must also provide standard functions for other USB operations,
e.g. setting configuration, obtaining descriptors, etc.
File descriptors for I/O polling
================================
For libusbx to work, your event handling function obviously needs to be called
at various points in time. Your backend must provide a set of file descriptors
which libusbx and its users can pass to poll() or select() to determine when
it is time to call the event handling function.
On Linux, this is easy: the usbfs kernel interface exposes a file descriptor
which can be passed to poll(). If something similar is not true for your
platform, you can emulate this using an internal library thread to reap I/O as
necessary, and a pipe() with the main library to raise events. The file
descriptor of the pipe can then be provided to libusbx as an event source.
Interface semantics and documentation
=====================================
Documentation of the backend interface can be found in libusbi.h inside the
usbi_os_backend structure definition.
Your implementations of these functions will need to call various internal
libusbx functions, prefixed with "usbi_". Documentation for these functions
can be found in the .c files where they are implemented.
You probably want to skim over *all* the documentation before starting your
implementation. For example, you probably need to allocate and store private
OS-specific data for device handles, but the documentation for the mechanism
for doing so is probably not the first thing you will see.
The Linux backend acts as a good example - view it as a reference
implementation which you should try to match the behaviour of.
Getting started
===============
1. Modify configure.ac to detect your platform appropriately (see the OS_LINUX
stuff for an example).
2. Implement your backend in the libusb/os/ directory, modifying
libusb/os/Makefile.am appropriately.
3. Add preprocessor logic to the top of libusb/core.c to statically assign the
right usbi_backend for your platform.
4. Produce and test your implementation.
5. Send your implementation to libusbx-devel mailing list.
Implementation difficulties? Questions?
=======================================
If you encounter difficulties porting libusbx to your platform, please raise
these issues on the libusbx-devel mailing list. Where possible and sensible, I
am interested in solving problems preventing libusbx from operating on other
platforms.
The libusbx-devel mailing list is also a good place to ask questions and
make suggestions about the internal API. Hopefully we can produce some
better documentation based on your questions and other input.
You are encouraged to get involved in the process; if the library needs
some infrastructure additions/modifications to better support your platform,
you are encouraged to make such changes (in cleanly distinct patch
submissions). Even if you do not make such changes yourself, please do raise
the issues on the mailing list at the very minimum.
libusbx
=======
libusbx is a library for USB device access from Linux, Mac OS X,
Windows and OpenBSD/NetBSD userspace, with OpenBSD/NetBSD, and to a
lesser extent some of the newest features of Windows (such as libusbK
and libusb-win32 driver support) being EXPERIMENTAL.
It is written in C and licensed under the GNU Lesser General Public
License version 2.1 or, at your option, any later version (see COPYING).
libusbx is abstracted internally in such a way that it can hopefully
be ported to other operating systems. Please see the PORTING file
for more information.
libusbx homepage:
http://libusbx.org/
Developers will wish to consult the API documentation:
http://api.libusbx.org
Use the mailing list for questions, comments, etc:
http://mailing-list.libusbx.org
- Pete Batard <pete@akeo.ie>
- Hans de Goede <hdegoede@redhat.com>
- Xiaofan Chen <xiaofanc@gmail.com>
- Ludovic Rousseau <ludovic.rousseau@gmail.com>
- Nathan Hjelm <hjelmn@users.sourceforge.net>
(Please use the mailing list rather than mailing developers directly)
Please see the libusbx roadmap by visiting:
https://github.com/libusbx/libusbx/issues/milestones?direction=asc&sort=due_date
\ No newline at end of file
//
// libusbx Xcode configuration file
// Copyright © 2012 Pete Batard <pete@akeo.ie>
// For more information, please visit: <http://libusbx.org>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
// libusbx does not follow C99 strict aliasing rules, so disable it.
GCC_STRICT_ALIASING = NO
// Use C99 dialect.
GCC_C_LANGUAGE_STANDARD = c99
// Compiler warnings.
CLANG_WARN_EMPTY_BODY = YES
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_UNINITIALIZED_AUTOS = YES
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES
GCC_WARN_SHADOW = YES
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES
GCC_WARN_ABOUT_MISSING_NEWLINE = YES
GCC_WARN_UNKNOWN_PRAGMAS = YES
GCC_WARN_UNUSED_FUNCTION = YES
GCC_WARN_UNUSED_LABEL = YES
GCC_WARN_UNUSED_VARIABLE = YES
/* config.h. Manually generated for Xcode. */
/* Default visibility */
#define DEFAULT_VISIBILITY /**/
/* Message logging */
#define ENABLE_LOGGING 1
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the <poll.h> header file. */
#define HAVE_POLL_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Darwin backend */
#define OS_DARWIN 1
/* type of second poll() argument */
#define POLL_NFDS_TYPE nfds_t
/* Use POSIX Threads */
#define THREADS_POSIX 1
/* Use GNU extensions */
#define _GNU_SOURCE 1
//
// libusbx Xcode configuration file
// Copyright © 2012 Pete Batard <pete@akeo.ie>
// For more information, please visit: <http://libusbx.org>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "common.xcconfig"
// Embed debug symbols in binary itself.
DEBUG_INFORMATION_FORMAT = dwarf
// No optimizations in debug.
GCC_OPTIMIZATION_LEVEL = 0
//
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1
//
// libusbx Xcode configuration file
// Copyright © 2012 Pete Batard <pete@akeo.ie>
// For more information, please visit: <http://libusbx.org>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
// For backwards compatibility with libusb, use the same filename.
PRODUCT_NAME = libusb-1.0.0
This diff is collapsed.
//
// libusbx Xcode configuration file
// Copyright © 2012 Pete Batard <pete@akeo.ie>
// For more information, please visit: <http://libusbx.org>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "debug.xcconfig"
#include "libusbx.xcconfig"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment