Comm. with a T68i using IrDA
IRDA RECIPE by Frederik Dannemare
# Install the irda packages.
sudo apt-get install irda-common irda-tools
# Package post-config: Active infrared, choose native, and the smc-ircc driver...
# Communicating with the T68i was done using a Toshiba 2410 laptop, but
# because the irda won't initialize correctly on the Toshiba 2410, we'll need a fix.
# Credits go to Rob Miller -- rob at janerob dot com -- Many thanks!
sudo apt-get install pciutils-dev
wget http://www.janerob.com/rob/ts5100/tosh5100-smcinit.c
gcc -g -O2 -o tosh5100-smcinit tosh5100-smcinit.c -lpci -L/usr/lib -I/usr/include/pci
cp tosh5100-smcinit /usr/local/sbin/
# Now add the below line to /etc/modutils/irda.
pre-install smc-ircc /usr/local/sbin/tosh5100-smcinit
# Run update-modules to update /etc/modules.conf.
update-modules
###setserial /dev/ttyS0 uart none #
###setserial /dev/ttyS1 uart none # doesn't seem to be necessary afterall...
###setserial /dev/ttyS2 uart none #
# Modprobe the irda and ircomm module.
modprobe smc-ircc ircomm
# 'lsmod' should list the modules... If not, something went wrong.
# Add the modules to /etc/modules for future auto-loading of the module at boot time.
### Not necessary - they're autoprobed, along with automatic irattach (see below).
###irattach irda0 -s # This should not be necesssary upon your next reboot,
# as init script takes care of this...
# /proc/sys/net/irda settings for the T68i.
echo 9600 > /proc/sys/net/irda/max_baud_rate
echo 2000 > /proc/sys/net/irda/max_tx_data_size
echo 1000 > /proc/sys/net/irda/min_tx_turn_time
echo 1 > /proc/sys/net/irda/max_tx_window
# You might want to put the above 4 lines in some init script to have the
# values auto-defined at system boot.
# Activate infrared on the cell phone and place it close to the PC's infrared port.
# irda communication output can now be tracked with irdadump.
irdadump
# Find daddr of cell phone.
cat /proc/net/irda/discovery
# Ping the cell phone's daddr using irdaping and make sure to get a ping response.
irdaping <daddr>
# Optional: install openobex and other tools for testing purposes...
sudo apt-get install openobex-apps libopenobex-1.0-0 libopenobex1 libopieobex1-fb \
obexftp obexserver scmxx libqte-mt3 multisync kandy bluez-utils gnokii
# Test irda connectivity using obex_test. The below shows how we can
# connect (c) to the cell phone and download (g) a file (telecom/pb/0.vcf).
# The file download is followed by a disconnect (d) and then we quit (q) obex_test.
# The downloaded file contains the business card (name, phone number, email
# address, etc) on the phone.
debian:~# obex_test -r /dev/ircomm0
OBEX to R320 on /dev/ircomm0!
cobex_open()
OBEX Interactive test client/server.
> c
cobex_connect()
cobex_init()
cobex_do_at_cmd()
cobex_do_at_cmd() Sending command ATZ
cobex_do_at_cmd()
cobex_do_at_cmd() Sending command AT*EOBEX
cobex_write()
cobex_write() Wrote 16 bytes (expected 16)
cobex_handle_input()
cobex_handle_input() Read 7 bytes
[FFFFFFA0][0][7][10][0][2][0]
Connect OK!
Version: 0x10. Flags: 0x00
> g
GET File> telecom/pb/0.vcf
cobex_write()
cobex_write() Wrote 40 bytes (expected 40)
cobex_handle_input()
cobex_handle_input() Read 142 bytes
[snipped... lots of output lines representing the file transfer...]
get_client_done() Found body
GET successful!
Filename = telecom/pb/0.vcf
Wrote /tmp/0.vcf (136 bytes)
> d
cobex_write()
cobex_write() Wrote 3 bytes (expected 3)
cobex_handle_input()
cobex_handle_input() Read 3 bytes
[FFFFFFA0][0][3]
Disconnect done!
cobex_disconnect()
cobex_disconnect() R320!!!
cobex_do_at_cmd()
> q
debian:~#
|