b_khoshbin
Posts: 7
Joined: Mon Dec 22, 2008 9:08 pm

push file result status

Sat Dec 27, 2008 11:36 pm

Hello
I call m_objectPush.PushFile in push file sample. How i can find out that if transmission result(accepted,denied,aborted,transmited)?

How i can define a timeout for transmission?

Thanks

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

RE: push file result status

Sun Dec 28, 2008 10:53 pm

If the phone (or other remote device) respond with an obex error code you can read the result.
If it just aborts by breaking the connection (like most cell phones do) you cannot know if the phone denied or aborted the data.
The accept is of course given as the actual transfer goes through and transmit status can be read from the callback (look at the ObjectPush sample as it moves the progress bar)

You cannot define a timeout in BlueTools.

Regards,
Jonas

b_khoshbin
Posts: 7
Joined: Mon Dec 22, 2008 9:08 pm

RE: push file result status

Tue Dec 30, 2008 10:56 am

How I can find out that phone has broken the connection.
We want to make a bluetooth marketing software and we don't want our software hang when a phone didn't answer or its answer was very late(about 7 seconds). we want our software switch to next phone.
objectPush events occur when connection established.but not user denies connection

Regards

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

RE: push file result status

Tue Dec 30, 2008 1:10 pm

If the i.e. currentService.Stream doesn't return but instead throws an ObjectDisposedException the connection is broken.
If you wish you can simply close the Stream yourself if the phone isn't responding fast enough for you.

Regards,
Jonas

Return to “BlueTools”