I'm calling this once for each file I transmit. There are five of them.
static void BeamThisFile(char f[])
{
ExgSocketType exgSocket;
Err err = 0;
Char *appName = f;
LocalID id;
UInt16 cardNumber = 0; // better not to hardcode this
id = DmFindDatabase(cardNumber, f);
if (id) {
// important to init structure to zeros...
MemSet(&exgSocket,sizeof(exgSocket),0);
exgSocket.target = appFileCreator;
exgSocket.description = f;
exgSocket.name = f;
err = ExgPut(&exgSocket);
if (err == 0) {
if (id)
err = ExgDBWrite(
WriteProc,
&exgSocket,
appName,
id,
cardNumber);
err = ExgDisconnect(&exgSocket,err);
}
}
}
static Err WriteProc(const void *dataP, UInt32 *sizeP, void *userDataP)
{
Err err;
*sizeP = ExgSend((ExgSocketPtr) userDataP, dataP, *sizeP, &err);
return err;
}
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Danny
Epstein
Sent: Tuesday, January 29, 2002 9:45 PM
To: Palm Developer Forum
Subject: RE: Beaming Data Bases
> I tried using ExgDBWrite to transmit the databases.
ExgDBWrite doesn't transmit; it just flattens. Within your WriteProc
callback, you should be calling ExgSend. That's what transmits.
> It goes through the
> motions of preparing and transmitting the databases. The receiving end
asks
> to accept the databases, but after the beaming is done the databases
aren't
> there.
> ...
> Should I have some code on the receiving end?
What are you putting in the socket on the sending side? When beaming
databases, you have two choices:
1) Beam to Launcher. To do this, you don't need to have your app on the
receiving device. The sending side should specify an extension that Launcher
knows about, typically prc or pdb. You can also specify a creator ID and/or
MIME type. I don't recommend the former because the receiver may be running
a Launcher replacement. The latter is generally a good idea, but doesn't
have any effect today.
2) Beam to your app. To do this, you must have your app on the receiving
device beforehand. The sending side should specify an extension that your
app registers for and/or your app's creator ID. You must handle the incoming
beam and call ExgDBRead to convert the incoming prc/pdb into a database.
Show us the code that allocates and initializes the ExgSocketType if the
above info isn't sufficient.
-
Danny
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/