- dynamic endpoints are done
[barry.git] / README
blobd947c15503ec1062e69d78cfb957ff43460289b9
2 *****************************************************************************
3 *  CAUTION: This is alpha software.  Please make complete backups of your   *
4 *           Blackberry device before experimenting.  While the author has   *
5 *           had good success with this software, that is no guarantee that  *
6 *           you will.  Please make backups.                                 *
7 *****************************************************************************
9 Introduction:
10 -------------
11 Barry is a GPL C++ library to interface with USB BlackBerry handheld devices
12 on Linux.  This is one of Net Direct Inc.'s (http://www.netdirect.ca/)
13 open source projects.
15 The SourceForge project page can be found at:
16         http://sourceforge.net/projects/barry/
18 Barry is currently in early development, but is reaching stages of usefulness.
19 For example, it is possible to retrieve Address Book contact data, and export
20 it in text or LDAP LDIF format.
23 Installation:
24 -------------
25 You need:
26         libusb, devel branch    http://libusb.sourceforge.net/
27         boost 1.33 (optional)   http://www.boost.org/
30 Boost:
32 Boost is needed for the serialization library, which you need if you want
33 to save downloads for later uploads to the device.
35 Libusb:
37 Check out the 2005/11/26 V1_0_DEVEL tag/branch from CVS, or download it
38 as a tarball from the Barry file download page.
40 Barry uses the asynchronous library calls, which is why the development
41 branch is used.  The libusb devel branch is well along in its development
42 cycle, so don't be afraid to play with it.
44 This version of Barry has been tested using the 2005/11/26 libusb CVS tree.
46 To build Barry:
48         - Edit Makefile.conf to point to the proper location for libusb
49                 headers and library files
50         - Enter the src/ directory and type 'make'
51         - If you want to generate doxygen documentation, run 'doxygen'
52                 as well.  The resulting files will be in doc/doxygen/html/
53                 This has been tested with Doxygen 1.4.5
55 This will give you a command line tool called 'btool'.  Use the -h
56 switch for help on its command line options.  Some good ones to start with
57 are -l to list the devices found, and -t to list the Database Database.
60 BlackBerry protocol:
61 --------------------
62 No BlackBerry-related protocol project would be complete without referencing
63 the fine documentation from the Cassis project, which tackled the earlier
64 serial protocol.  You can find this documentation at:
66         http://off.net/cassis/protocol-description.html
68 There were some major and minor differences found between the serial
69 protocol and the USB protocol.  Some of the new handheld devices use new
70 database record access commands, and in these cases the record format changes.
71 See the code for more detailed information.
73 Further documentation on the USB protocol is planned.  Stay tuned.
76 Playing with the protocol:
77 --------------------------
78 The USB captures were performed on a Windows XP Pro system running UsbSnoop
79 from http://benoit.papillault.free.fr/usbsnoop/index.php
81 You can use the convo.awk and translate.cc tools to turn these very verbose
82 logs into something more manageable.  Other than the normal USB control
83 commands at the beginning of each conversation, it was found that only
84 USB Bulk Transfers were used.
86 The btool utility is at the stage where it can be used instead of UsbSnoop,
87 for database operations.  You can use the -v switch to turn on data packet
88 dumping, which will display the sent and received packets in canonical hex
89 format as btool talks to the device.  You can use this in combination with
90 the -d switch to capture new database records to reverse engineer.
92 If you reverse engineer some of the unimplemented packet formats, please
93 send patches and/or documentation to the mailing list!
95 See the Hacking file for more information on getting started reverse
96 engineering the protocol.
99 Some notes on code architecture:
100 --------------------------------
102 Lowest level:
103         Lowest level is the libusb software, currently using the DEVEL branch
105 USB layer:
106         usbwrap.{h,cc}          - C++ wrapper for libusb
107         data.{h,cc}             - C++ data class for buffer management
108                                   and hex log file input and output
109         connect.cc              - low level USB test program, capable of
110                                   using data file scripts to talk to a
111                                   device via bulk read/write
112         debug.h                 - general debugging output support
115 Barry low level layer:
116         protostructs.h          - low level, packed structs representing the
117                                   USB protocol
118         time.{h,cc}             - time conversions between 1900-based minutes
119                                   and C's 1970-based time_t
122 Barry API layer:
123         base64.{h,cc}           - base64 encoding and decoding (for LDIF)
124         builder.h               - C++ virtual wrappers to connect record and
125                                   controller in a generic way
126         error.{h,cc}            - common exception classes for Barry layer
127         probe.{h,cc}            - USB probe class to find Blackberry devices
128         protocol.{h,cc}         - structs and defines for packets seen on wire
129         common.{h,cc}           - general API and utilities
130         socket.{h,cc}           - socket class encapsulating the Blackberry
131                                   logical socket
132         record.{h,cc}           - programmer-friendly record classes
133         parser.{h,cc}           - C++ virtual wrappers to connect record
134                                   and controller in a generic way
135         controller.{h,cc}       - high level API class
136         s11n-boost.h            - serialization functions for record.h classes
138         barry.h                 - application header (only one needed)
141 Misc utilities:
142         btool.cc                - command line testing utility
143         convo.awk               - script to convert UsbSnoop log files into
144                                   trimmed-down request/response conversations
145         translate.cc            - translate UsbSnoop log file data into
146                                   hex+ascii dumps
148 Enjoy!
150 December 2005