.NET Components for Mobility

ObexListener

Last post 04-14-2008 11:08 AM by alanjmcf. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-09-2008 5:54 PM

    ObexListener

    I am able to send a file using ObexWebRequest to another device.  I am trying to use ObexListener to accept the file on the other side, but am not able to do so.  To get started I am simply using the DeviceListener sample to receive the files.  The problem that I am having is that if I send the file using the ObexWebRequest the connection gets handled by the Windows Mobile built in beam functionality.  If I do not use my application to send the file and use the beam filefunctionality on the source device the conection is handled by the DeviceListener sample application.  This is the code I am using to send the files.

    private void button_send_Click(object sender, EventArgs e)

    {

                System.Uri uri = new Uri("obex://" + addr + "/" + System.IO.Path.GetFileName(openFileDialog1.FileName));
                ObexWebRequest request = new ObexWebRequest(uri);
                request.ReadFile(openFileDialog1.FileName);

                ObexWebResponse response = (ObexWebResponse)request.GetResponse();
                MessageBox.Show(response.StatusCode.ToString());
                response.Close();

    }

     Is there something that I need to do differently when sending the file?  or is it something else?

    Filed under: ,
  • 04-11-2008 8:01 AM In reply to

    Re: ObexListener

    Curious, I'll have to think about that one.

    To disable the built-in OBEX server see the user's guide, section OBEX/Server-side.

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 04-11-2008 11:11 AM In reply to

    Re: ObexListener

    Thank you!  If all else fails read the instructions.

    "Note that only one OBEX server can be active on a particular protocol at any time. If another server —
    for instance the operation-system supplied server — is active then the ObexListener will either fail at
    start-up (likely for IrDA), or will simply never receive any connections (likely for Bluetooth).

    On Windows CE the system has a running OBEX server over both IrDA and Bluetooth which can be
    disabled by unchecking “Receive all incoming beams.” on the Settings > Connections > Beam control
    panel."

     I guess I got confused by the fact that files sent by Windows Mobile were recognized by the listener and files sent by my app were not.  I'm still not sure why that would be the case but this works for me.

  • 04-14-2008 11:08 AM In reply to

    Re: ObexListener

    :-)

    That is the confusing bit.  There must be something different about how the two client applications read the service database (SDP) and find the requested service.  (If you're interested run the SdpBrowser sample application when both servers are running, select the PDA device from the drop-down, and hit the <All Services (over L2CAP)> button and we can see how the two records differ).

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
Page 1 of 1 (4 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.