Index . 블로그창고 . Any comments?

\cat datalink, software cat: libdlusb

Timex Data Link USB Library

libdlusb
dlusb
Installation
libusb
usbhid
Initialization
Tips
Updating TEXT data
Retrieving weather data from NOAA
Change log
Bug report
Contribution

libdlusb

DISCLAIMER

This software can cause severe damage to your Timex Data Link USB watch. Use at your own risk.

Since July 16, 2005 by Huidae Cho

libdlusb/libdlusb-0.0.12.tar.gz 1/5/2010

libdlusb is a library used to communicate with the Timex Data Link USB watch on various UN*X operating systems. The library can be built with two USB libraries: libusb (OS-independent USB library) and usbhid (USB HID library for *BSD).

With release of version 0.0.9, the library provides several utilities that are useful for backup and sync. I think I've implemented almost everything I need except for a neat GUI PIMS, which is not my field. You are very welcome if interested in starting a PIMS project. Finally, Andy wrote a nice GUI counterpart!

Some of the main features are as follows:

dlusb

libdlusb/dlusb.tar.gz

dlusb is a set of utilities to create database files for some WristApps.

Installation

libusb

  1. Create Makefile. The configure script generates Makefile for libusb 0.1.12 support by default:
    ./configure --prefix=$HOME
    
    For libusb 1.0.6, add --with-libusb1:
    ./configure --with-libusb1 --prefix=$HOME
    
  2. Build and install the library and utilities:
    make install
    

Now you have libdlusb.a and several test programs. If you want a shared library, add the --enable-shared option to configure (./configure --enable-shared) and run make.

NOTE: Under *BSD, install the libusb port from /usr/ports/devel/libusb and unload the uhid kernel module or disable it from the kernel config.

usbhid

This applies only to *BSD.

  1. As root, you need to add the following lines into the kernel config (/usr/src/sys/i386/conf/MYKERNEL) to support USB and HID:
    device	uhci
    device	ohci
    device	ehci
    device	usb
    device	ugen
    device	uhid
    
  2. Recompile the kernel and reboot:
    cd /usr/src
    make kernel KERNCONF=MYKERNEL
    reboot
    
  3. Configure libdlusb with usbhid support:
    ./configure --with-usbhid --prefix=$HOME
    
  4. Build and install the library and utilities:
    make install
    
  5. Use /dev/uhid0 for the device file. If it doesn't work, you can see which file is linked with the watch by tailing /var/log/message while attaching/detaching the watch (tail -f /var/log/message).

That's it! Add --enable-shared option to configure (./configure --with-usbhid --enable-shared) to build a shared library.

NOTE: When you switch between the two USB libraries, make sure to delete an old library (make clean; rm -f libdlusb.*; ./configure ...).

Initialization

For WristApps, libdlusb uses banners in EEPROM to identify what application to use for data manipulation while it uses an internal name for ROM based modes. The problem is that some WristApps have a different banner than its *.app file name. To work around this problem, init_dlusb stores *.app file name (except ".app") in the banner database and *_dlusb programs will use this name instead of what is displayed in the watch. For example, the tetris (WATRIS) has WAtris.app file and "TRIS" is shown when it's selected. The user may not know what banner will be displayed, WATRIS or something else, before actually running it. However, no matter what banners the watch actually uses, libdlusb will recognize its *.app file name, which is saved by init_dlusb.

For this method to work, you need to reinitialize the watch using init_dlusb since the original PIMS does not do anything regarding this problem. There are 16 slots, but two are already reserved for the system (TOD and COMM), which means that one can install up to 14 applications.

If you've installed the library correctly, you can find the configuration file ~/.dlusbrc. The structure of $dlusb_dir directory is as follows:

You can set three time zone informations with $tod_* variables and $apps has a list of application names that you want to install. Note that the OPTION has an equal sign "=" at the end to specify that the mode does not have any database to upload/download. If *.app file name is given, the corresponding WristApp will be installed with its database, if any. An application can be locked by prepending a dot "." to the name like the following:

apps="
        Calendar.app
        .contact
        .note
        .appt
        schedule
        occasion
        text.app
        SciCalc.app
        gas.app
        WAtris.app
        alarm
        chrono
        countdn
        option=
"

CONTACT, NOTE, and APPT will be locked.

All *_dlusb.sh scripts assume that an internal application has a data file whose name is the application name followed by ".txt" and all the characters are in lower case (e.g., CONTACT has $dlusb_dir/contact.txt file).

Tips

Updating TEXT data

I'm using txt2wa.sh and txt2wa to periodically update the content of TEXT. The following alias will help you easily make $dlusb_dir/wristapp/text_dbase_018.bin up to date: alias watxt='vi ~/usr/dlusb/text.txt; txt2wa.sh ~/usr/dlusb/text.txt'.

