Page 1 of 1

Service Discover Problem on PDA

Posted: Tue Dec 16, 2008 8:54 pm
by dtnghia
Hi,

I wrote application on iPAQ to send file to PC. Firstly it will discovered PC device, i keep this remoteDevice for later using as:

1. discovery OBEX service of PC, once it found it will send file. this step is success. At i do not forget to close stream, abort ObexObjectPush and
remoteDevice.ServiceDiscoveryStarted -= new BlueToolsEventHandler(remoteDevice_ServiceDiscoveryStarted);
remoteDevice.ServiceDiscoveryCompleted -= new BlueToolsEventHandler(remoteDevice_ServiceDiscoveryCompleted);

2. discovery OBEX service of PC again, and the log show that: it has started searching service, but never come to ServiceDiscoveryCompleted. I also see at that time remoteDevice.DiscoveryPending = false;


Please help me

Thanks

RE: Service Discover Problem on PDA

Posted: Tue Dec 16, 2008 9:40 pm
by Jonas
Are you remembering to add the ServiceDiscoveryCompleted event again?

Regards,
Jonas

RE: Service Discover Problem on PDA

Posted: Wed Dec 17, 2008 6:59 am
by dtnghia
Hi Jonas,

I added ServiceDiscoveryCompleted again. But it never fire this event.

Thanks

RE: Service Discover Problem on PDA

Posted: Wed Dec 17, 2008 9:24 am
by Jonas
Hard to say without seeing the entire code.

Regards,
Jonas

RE: Service Discover Problem on PDA

Posted: Wed Dec 17, 2008 11:03 am
by dtnghia
Hi Jonas,

The following is code:

public void Send(RemoteDevice remoteDevice)
{
remoteDevice.ServiceDiscoveryStarted += new BlueToolsEventHandler(remoteDevice_ServiceDiscoveryStarted);
remoteDevice.ServiceDiscoveryCompleted += new BlueToolsEventHandler(remoteDevice_ServiceDiscoveryCompleted);
remoteDevice.DiscoverServicesAsync(ServiceType.OBEXObjectPush);

}

void remoteDevice_ServiceDiscoveryCompleted(object sender, BlueToolsEventArgs eventArgs)
{
...
m_objectPush.PushFile(memStream, code, currentStream);
}

void m_objectPush_PutFileEnd(object sender, Franson.Protocols.Obex.ObexEventArgs e)
{
....
copyArgs.Stream.Close();
m_objectPush.Abort();
remoteDevice.ServiceDiscoveryStarted -= new BlueToolsEventHandler(remoteDevice_ServiceDiscoveryStarted);
remoteDevice.ServiceDiscoveryCompleted -= new BlueToolsEventHandler(remoteDevice_ServiceDiscoveryCompleted);
}


In program, first i call Send(remoteDevice), it works. But the second invoke it never fire ServiceDiscoveryCompleted event.

Thanks

RE: Service Discover Problem on PDA

Posted: Wed Dec 17, 2008 11:18 am
by Jonas
I'll have a look as soon as possible and get back to you.
Is this on a Pocket PC or a Windows XP machine?
And are you using Widcomm or Microsoft?

Regards,
Jonas

RE: Service Discover Problem on PDA

Posted: Wed Dec 17, 2008 11:31 am
by dtnghia
Hi Jonas,

That is Pocket PC - HP 3417 with Widcomm

Thanks

RE: Service Discover Problem on PDA

Posted: Mon Dec 29, 2008 8:03 pm
by dtnghia
Hi Jonas,

Did you have any solution?

Thanks

RE: Service Discover Problem on PDA

Posted: Mon Dec 29, 2008 8:28 pm
by Jonas
No, I haven't had time to look at this yet.

Regards,
Jonas