.NET Components for Mobility

Non-interactive PIN

Last post 02-05-2008 9:03 AM by alanjmcf. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-29-2008 5:57 AM

    • Niklas
    • Top 500 Contributor
    • Joined on 01-29-2008
    • Posts 2

    Non-interactive PIN

    Hi,

    I am trying to get a serial port service up and running but fail to get the connection accepted. The server is running on a WM6 and listens for connection attempts from another (closed) device which requires a special service name and service level security with a PIN.

    PROBLEM: How ever I try to set the PIN programmatically I still get the interactive password entry dialogue from WM6. Does anybody know how to correctly supress this dialogue?

    This is what I do:

    ----------------------------------- 

    BluetoothSecurity.SetPin(blueRemoteAddr, password));

    ServiceRecord sdp = createSDP( BluetoothService.SerialPort );
    server = new BluetoothListener( BluetoothService.SerialPort, sdp);

    server.Start();

    BluetoothClient btclient = server.AcceptBluetoothClient();

    -----------------------------------

    I have experimented with PairRequest but I am not sure where it fits in. Doesn't the client need to be established first?  Also, do I need to do "server.authenticate = 1" first?

    Any help is greatly appreciated.

    /Niklas   (on WM6, C#, CF2.0, Microsoft stack)

  • 02-04-2008 9:57 AM In reply to

    • Niklas
    • Top 500 Contributor
    • Joined on 01-29-2008
    • Posts 2

    Re: Non-interactive PIN

     Update: I eventually resolved this issue myself, one problem was in the way I specified the bluetooth address.

    I gave the address in the wrong byte order. As it happens, this constructor:

     BluetoothAddress(Byte[)

    requires the address to be entered with the least significant byte in the address on index 0 in the array. Maybe a note in the docs would help others avoid doing the same mistake?

     Cheers

    /Niklas 

     

  • 02-05-2008 9:03 AM In reply to

    Re: Non-interactive PIN

    Ahh, that's unfortunate. :-(  I guess its that way to suit the format in the native API's function and structs.  What to do if we want to support big endian machines, say on Mono on Linux...

    I'll add some words to the class documentation.  I guess the best solution for apps it not to use that constructor, but instead use the Parse(String) method.

    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 (3 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.