Retrieving weather data from NOAA

dlusb.tar.gz includes weather2txt.sh to obtain weather information from NOAA. It will be called by txt2wa.sh when $weather is set to 1. With crontab, you can update weather on a daily basis.

Change log

0.0.12 - January 5, 2010
  • libusb 1.0.6 support.
0.0.11 - January 2, 2010
  • Chrono workout year fixed.
0.0.10 - July 17, 2009
  • Chrono header fixed.
  • dlusbrc, tod_dlusb.sh, and init_dlusb.sh updated.
0.0.10rc4 - July 13, 2009
  • tod_dlusb.sh, print_chrono_report, and export_chrono_csv added (Michael Stone).
  • full support for three timezones in tod_dlusb (Andrew Barry).
  • KNOWN BUG: Chrono header should be fixed!
0.0.10rc3 - May 14, 2009
  • Chrono database header fixed.
  • sync id not updated if the watch memory is not modified.
  • unused_* modules added to change the number of unused records.
  • print_* modules do not modify the watch memory anymore.
  • tod_dlusb relative time setting (tz[1-3] and adjust) fixed.
  • init_dlusb.sh bug fixed that didn't accept spaces in tz strings.
  • unused Chrono records overflow fixed.
  • init_dlusb now sets options and supports unused records for each application (Andy's idea).
  • {read,update,scan,create}_raw_option routines added.
0.0.9c - October 18, 2005
  • $wristapp_dir removed.
  • $preprocess and $postprocess added.
  • note_to_contact.sh improved.
  • backup_dlusb.sh renamed to sync_dlusb.sh.
  • -f option added to init_dlusb to display *.app file name for all WristApp banners (useful for ModeBrowser).
0.0.9b - October 6, 2005
  • print_note/appt/alarm automatically sorts data whenver it runs.
  • sorting bug fixed.
0.0.9a - October 3, 2005
  • lock_dlusb added to lock/unlock modes.
  • TODO comments clean up.
0.0.9 - October 2, 2005
  • load_dlusb added to upload binary data to the watch.
  • WristApp databases supported by dump_dlusb/load_dlusb.
  • WristApp banner handling improved.
0.0.8b - September 30, 2005
  • add_contact() sort improved.
  • adjust option added to tod_dlusb.
0.0.8a - September 29, 2005
  • add/del_schedule() bug fixed.
  • sort routine improved.
  • Occasion sort bug fixed.
0.0.8 - September 25, 2005
  • init_dlusb.sh script added to demonstrate how initialization works.
  • set_tod renamed to tod_dlusb and improved to support all three time zones.
  • sysinfo_dlusb added to display system information.
  • option_dlusb added to retrieve/restore Option data.
  • Chronograph, Countdown timer, and Interval timer support added. All documented internal applications are supported!
  • WristApp install bug fixed.
0.0.7 - September 24, 2005
  • Schedule support added.
  • set_tod.c compile bug fixed.
0.0.6 - September 19, 2005
  • primary TOD support added.
  • Appointment, Alarm, and Occasion support added.
  • the format of options to add/delete data changed.
  • syncid_dlusb added to check the last sync id.
  • init_dlusb improved to initialize external applications.
  • init/dump renamed to init_dlusb/dump_dlusb.
0.0.5c - September 10, 2005
  • add_contact()/del_contact() bug fixed.
  • note_to_contact.sh format changed.
0.0.5b - July 27, 2005
  • usb_detach_kernel_driver_np bug fixed: we didn't need to detach the kernel driver again after the first run.
0.0.5a - July 27, 2005
  • Note database dump bug fixed.
0.0.5 - July 26, 2005
  • add/delete from file added.
  • many bugs fixed.
0.0.4 - July 24, 2005
  • add/delete Note/Contact data implemented.
  • Note/Contact data structure completed.
  • libusb support added.
  • configure script added.
  • dl renamed to libdlusb.
0.0.3 - July 21, 2005
  • usbhid code separated to support non-native FreeBSD USB libraries.
0.0.2 - July 17, 2005
  • not released.
  • major bug fixed.
0.0.1 - July 17, 2005
  • FreeBSD interface dl-0.0.1 first released.

Bug report

If you find a bug or write a useful program with the library, please let me know: http://here.isnew.info/index.php?action=vtopic&forum=9

Contribution

If you're interested in this project, please contribute to documentation.


All the works in this site except software and copyrighted materials by others (e.g., 문학) are licensed under a Creative Commons License. 소프트웨어 및 문학과 같이 다른 이에게 저작권이 있는 작품을 제외하고 모두 크리에이티브 커먼즈 라이센스를 따른다.
Sat Mar 23 17:54:35 2024 . XHTML . CSS (lightbox.css is not part of Uniqki. ;-) . Powered by Uniqki!
refresh . edit . loginout . index