.NET Components for Mobility

"Unable to connect" to HTC device when trying to send file

Last post 05-27-2010 12:00 PM by alanjmcf. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 11-04-2009 5:56 AM

    "Unable to connect" to HTC device when trying to send file

    Hi

    My program will (ideally) run on my HTC TP (WinMo) device and listen for any incoming Bluetooth messages. It will receive the file, analyze it and send a response.

    The problem I am having is that I get an "Unable to connect" message on any phone I use to try to send the file to the HTC.

    My Bluetooth is switched on (on both devices), discovery is switched on.

    Here is the code to set up the listener:

    bluetoothRadio = BluetoothRadio.PrimaryRadio; // set the Bluetooth radio to primary status

                   if (bluetoothRadio != null)
                        bluetoothRadio.Mode = RadioMode.Discoverable; // set Bluetooth radio to discoverable
                   
                    obexListener = new ObexListener(ObexTransport.Bluetooth); // create an obex listener
                    obexListener.Start();
                   

                    listenerThread = new System.Threading.Thread(new System.Threading.ThreadStart(AcceptObexRequest));
                    listenerThread.Start();

     

    Any thoughts?

    Cheers

    Graeme

  • 11-09-2009 4:07 PM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

    HTC include their own OBEX services instead of MSFT's supplied versions.  Maybe the HTC supplied service is still *partly* running...

    If you use the SdpBrowser sample from the library installation, and use <All Services (over L2CAP)> button (and for optionally the <Name and Channel...>) does it list ObexObjectPush?

  • 11-10-2009 5:23 AM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

    If I press the "All services (over L2CAP)" button I get "Search returned zero services".

    The weird thing is, if I turn on the setting "Receive all incoming beams" then the other devices will be able to connect, but my program is not able to intercept the incoming items (they get handled by the usual WinMo "Do you want to receive a file from XXXXX".)

    If that is turned off, then devices are unable to connect.

     

  • 11-10-2009 5:39 AM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

     Hi

     

    Just ran the desktop version of SDPBrowser on my laptop (I think the mobile one didn't work properly since it was for PPC2003 instead of WinMo6). After discovering my HTC device, I selected it from the drop-down, then ran the "All Services (Over L2CAP)" command for it.

    It then DID find an ObexObjectPush (as well as ObexProtocol). 

     

    What are the implications of that?

    Thanks

    Graeme

  • 11-10-2009 6:10 AM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

    Was that with "Recieve beams" enabled or disabled?  And you app running or not?  Each will add their own SDP record, so you should see none, one, or two...
  • 11-10-2009 6:16 AM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

     Hi

     

    In both cases (running SDPBrowser on the phone and the desktop) "Recieve Beams" was disabled and the app was not running.

     

    Cheers

    Graeme

  • 11-10-2009 7:00 AM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

    I've run the browser now with each of the following combinations:

    Beams off, app off

    Beams on, app off

    Beams on, app on

    Beams off, app on.

     

    Here are (selected) outputs from the browser (apologies if its too much, but I'd rather not leave out possible useful info):


    Beams off, App off:

     

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x4

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=4 ), ( Obex ) )

    AttrId: 0x0009 -- BluetoothProfileDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x1105 -- ObexObjectPush

            UInt16: 0x100

     

    AttrId: 0x0100 -- ServiceName

    TextString: [en] 'OBEX Object Push'

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x4

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=4 ), ( Obex ) )

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x7

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=7 ), ( Obex ) )

    Beams on, App off:

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x4

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=4 ), ( Obex ) )

    AttrId: 0x0009 -- BluetoothProfileDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x1105 -- ObexObjectPush

            UInt16: 0x100

     

    AttrId: 0x0100 -- ServiceName

    TextString: [en] 'OBEX Object Push'

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x4

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=4 ), ( Obex ) )

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x7

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=7 ), ( Obex ) )

     

    Beams on, App on:

     

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x4

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=4 ), ( Obex ) )

    AttrId: 0x0009 -- BluetoothProfileDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x1105 -- ObexObjectPush

            UInt16: 0x100

     

    AttrId: 0x0100 -- ServiceName

    TextString: [en] 'OBEX Object Push'

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x4

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=4 ), ( Obex ) )

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x7

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=7 ), ( Obex ) )

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x8

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=8 ), ( Obex ) )

    Beams off, App on:

     

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x4

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=4 ), ( Obex ) )

    AttrId: 0x0009 -- BluetoothProfileDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x1105 -- ObexObjectPush

            UInt16: 0x100

     

    AttrId: 0x0100 -- ServiceName

    TextString: [en] 'OBEX Object Push'

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x4

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=4 ), ( Obex ) )

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x7

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=7 ), ( Obex ) )

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x8

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=8 ), ( Obex ) )

    AttrId: 0x0001 -- ServiceClassIdList

    ElementSequence

        Uuid16: 0x1105 -- ObexObjectPush

     

    AttrId: 0x0004 -- ProtocolDescriptorList

    ElementSequence

        ElementSequence

            Uuid16: 0x100 -- L2CapProtocol

        ElementSequence

            Uuid16: 0x3 -- RFCommProtocol

            UInt8: 0x9

        ElementSequence

            Uuid16: 0x8 -- ObexProtocol

    ( ( L2Cap ), ( Rfcomm, ChannelNumber=9 ), ( Obex ) )

  • 11-10-2009 8:14 AM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

    OK, installed the app on my Samsung WinMo phone and got the same problem, so it can't be an HTC issue.

    Now here's the weird thing:

    If I try send the app a file from another WinMo phone (i.e. send from my Samsung to my HTC running the app, or from my HTC to my Samsung running the app) then it works, perfectly.

    BUT

    If I try from any other phone (I've tried from a few Nokia's running S60 and some others) then I get the old "Unable to connect" error.

     

    Really confusing me.

    Apologies for the multiple posts, just trying to get as much information out there as possible in the hope that someone will offer a solution.

     

    Cheers

    Graeme

  • 11-10-2009 4:22 PM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

    No, it all makes complete sense.  And my first theorum seems to have been correct. :-,)

    Firstly about the difference seem from different clients.  When there are multiple record found the different client can choose which to use differently.  Presumably some client uses the first record in the list, and some client use the last record in the list. :-)

    Anyway when neither app is active there should be *no* SDP record for OPP.  But your case one shows there's still a record there!  To get your application (ObexListener) to work (for all clients) you need to get rid of that dodgy record.  See the previous discussion at http://inthehand.com/forums/t/2098.aspx, i.e. HTC option Enable Sharing Files (tab FTP, menu Configuration - Connections - Bluetooth).

  • 11-11-2009 6:34 AM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

    Hi

    I have tried enabling file sharing under the FTP tab but this did not work.
    If I select the "Enable File Sharing" option, and have "Receive all beams" on, the my app does not intercept the incoming object, rather it is handled by the usual WinMo procedure.
    If I select "Enable File Sharing" and have the "Receive all beams" off then I get "Unable to connect" on the device attempting to send.

    Have I missed something?

    (Also, thanks for your time thus far, it is much appreciated)

    Cheers
    Graeme
  • 11-17-2009 9:11 AM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

    I don't know what the trick is, but if you want ObexListener to be used as the OBEX Push server for all clients then you need to have *no* OPP SDP records present before you run it.  Maybe you need to reboot after disabling the service in the two dialogs... :-,)

  • 05-26-2010 7:29 AM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

     I realise this is a very delayed response but I thought I should post the resolution of the problem:

     

    I got hold of WinMo regediter and went to 

    HKEY_LOCAL_MACHINE\Software\Microsoft\Obex

    and changed the isEnabled value to 0.

     

    This allowed my program to function as desired (finally!!)

     

  • 05-27-2010 12:00 PM In reply to

    Re: "Unable to connect" to HTC device when trying to send file

    Thanks for letting us know. :-)

Page 1 of 1 (13 items)
Copyright © 2001-2012 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting