×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    182

    Read attachement send using bluetooth?

    Hi,

    I am working on application which needs to reads all the SMS from all the accounts(Inbox, Outbox, Drafts etc). I am able to do so but the problem is application fails to read the messages which have attachment send via blue tooth.

    Consider the case that i have send sis file from PC to mobile now the sms entry is created in Inbox. When my application tries to read same, it panic with System Error(-1).

    Did anybody face the similar problem before.
    ->If there's other way to read and get the information regarding attachment with SMS then please do let me know.
    ->Also is there any way to save the attachment some other location programatically?

    Thanks and Regards,

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Read attachement send using bluetooth?

    Quote Originally Posted by PopAndDestroy View Post
    Consider the case that i have send sis file from PC to mobile now the sms entry is created in Inbox. When my application tries to read same, it panic with System Error(-1).
    Negative numbers: http://wiki.forum.nokia.com/index.php/Error_codes, -1 is especially common.
    Did anybody face the similar problem before.
    Consider showing some code, in fact you should add some logging and find the exact point of failure.
    ->If there's other way to read and get the information regarding attachment with SMS then please do let me know.
    "Other" needs some reference point. Also note that there is no such thing as SMS with attachment. SMS-s have no attachment, Bluetooth messages are not SMS-s. If you work with MTM-s they will refuse accessing messages belonging to other MTM-s.
    ->Also is there any way to save the attachment some other location programatically?
    By the way, Symbian version also matters: in Symbian 9 you use MMsvAttachmentManager, in older Symbian versions you have other mechanisms.

  3. #3
    Regular Contributor
    Join Date
    Feb 2008
    Location
    Pune, India
    Posts
    340

    Re: Read attachement send using bluetooth?

    The following code will give you the name of the file received as attachment.
    aEntryBoxId is the entry id of the inbox KMsvGlobalInBoxIndexEntryId while the other argument is the selection of the entries in the Inbox.

    The delay as the first statement is necessary.

    Code:
    void YourClass::RetrieveReceivedAttachmentName(TMsvId* aEntryBoxId, CMsvEntrySelection* aEntriesSelection)
    {
    	User::After(3500000);
    
    	LOGENTER;
    	//Process all entries
    	for(TInt i = 0; i < aEntriesSelection->Count(); i++)
    	{
    		CMsvEntry* btEntry = iSession->GetEntryL((*aEntriesSelection)[i]);
    		CleanupStack::PushL(btEntry);
    
    
    		CMsvEntrySelection* btChildren = btEntry->ChildrenL();
    		CleanupStack::PushL(btChildren);
    
    		TInt childCount = btChildren->Count();
    
    		if (childCount>0)
    		{
    			for(TInt i=0; i<childCount; i++)
    			{
    				TMsvId btAtt = (*btChildren)[i];
    				btEntry->SetEntryL(btAtt);
    
    				if (btEntry->HasStoreL())
    				{
    					CMsvStore* store = btEntry->ReadStoreL();
    					CleanupStack::PushL(store);
    
    					MMsvAttachmentManager& attMngr = store->AttachmentManagerL();
    					TInt attcount = attMngr.AttachmentCount();
    					LOGTXT("INCOMING FILE VIA BLUETOOTH...");
    					for(TInt j=0; j<attcount; j++)
    					{
    						CMsvAttachment* attachment = attMngr.GetAttachmentInfoL(j);
    						TPtrC ptr = attachment->AttachmentName();
    						TPtrC8 mime = attachment->MimeType();
    						LOGTXT("NAME...");
    						LOGDES16(ptr);
    						LOGARG("SIZE = %d", attachment->Size());
    						LOGTXT("MIME TYPE");
    						LOGDES8(mime);
    						LOGARG("NAME LENGTH %d", ptr.Length());
    					}
    					CleanupStack::PopAndDestroy(store);
    				}
    				else
    					LOGTXT("STORE NOT PRESENT");
    			}
    			CleanupStack::PopAndDestroy(btChildren);
    			CleanupStack::PopAndDestroy(btEntry);
    		}
    	}
    	LOGEXIT;
    }
    I hope it helps!
    Regards,
    Sainagakishore Srikantham (Kishore)

    Don't Hope, KNOW!!! ---------- Visit me at http://ssnkishore.blogspot.com ----------

  4. #4
    Registered User
    Join Date
    Aug 2006
    Posts
    182

    Re: Read attachement send using bluetooth?

    Thanks for your valuable help i am able to achieve using the above two post.

Similar Threads

  1. Bluesoleil Software
    By kencooper in forum Bluetooth Technology
    Replies: 9
    Last Post: 2008-08-29, 19:46
  2. Send a file via Bluetooth
    By bmichel in forum Symbian
    Replies: 6
    Last Post: 2008-05-20, 20:40
  3. cannot send MIDlets via Bluetooth
    By pokeman54 in forum Bluetooth Technology
    Replies: 1
    Last Post: 2008-02-08, 13:20
  4. Unable to send files via Bluetooth
    By msingerman in forum Bluetooth Technology
    Replies: 3
    Last Post: 2003-11-19, 14:02
  5. Replies: 5
    Last Post: 2003-02-07, 11:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×