= #!wiki
- #!wiki
= \cat [libdlusb.]
= =! libdlusb Wiki
= #^--bnotice--$#</p><div style="border:1px solid black; background-color:white; color:black; padding:5px;"><p>
= #^--enotice--$#</p></div><p>
= #^TAG([0-9]+)$#<a id="tag\1"></a>
=
= --bnotice--
= DO NOT WRITE ABOVE THIS NOTICE!
=
= This is a Wiki page for [libdlusb.]. You can improve this page by adding your idea or comments.
=
= Please read [wiki_rule. Wiki Rules] for formatting syntax.
= --enotice--
=
= TOC
=
= = Usage
=
= libdlusb supports the following basic ROM apps: CONTACT, NOTE, APPT, ALARM, SCHEDULE, OCCASION, CHRONO, COUNTDN, INTERVAL (interval timer). Each app has three commands: print_, add_, del_. First, you may want to try print_ to list all the information on the watch. You don't need any option for that. If you want to save data, redirect its output to a file:
= ---
= print_contact > contact.dat
= ---
=
= In that way, you can restore data with del_/add_ command. The format of contact.dat is very simple, so you can easily add additional data. Uploading data from contact.dat is done as follows:
= ---
= del_contact -a # first delete all info on the watch
= add_contact < contact.dat # add data
= ---
=
= You can add/delete an individual data with options (add_contact -h displays all available options):
= ---
= add_contact msg=msg type=CO area=123 number=456-7890
= del_contact msg=msg type=CO area=123 number=456-7890
= ---
=
= All these actions should be performed with the watch attached to USB. Now, there are *_dlusb/*_dlusb.sh commands:
=
= {dump_dlusb} downloads memory (ROM/EEPROM/app data) images (binary data).
=
= {init_dlusb} initializes the watch with text data (e.g., contact.dat above) or dump_dlusb'ed data (-b option).
=
= {load_dlusb} overwrites data in the watch with dump_dlusb'ed binary data.
=
= {lock_dlusb} locks/unlocks apps.
=
= {option_dlusb} displays/sets various options.
= - save the current options: ""option_dlusb > option.dat""
= - restore options: ""option_dlusb < option.dat""
= -
=
= You can edit option.dat by hand. The format is simple text file.
= -
=
= {sysinfo_dlusb} prints system information.
=
= {tod_dlusb} is used for setting time/time zone/display formats.
=
= {init_dlusb.sh} helps the user initialize the watch. It uses ~/.dlusbrc. Read dlusbrc file for more detail. Note: This is different from the compiled utility init_dlusb above. This is the shell script you want to run first to initialize the watch and add the wristapps that are listed in ~/.dlusbrc at the end, and which you have downloaded and expanded into your ~/usr/dlusb/wristapp/ directory.
=
= {sync_dlusb.sh} syncs time with the PC and downloads all data from the watch.
=
= {note_to_contact.sh} Since the watch doesn't allow the user to enter contact info on it, I use Note app to add contact data and convert/add it to Contact app later when sync_dlusb.sh'ing.
= -
=
= If you want to add external WristApps, I recommend you to use ~/.dlusbrc and init_dlusb.sh. Since the watch deletes all memory and re-adds applications and data everytime you add even one WristApp, you need init_dlusb.sh.
=
= = FAQ
=
= ``I've successfully compiled libdlusb programs, but they don't seem to work at all.``
=
= Make sure that you have a proper permission to use USB devices (read/write permission on USB related device files). On Ubuntu Breezy at least you will have this problem. A quick check is to try one of the commands with a sudo prepended to it, for example:
= ---
= $ libdlusb-0.0.9c$ sudo sysinfo_dlusb
= ---
=
= If you get a dozen lines or so of information about the state of your watch, it is working. If you have this problem with permissions and don't use sudo, or run the programs at root, you will get lines like this:
= ---
= $ sysinfo_dlusb
= open_dev (74 in usb_libusb.c): usb_claim_interface
= main (66 in sysinfo_dlusb.c): open_dev
= close_dev (89 in usb_libusb.c): usb_release_interface"
= ---
=
= Have a look at the following posts in the group mailing list if you are using hotplug scripts.
=
= - http://groups.yahoo.com/group/timexdatalinkusbdevelop/message/235
= - http://ubuntuforums.org/archive/index.php/t-262.html
= -
=
= If you are using udev (which is a newer thing used for example in Ubuntu Dapper Drake), then you need to add a rule for udev in /etc/udev/rules.d/
=
= I made a file there called 10-timex.rules.
=
= It must have the .rules extension, and the lower number you put in front of the filename, the earlier its rules are executed. My file contains this:
=
= ---
= # udev rules file for libdlusb
= # Timex Datalink USB Watch
= BUS=="usb", SYSFS{idVendor}=="0cc2", SYSFS{idProduct}=="d700", GROUP="plugdev"
= ---
=
= Then you need to restart udev. On Ubuntu Dapper you execute
=
= ---
= $ /etc/init.d/udev restart
= ---
=
= The program udevmonitor may help you debug.
=
= ``On Debian, I get a "libusb-config: command not found" message during "make install".``
=
= Install the libusb-dev package.
=
= ``On Mac OS X, I don't get any data from the watch.``
=
= You may need to implement a codeless kext to prevent IOUSBHIDDriver from matching with the watch so that libusb may access the watch.
=
= Otherwise, run the following command in the Terminal application to unload the Mac OS X USB driver.
=
= ---
= $ sudo kextunload -b com.apple.iokit.IOUSBHIDDriver
= ---
=
= This kext may not completely unload if another kext depends on it. Otherwise, it may be reloaded with the following command in the Terminal application.
=
= ---
= $ sudo kextload -b com.apple.iokit.IOUSBHIDDriver
= ---
=