Bluetooth Object Push?
| Wed, 2003-12-10 07:23 | |
|
When a .jpg file is sent through bluetooth, the phone will display "1 message received" dialog ryt?, and the file goes directly to the inbox folder of the phone ryt?.. is there any way that i can bypass this? i will make my own picture viewer program and then program will receive the file directly? how do i do it? "its all right, the gun isn't loaded." |
|






Forum posts: 6
Have a look to BTObjectExchange example.
Cheers.
Forum posts: 29
I am trying to use the OBEX example, which comes with SDK serie 60, at the P800 (UIQ). I have experienced that after sending a file from my mobile phone to my computer, this file is corrupted. I have solved that doing a temporary copy of the file. The problem is that I want to send MP3 files and I would like to send it without doing any temporary copy. Have you experienced that problem?
The source code that I have used is below.
**********************************
void BTSendAPI::ConnectToServerL()
{
TObexBluetoothProtocolInfo protocolInfo;
protocolInfo.iTransport.Copy(KServerTransportName);
protocolInfo.iAddr.SetBTAddr(iServiceSearcher->BTDevAddr());
protocolInfo.iAddr.SetPort(iServiceSearcher->Port());
if (iClient)
{
delete iClient;
iClient = NULL;
}
iClient = CObexClient::NewL(protocolInfo);
iClient->Connect(iStatus);
SetActive();
}
void BTSendAPI::SendFile(const TDesC& aFileName)
{
iCurrObject->Reset();
iCurrObject->SetNameL(_L("Test"));
iCurrObject->InitFromFileL(aFileName);
SendMessageL();
}
**//**************************
Best regards,
Fernando Soler
Forum posts: 104
Try using CObexFileObject...
iCurrObject = CObexFileObject::NewL(KFile);
and then inside your sendFile() function you just need one line..
call the ObexClient::Put() function...
"its all right, the gun isn't loaded."
Forum posts: 29
I apologize that I didn't defined the meaning of my variables. I had already done what you mentioned. But as I have told in my first message, after sending it the file is corrupted. I mean the file is received perfectly but the file is removed at the mobile phone is removed. This problem didn't happen at the serie 60, only at the P800.
/*! @var iClient manages the obex client connection */
CObexClient* iClient;
/*! @var iCurrObject the obex object to transfer */
CObexFileObject* iCurrObject;
I have used two triks for solving that problem. First I made a copy of the file. But this solution was not feasible if I wanted to send MP3. The second solution was to modify the attributes of the file to set up it as read-only. In that way the file was not deleted.
Best regards,
Fernando
I seem to have the same problem as maverick.
I'm developing an application on to mobile that needs to catch an Obex Object push from my desktop computer, I'm trying to use the ObexExchange example but I'm unable to catch the object on my application before the OS so I get it as an message.
Can anyone please help me on this one?
Thanks
Forum posts: 6
It's working for me and even, after all this stuff, you don't need to develop a new picture viewer, you can use the symbian one.
I hope it helps,
Cheers
This looks like a good place to put my question. I am also using the client code of ObexExample, I need some kind of blocking access to bluetooth sendL i mean I wanted to stop the program when sending starts untill it gets finished, rather than using that Active Objects stuff, so I changed the code to use. User::WaitForRequest everywhere where setActive was being used. Now I am getting the error "App Closed", when I call the connectL(), could some one tell me where the error could come I have posted a more detailed question on this url
http://forum.newlc.com/viewtopic.php?t=4584
Forum posts: 12
I am a newbie on Symbian development - the post by ajsanchez - I am facing the same problem i.e. I am unable to receive the file from the PC in my application which runs an obex server, it goes into the INBOX
Could you please explain what exactly you mean by changing the service identifier in a bit of detail . (Also when you advertise a new service on a new channel, what code should be written on the PC side? I mean right now I am using Windows XP with service Pack 2 to send a file manually without any code on the PC side)
Basically, I want to receive files from the PC in my application running on the phone and not into the inbox - How do I acheive this?
Thanks in advance,
Archit
Forum posts: 104
I forgot about this already, don't have the codes anymore.. but did you try to look at the ObexExchange Examlpe? what did it do?
I modified the ObexExchange example like this:
Try using CObexFileObject...
iCurrObject = CObexFileObject::NewL(KFile);
and then inside your sendFile() function you just need one line..
call the ObexClient::Put() function...
"its all right, the gun isn't loaded."