IDRA question

D

Deleted member 103

Guest
IRDA question

Hi guys,
I try to ship via the IRDA interface data, unfortunately I get an error message.
Can someone tell me what am I doing wrong?

Ciao,
Filippo
 

Attachments

  • capture001.jpg
    capture001.jpg
    22.8 KB · Views: 202
  • Test_Irda.sbp
    1.6 KB · Views: 193
Last edited by a moderator:

agraham

Expert
Licensed User
Longtime User
Oddly SerialPort.Write is not documented as throwing that type of exception.

IOException is a general type of exception. You need to know the message associated with it. Trap the exception with OnError then get the messsage by assigning B4B4PObject(6) to the Value property of an Exception object from my Exceptions library.

Exception1.ExceptionRef = B4PObject(6)
Msgbox(Exception1.Message)

You might need to look at the InnerException if there is one.
 

mjcoon

Well-Known Member
Licensed User
Hi guys,
I try to ship via the IRDA interface data, unfortunately I get an error message.
Can someone tell me what am I doing wrong?

No, I cannot! But I did confirm that I get the same thing on my WM5.0 device which has IRDA. I also altered the code to use SerialEx ("an enhanced version of the Serial2 library for which it is a drop in replacement") so I could add extra diagnostics. But this revealed nothing! I've attached my version.

Mike.
 

Attachments

  • Test_Irda.sbp
    2 KB · Views: 210

agraham

Expert
Licensed User
Longtime User
SerialEx.OnErrorReason only shows transmission line errors detected by the UART. The IOException is not this type of error, it is a .NET exception raised for some entirely different reason. I have never used IRDA, and now have no mobile devices so I have no suggestions apart from the one I made above.
 
D

Deleted member 103

Guest
@agraham
When i use the Library "Exceptions library" I get this error message: "NETCFv35.Messages.de" is prerequisite.

@mjcoon
When I run your example, then I get this message: "Serial error = 0"
 

agraham

Expert
Licensed User
Longtime User
What do you mean by "I get this message"?

If it is from Msgbox(Exception1.Message) it is likely that your device is running CF3.5 but does not have the exception error messages installed in the ROM to save memory space. For WM 5.0 you probably need to install NETCFv35.Messages.DE.wm.cab if you can find a copy. I couldn't find it on MSDN but did find it here

https://rapidshare.com/#!download|530p9|402902242|NETCFv35.Messages.DE.wm.cab|277|0|0

Whether you trust that source is up to you.
 

mjcoon

Well-Known Member
Licensed User
@mjcoon
When I run your example, then I get this message: "Serial error = 0"

Yes, AGraham confirmed what I guessed about that. The value returned is not valid because the (asynchronous) error event has not been triggered (which is why I made the text slightly different: "OnError").

Thus it must be the write action itself that is failing, not the subsequent actions that should be performed by underlying firmware and hardware.

You will have to go in search of that messages DLL to get some hopefully useful explanation of the exception condition in German. Please let us know what it is...

Mike.
 

mjcoon

Well-Known Member
Licensed User
If it is from Msgbox(Exception1.Message) it is likely that your device is running CF3.5 but does not have the exception error messages installed in the ROM to save memory space. For WM 5.0 you probably need to install NETCFv35.Messages.DE.wm.cab if you can find a copy. I couldn't find it on MSDN but did find it here

https://rapidshare.com/#!download|530p9|402902242|NETCFv35.Messages.DE.wm.cab|277|0|0

Having seen a hint elsewhere, I discovered that my PC has a load of these message cab files at: C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\Diagnostics. Each has a "wm" component twin.

HTH, Mike.
 

mjcoon

Well-Known Member
Licensed User
... For WM 5.0 you probably need to install NETCFv35.Messages.DE.wm.cab if you can find a copy.

The English copy I found on my PC installed OK, but using the exceptions library (1st time for me, I think) just gave me "IOException" and no inner message.

No idea where to go from there...

Mike.
 
D

Deleted member 103

Guest
I had not copied the library into my path.

I had not copied the library into my path.
Now is no error message at startup, unfortunately crashes the program after you click the button "Senden Syncronstring" with no error messages and I have to restart the device.
 
D

Deleted member 103

Guest
I imported the Serial2.cs in Visual Studio and
at this point the error message (excerpt from Serial2.cs):
B4X:
        public void Output(byte[] Value)
        {
            sp.Write(Value, 0, Value.Length);
        }
"IOException"
bei System.IO.Ports.SerialStream.WinIOError()
bei System.IO.Ports.SerialStream.Write()
bei System.IO.Ports.SerialPort.Write()
bei WinShowMi.frmMain.SendStream()
bei WinShowMi.frmMain.go_SendSyncrostring()
bei WinShowMi.frmMain.btnSendSyncrostring_Click()
bei System.Windows.Forms.Control.OnClick()
bei System.Windows.Forms.Button.OnClick()
bei System.Windows.Forms.ButtonBase.WnProc()
bei System.Windows.Forms.Control._InternalWnProc()
bei Microsoft.AGL.Forms.EVL.EnterMainLoop()
bei System.Windows.Forms.Application.Run()
bei WinShowMi.frmMain.Main()
 

agraham

Expert
Licensed User
Longtime User
From Google it seems other people have encountered this same problem and not been able to resolve it. I may have found something here - Blank IO Exception. See the second post by Anthony Wong.

Raw IR access is only available on devices that expose the IR hardware as a serial port ... If a Windows CE–based device shares serial hardware with the IR port and the serial port, an application must instruct the COM driver to route data through the IR port. .... The SerialPort implementation on NETCF does not support raw IR access, as we do not provide a way to set the SETIR flag.
I don't know if this applies here but it looks like it might. The official way to access the IRDA port from a .NET program is via the Compact Framework IrDAClient class.
 
D

Deleted member 103

Guest
Hi guys,

can someone please test with its PPC?
I want to rule out that it is just simply a problem with the IRDA-interface of my MDA-Pro.
Simply click on the button "Send Syncronstring".

I get in my old MDA-Pro getting the error message "IOException".


Ciao,
Filippo
 

Attachments

  • Test_Irda.sbp
    1.8 KB · Views: 183
D

Deleted member 103

Guest
Hi agraham,

thanks for all the info, I'm going to try with the "Compact Framework IrDAClient" continue.
 

mjcoon

Well-Known Member
Licensed User
Sorry I've not been on here for a while.
I'll post all my IRDA projects and data tomorrow.
If it can be done on a PPC, I've done it.
If it can't, I haven't :)

Hi taximania, are you into Android as well? I wonder if a simple bit of hardware could be made as a remote release for a smartphone camera to work via bluetooth.

Best wishes, Mike.
 
Top