×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    CObexClient: how to Cancel

    I use CObexClient class to send file via Bluetooth. It is similar to example "BTObjectExchange", however I have added user dialogs, in particular Connection and Sending Progress which user can terminate by Cancel rightkey. So the Connecting dialog looks like in SDK "Notepad/Send/Bluetooth".
    When Connection process started, remote device displays the "Receive message via Bluetooth from paired device ___ ?" dialog. If I press Cancel in Notepad, remote device dialog disappeares immediatelly - my device sends any "termination" command, and socket is in "safe" state after that.
    But in my case (class CObexClient) - how can I do the same, when remote device user didn't press Yes or No, but I press Cancel? I have to:
    1) modify status of ActiveObject which uses CObexClient. I do it via CObexClient::Error(kErrCancel) method. Control returns OK to RunL of my AO, but however I'm not 100% sure I can use that callback method for this safely;
    2) notify remote device to terminate "connecting" process, and delete my CObexClient object to use it later when called from "Send/Bluetooth" menu... Both Abort() or Disconnect() methods (because IsConnected() is FALSE) do NOT force remote device to dismiss the dialog (probably my device sends nothing), and when I finally call "delete CObexClient", this is BLOCKING operation, until I press Yes or No on remote device.

    So how can I force remote device to stop "connecting" process, as well as put local CObexClient into "safe" state? Probably use any methods of its RSocket member (whic is however protected)?

    Is there any solution, or Notepad uses other socket classes?
    Any advices, docs, links are welcome!

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Posts
    1,213

    RE: CObexClient: how to Cancel

    I have to investigate this. I cannot yet find anything to solve this.

    However, I also encourage to use a high level API, 'Send As' functionality, instead of implementing an own OBEX service, if possible. 'Send As' simply adds an option into the menu of an application that enables you to send files over e.g. Bluetooth.

    Seppo
    Forum Nokia

  3. #3
    Registered User
    Join Date
    Jan 2004
    Posts
    2
    Is there currently available any further information about this problem?
    It seems like impossible to cancel the request when connection is waiting for approval on a remote device.

  4. #4
    Regular Contributor
    Join Date
    Jan 2004
    Posts
    128
    Hi everybody,

    I am having the same problem. Do you have any information if it is possible to cancel the connection request?

    Many thanks,

    Fernando

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    14
    Im having the same problem. In emulator with 2.1 sdk the connection can be cancelled as it would expect to do. But when i try to run in on device (ngage), connection attempt cannot be cancelled until remote device answers.

    Any information on this matter?

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Posts
    1,213
    Have you tried TLMDisconnectACLIoctl (defined in bt_sock.h)?
    Further documentation on it can be found in the SDK Help:

    C++ API guide » Bluetooth » Using Bluetooth Sockets » How to disconnect ACL links


    -seppo
    Forum Nokia

  7. #7
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: CObexClient: how to Cancel

    Hi,

    I had the same problem - CObexClient client from some reason hasn't any method for canceling pending request, when user on receiving side doesn not decide to press anything or if sender simply wants to cancel the operation. Why? I don't know - but maybe there're some good "architecutre" reasons. Anyway Mika Raento presented a way (with switching off BT connectins) how to "hack" it with use of bteng.lib from SendoX SDK. Maybe it's ot legal, but it's working solution - just check Google...

    Related thread:
    http://discussion.forum.nokia.com/fo...ht=OBEX+cancel

    Regards
    STeN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×