frankvandebergh
Posts: 2
Joined: Thu Sep 18, 2008 4:00 pm

ObexErrorEvent

Thu Sep 18, 2008 4:05 pm

Hi,

I created a multi-threading version of the obexpushfile sample. I can now send files to multiple devices at the same time.
I'm using the pushfileasync method.

Now, when the're is an error, or the push succeeds, an obexerrorevent is raised. How can my event handler know which device the event is coming from ?
So If I'm sending files to 3 devices at the same time, for the moment I only know for example that 2 were successfull, and 1 has an error. How do I know which one it was ?
(I'm using vb.net)

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

RE: ObexErrorEvent

Thu Sep 18, 2008 4:18 pm

That feature doesn't exist in the Obex component.
The source code can be found here:
http://www.franson.com/bluetools/download.asp?file=Obex.zip&platform=net

then you can add it yourself.

Regards,
Jonas

frankvandebergh
Posts: 2
Joined: Thu Sep 18, 2008 4:00 pm

RE: ObexErrorEvent

Thu Sep 18, 2008 9:36 pm

Thanks jonas. I changed the code so now I know which device has the timeout. Now I have a 2nd problem:
After the timeout for the pushfileasync method, the phone is still asking if I want to accept the message or not. If I then immedialty try again, I get an error on "servicecurrent.Stream" , "unable to connect to remote service".
When I deny the message on the phone, it works. Is there any way I can force a complete disconnect for a certain device ?

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

RE: ObexErrorEvent

Thu Sep 18, 2008 11:24 pm

Closing the stream should in theory completely disconnects the device, however reports lately point to that this isn't 100% guaranteed on all devices.
I will look into improving this in later versions of BlueTools but for now that's the best you can achieve.

Regards,
Jonas

Return to “BlueTools”