dtnghia
Posts: 24
Joined: Thu Sep 18, 2008 8:54 pm
Location: Vietnam

Service Discover Problem on PDA

Tue Dec 16, 2008 8:54 pm

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

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Service Discover Problem on PDA

Tue Dec 16, 2008 9:40 pm

Are you remembering to add the ServiceDiscoveryCompleted event again?

Regards,
Jonas

dtnghia
Posts: 24
Joined: Thu Sep 18, 2008 8:54 pm
Location: Vietnam

RE: Service Discover Problem on PDA

Wed Dec 17, 2008 6:59 am

Hi Jonas,

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

Thanks

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Service Discover Problem on PDA

Wed Dec 17, 2008 9:24 am

Hard to say without seeing the entire code.

Regards,
Jonas

dtnghia
Posts: 24
Joined: Thu Sep 18, 2008 8:54 pm
Location: Vietnam

RE: Service Discover Problem on PDA

Wed Dec 17, 2008 11:03 am

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

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Service Discover Problem on PDA

Wed Dec 17, 2008 11:18 am

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

dtnghia
Posts: 24
Joined: Thu Sep 18, 2008 8:54 pm
Location: Vietnam

RE: Service Discover Problem on PDA

Wed Dec 17, 2008 11:31 am

Hi Jonas,

That is Pocket PC - HP 3417 with Widcomm

Thanks

dtnghia
Posts: 24
Joined: Thu Sep 18, 2008 8:54 pm
Location: Vietnam

RE: Service Discover Problem on PDA

Mon Dec 29, 2008 8:03 pm

Hi Jonas,

Did you have any solution?

Thanks

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Service Discover Problem on PDA

Mon Dec 29, 2008 8:28 pm

No, I haven't had time to look at this yet.

Regards,
Jonas

Return to “BlueTools”