In order to install my aplication I use ExgDBRead() and it's
working.
Here is the code of the two callback (ReadProc() and DeleteProc())
functions that I used.
short ReadProc (void* dataP, unsigned long* sizeP, void* userDataP)
{
char szBuff[6];
short shType = htons( MSG_CS_INSTALL_APP_POCKET ); //
protocol convention
memcpy(szBuff, &shType, 2 ); //
memcpy(szBuff + 2, sizeP, 4 ); // I send to server the length of
data that
// this function
expects to receive
if ( 6 != WriteN( g_nSocket,(BytePtr) szBuff, 6 ) ) //send this to
server
{
return ERR_WRITE;
}
if ( 6 != ReadN( g_nSocket,(BytePtr) szBuff, 6 ) ) // read a
pocket send by server
{
return ERR_READ;
}
memcpy( &shType, szBuff, 2 ); //
shType = htons( shType ); //
//
if ( shType != MSG_SC_INSTALL_APP_POCKET ) //protocol
conventions
{ //
return ERR_TYPE //
} //
long lLen;
memcpy( &lLen, (szBuff + 2), 4 ); // in lLen is the lenght
of data that server actually
//send
*sizeP = htonl( lLen );
if ( *sizeP != ReadN( g_nSocket,(BytePtr) dataP, *sizeP ) ) //put
in dataP lLen bytes from
//prc file(received from server)
{
return ERR_READ;
}
return 0;
}
Notice that you must put 0 in sizeP after the file was transfered.
In my case the server do that. If you don't put 0, ExgDBRead() doesn't
notice that the transfer is over and it call ReadProc() in an infinite
loop.
In DeleteProc() I erased the previos version of aplication.
Please reply with this subject or else is very possible to not notice your
mail.
I hope I was clear enought, my english is not very good.
Best Regards
Gheza
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: 14 septembrie 2000 13:21
> To: [EMAIL PROTECTED]
> Subject: [No Subject]
>
>
> Dear Gheza Viorel,
>
> I was interested by your message to the palm-dev-forum.
>
> I have a problem where by I would like to install a palm app
> to a palm PDA without using HotSync.
>
> Do you have any sample code I could use as a basis for
> transferring a file from PC to PDA?
>
> I also wondered if Tom Zerucha meant ExgDBRead() rather than
> ExgDBWrite() should be used to install the program
>
>
> Best Regards
>
> Pete
>
>
> Date: Wed, 13 Sep 2000 20:29:39 -0400
> From: Tom Zerucha <[EMAIL PROTECTED]>
> Subject: Re: How can I programatically install an application
> on palm ?
>
> On Wed, Sep 13, 2000 at 01:36:21PM +0300, Gheza Viorel wrote:
> >
> > I have a server (on PC) and a client (on device) (TCP/IP
> > connection). Client receives from server a prc file. How can I
> > programatically install this application on device ?
>
> Assuming the prc format is correct, send the stream through ExgDBWrite
> and it will build (i.e. install) the resource database. ExgDBWrite is
> usually used with Beaming, so the examples at palmos.com show it in
> that context, but you can replace the IrDA reads with socket reads.
>
> ZBoxZ does this in two steps - HiBrowz can receive via TCP/IP, and
> ZBoxZ can install the received image - GPL source at
> palmboxer.sourceforge.net, but I use my own install routine.
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/