.NET Components for Mobility

receiving files does not work

Last post 09-03-2008 3:43 AM by voGi. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-01-2008 12:16 PM

    • voGi
    • Top 500 Contributor
    • Joined on 09-01-2008
    • Posts 2

    receiving files does not work

    hey!

    I am new to c# and bluetooth programming. I am trying to build an application that can send/receive vnotes from/to pocket pc (windows mobile) to normal cell phones (sony-ericsson).
    sending vnotes from pocket pc to cell phone already seems to work properly. just receiving on the pocket pc doesn't work. when the application is started it does not receive the files... instead windows mobile handles the file transfer.

    any idea what could be wrong or how I can turn of receiving through windows mobile itself?

    below is my code for the receiving stuff...

     

    ObexListener listener;

    listener = new ObexListener(ObexTransport.Bluetooth);
    listener.Start();

    System.Threading.Thread t1;
    t1 = new Thread(ReceiveVnt);
    t1.Start();

    public void ReceiveVnt()
    {
        while (listener.IsListening)
        {
            try
            {
                ObexListenerContext olc = listener.GetContext();
                ObexListenerRequest olr = olc.Request;

                MessageBox.Show(olr.ContentType.ToString());

                olr.WriteFile("vnote.vnt");
                MessageBox.Show("Empfangen!");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Fehler beim Empfangen");
            }
        }
    }

  • 09-02-2008 6:20 PM In reply to

    Re: receiving files does not work

    Quoting from the user's doc. :-)

    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.  For programmatic control see http://msdn2.microsoft.com/en-us/library/aa916802.aspx and http://msdn2.microsoft.com/en-us/library/aa916361.aspx

    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.
  • 09-03-2008 3:43 AM In reply to

    • voGi
    • Top 500 Contributor
    • Joined on 09-01-2008
    • Posts 2

    Re: receiving files does not work

    oops :-)

    it's working now!
    thx for help

Page 1 of 1 (3 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.