Hi.
I developed an app which is suposed to send a database, from the pda (palm
m515), to a PC after the user as selected the file and device.
I construct the url _btobex://xx:xx:xx:xx:xx:xx/foo.pdb and do the following
:

/***********************************************************************
 *
 * FUNCTION:    CreateSendScheme
 *
 * DESCRIPTION: Creates the scheme for the communication. It will define
 *          the scheme as being btobex indicating that the cexchange
 *          library used to send data will be a the bluetooth exchange
 *          library . The scheme will also indicate the target device,
 *          and file to send
 *
 * PARAMETERS: none
 *
 * RETURNED:  nothing
 *
 ***********************************************************************/
static void CreateSendScheme(){

 UInt32 sendNameSize=0;
 UInt32 btFullURLSize=0;
 UInt32 btURLSize=0;
 UInt32 sendNameLength=0;



 btFullURLSize = StrLen("/xx:xx:xx:xx:xx:xx/");
 btURLSize = StrLen(mySendScheme);
 sendNameSize = StrLen(dBName);
 sendNameLength = btFullURLSize+sendNameSize+btURLSize+4;
 sendName = (Char *) MemPtrNew(sendNameLength+1);//allocates the memory
necessary to indicate the the sending scheme, device to send to and filename
 ConvertBdAddrToStr(&gBdAddr[gSelectedBdAddr],gBtLibRefNum, gBdAddrStr);
 StrCopy(sendName,mySendScheme);
 StrCat(sendName,"/");
 StrCat(sendName,(Char *)gBdAddrStr);
 StrCat(sendName,"/");
 StrCat (sendName,dBName);
 StrCat (sendName,".pdb");
 sendName[sendNameLength]='\0';
}


/***********************************************************************
 *
 * FUNCTION:    SendFile
 *
 * DESCRIPTION: Converts the currently selected Database in to a stream
 *          which will be sent to the selected device
 *
 * PARAMETERS: none
 *
 * RETURNED:  nothing
 *
 ***********************************************************************/
static void SendFile(){

  Err err;


 MemSet(&exgSocket,sizeof(exgSocket),0); //cleans the exgSocket
 exgSocket.name = sendName;    //sendName indicates the type of
communication (Bluetooth), the target device and the name of the file
 err = ExgPut(&exgSocket);    //iniciates the communication with the
exchange library
 if (err == 0){
  err = ExgDBWrite(WriteProc, &exgSocket, NULL, dBIDNo, dBCardNo);
//converts the database to a stream. WriteProc is a pointer to a functoin
that writes out the database
  err = ExgDisconnect(&exgSocket,err);          //closes the connection
 }
 else FrmCustomAlert(Debug,"erro ",ConvertBtErrToString(err),"");
}

However, the ExcgMgr fails to send the file and doesn't provide me with any
code error that I might find usefull. From this, does anyone has any idea
for the failure??
Any help would be great. The sooner the better...
Thx for the attention.
Ricardo




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to