.NET Components for Mobility

IrComm with a legacy device

Last post 07-31-2008 9:14 PM by ravvizomoo. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-30-2008 7:28 AM

    IrComm with a legacy device

    Im trying to connect to a legacy device developed inhouse which has a somewhat lacking documentation.

    It announces itself as "Jetbeam 9-wire App" as devicename but without any services and when i try to connect i get a Nullreferenceexception on RemoteMachineName. The previous pda that was used to connect to it works just fine and uses its libraries "standard" settings for a ircomm connection.  Oh yeah, the device im connecting to prints a "ircomm connection openend" when you connnect with the old pda but not with the new one.

     Anyone have any clues as to what im doing wrong.

    And ofcourse all companies involved in doing the libraries/hardware have either been bought up or are bankrupt :(

  • 07-30-2008 12:22 PM In reply to

    Re: IrComm with a legacy device

    It's highly likely its IrCOMM Cooked-mode.  So just set that socket option and use the IrCOMM Service Name and it should work.  See the VB example on my website (a simple conversion to C# if necessary -- sees the other (IrLPT) sample in C#), http://www.alanjmcf.me.uk/  So, in short:

    ...
    cli.Client.SetSocketOption(IrDASocketOptionLevel.IrLmp, IrDASocketOptionName.NineWireMode, true);
    cli.Connect(new IrDAEndPoint(address, "IrDA:IrCOMM"));
    ...

    I can help with more detailed investigations if that doesn't work.

     

    What's the full exception information and stack trace from the RemoteMachineName method.  I'd like to fix it if possible.  Ohh wait I see it myself, the method and property are only usable when connected.  I presume that's the issue you see.  I'll document and fix that, http://www.codeplex.com/32feet/WorkItem/View.aspx?WorkItemId=17596

    Alan

    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.
  • 07-31-2008 1:33 AM In reply to

    Re: IrComm with a legacy device

    Stacktrace
    på System.Net.Sockets.Socket.ConnectNoCheck()
    på System.Net.Sockets.Socket.Connect()
    på InTheHand.Net.Sockets.IrDAClient.Connect()
    på comportestcf2.Form1.button1_Click()
    på System.Windows.Forms.Control.OnClick()
    på System.Windows.Forms.Button.OnClick()
    på System.Windows.Forms.ButtonBase.WnProc()
    på System.Windows.Forms.Control._InternalWnProc()
    på Microsoft.AGL.Forms.EVL.EnterMainLoop()
    på System.Windows.Forms.Application.Run()
    på comportestcf2.Program.Main()

    Source
    This is run when you press a button.

                IrDAClient client;
                using(client = new IrDAClient())
                {
                    client.Client.SetSocketOption(IrDASocketOptionLevel.IrLmp, IrDASocketOptionName.NineWireMode, 1);
                   
                    listBox1.SelectedIndex = listBox1.Items.Count - 1;
                    IrDADeviceInfo[ devices = client.DiscoverDevices();
                    IrDAEndPoint dtu = new IrDAEndPoint(devices[0].DeviceAddress,IrDAService.IrComm);

                    try
                    {                   
                        client.Connect(dtu);
                        MessageBox.Show("Connected!");
                    }
                    catch (TimeoutException er)
                    {
                        MessageBox.Show(er.StackTrace, er.Message);
                    }
                    catch (System.NullReferenceException er)
                    {
                        MessageBox.Show(er.StackTrace, er.Message);
                    }
                    catch( Exception er)
                    {
                       
                        MessageBox.Show(er.StackTrace, er.Message);
                    }
                    finally
                    {

                    }        
                }

  • 07-31-2008 5:24 PM In reply to

    Re: IrComm with a legacy device

    Assuming that's a socket exception, what's the error code?  10061?

    You could try with "IrLPT" and IrDASocketOptionName.IrLptMode (see http://www.alanjmcf.me.uk/comms/infrared/IrDA%20uses%20(brief).html for all the well known services).  However as it says "9-wire" then that's unlikely...

    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.
  • 07-31-2008 9:14 PM In reply to

    Re: IrComm with a legacy device

     Gonna check as soon as i get back to the computer running it. (about 4-5 hours). I know i´ve read somewhere in the documentationit´s 3-wire but I cant for the life of me find where now :).

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