Hi all.
I'm trying to send trough a BT connection, with Exg Mgr, a file .txt. I get
a string from a field written by the user and then send it to a device
previously chosen. Unfortunaly I'm unable to send the file and don't know
why. Any ideas?
Here's my code

case MenuSMS :
   if (sms)
   {
    MemPtrFree(sms);
   }
   frm = FrmInitForm (InsertSMS);
   FrmSetFocus (frm, FrmGetObjectIndex (frm, 3000));
   FrmDoDialog (frm);
   objindex = FrmGetObjectIndex (frm, 3000);
   fp = (FieldPtr) FrmGetObjectPtr (frm, objindex);
   c = FldGetTextPtr (fp);
   if (c == NULL)
   {
    size = StrLen(" ");
    sms = MemPtrNew(size+1);
    StrCopy (sms, " ");
   }
   else
   {
    size = StrLen(c);
    sms = MemPtrNew(size+1);
    StrCopy (sms, c);
   }
   //sms[size]='\0';
   sizeSend = StrLen(sms);
   FrmDeleteForm (frm);
   MyPrintF(gResultsForm, gResultsField,"\n%s",(Char *)sms);
   CreateSMSScheme();
   MemSet(&exgSocket,sizeof(exgSocket),0);
   exgSocket.name = sendName;
   err = ExgPut(&exgSocket);
   if (err == 0){
   ExgSend(&exgSocket, sms, sizeSend, &err);
   ExgDisconnect(&exgSocket,err);
   }
   handled = true;
   break;

static void CreateSMSScheme(){

 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("BtSMS");
 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,"BtSMS");
 StrCat (sendName,".txt");
 //sendName[sendNameLength]='\0';
}

Don't mind the SMS tags.
The devices connect with each other but the file ins't being send. The
problem might be in the definition of the file.
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/

Reply via email to