Hi all.
I'm developing an app in which I'll be able to select a file to send to a
remote device via BT using the Exchange Manger API.
At the present I've only been able to create a list of all the available
databases at the Palm like this :
SysCreateDataBaseList(sysFileTApplication,0,&wNumDBsFound,&haItems,true);
if (haItems) paItems= (SysDBListItemType*)MemHandleLock(haItems);
dBName = (Char *) MemPtrNew(sizeof(paItems[listSel].name));
StrCopy(dBName,paItems[listSel].name);
dBIDNo = paItems[listSel].dbID;
dBCardNo = paItems[listSel].cardNo;
MemHandleFree(haItems);
haItems= NULL;
and the following code enables me to send files :
static void SendFile(){
Err err;
//ExgSocketType exgSocket;
UInt32 sendNameSize=0;
UInt32 btFullURLSize;
btFullURLSize =
sizeof(StrCat(mySendScheme,"/xx:xx:xx:xx:xx:xx/"));//defines the maximum
size of the URL used for sending, excluding the filename
MemSet(&exgSocket,sizeof(exgSocket),0);
sendNameSize = sizeof(dBName);
sendName = (Char *) MemPtrNew(btFullURLSize+sendNameSize);//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);
exgSocket.name = sendName;
//FrmCustomAlert(Debug,"sendName -> ",sendName,"");
err = ExgPut(&exgSocket);
if (err == 0){
err = ExgDBWrite(WriteProc, &exgSocket, NULL, dBIDNo, dBCardNo);
ExgDisconnect(&exgSocket,err);
}
else FrmCustomAlert(Debug,"erro ",ConvertBtErrToString(err),"");
}
with this code I can only get the database from an app
My questions are as follow :
1 - dBName is just the name of the app without extension right(e.g.
Blueboard instead of Blueboard.pdb)? if so when I do exgSocket.name = dBName
does the exchange manager knows I'm sendig a database because of the
parameters in ExgDBWrite or does an error occur? In the latter how do I get
the extension of a file?
2 - the pda is able to receive file of any type(jpeg,wav,mpeg,etc) as long
it has an app registered to handle that type. My problem is how do I select
a particular file instead of the database for posterior sending? That is
instead of sending myJPEGViewer.pdb being able to send myJPEG.jpg?
Any help would be great.
Thx for the attention.
Ricardo Marques
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/