"Paul Bohme" <[EMAIL PROTECTED]> wrote in message
news:24408@palm-dev-forum...
> OK, here's an oddball one - I need to use the Palm to actually
_exchange_
> data through the IR port - not just have one squirt a buffer at the other
> one.
You'll need to use the IrDA Library to do two-way communication.
> Was thinking I could get sneaky and use the built in exchange manager,
> have the initiating Palm spam the data out, then the receiver fire up an
> exchange send right back, but this ends up horking the libraries and I get
> "out of memory" (!) errors whenever trying to beam after that.
Before joining Palm, I worked on BeamBooks. We tried this technique and had
similar difficulties. I don't know why it doesn't work, but it hardly
matters - the flashing dialogs would be pretty ugly. When you beam an object
using the Exchange Manager, it doesn't actually get sent until you call
ExgDisconnect. That's when the discover, connect, put, etc are actually
done. The data is buffered until you call ExgDisconnect.
> Cramming the docs for going through the IR libs manually leads me to
> believe that my app has to be active on the receiveing end as well, which
> might not be an option.
You're right. Your app will have to open the IrDA library on the receiving
device before you can connect to it from the sending device. You could try
sending a little object via OBEX to initiate the connection. We tried that,
but couldn't get it to work well. In the end, we required the app to run on
both sides. (Actually, we required the user to tap a button on both sides as
a security precaution.) We used a test packet to check if the other side is
trying to connect. Once both sides are active, both sides start doing
discover requests at random intervals until one side manages to connect.
This acts as a tie-breaker for the subsequent communication protocol. The
test packet is used to prevent the dreaded "waiting for sender" dialog on
the receiving device.
HTH.
--
Danny Epstein
OS Engineer, Palm Inc.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/