Page 1 of 1

Device Enumeration and SerialNo reading

PostPosted: Mon 1. Aug 2011, 08:32
by tiveria
Hello IRTRans Team,

in a project we are currently developing up to 4 IRTRans USB devices can be used with one application. To allow the user to correctly setup the application, it would be very helpful to be able to enumerate the connected IRTRans modules and to display their Serialnumber as done in the IRTrans Tray application.
We are using .net35 and the irtrans.net bindings. Our first attempts to use the getdevicelist call failed as it only returns null.

How can we achieve the described scenario?

BR
Michael

Re: Device Enumeration and SerialNo reading

PostPosted: Mon 1. Aug 2011, 10:50
by IRTrans
Hi,
please use "GetDeviceModeEx".

Here is a short example:

Friend info As MODEINFO

obj = irt.GetDeviceModeEx()
DisposeFrmDeviceWait()

If IsNothing(obj) Then Exit Sub
If (obj.GetType().Name = "MODEINFO") Then
info = obj
ElseIf (obj.GetType().Name = "NETWORKSTATUS") Then
IRTransError(obj)
Exit Sub
Else
Exit Sub
End If


If you do not use IRTrans Bus modules you can also use getBusinfo:

obj = irt.getBusinfo()

If (Not IsNothing(obj)) Then
If (obj.GetType().Name = "BUSLINE[]") Then
busline = obj
End If
End If

It is faster as it does not query the serial bus of USB devices.

IRTrans

Re: Device Enumeration and SerialNo reading

PostPosted: Mon 1. Aug 2011, 22:25
by tiveria
Thanks! So far it worked.
The only thing i did not find in the returned datastructure (GetDeviceModeEx) is the Serial Number.
Can it also be read out?

Re: Device Enumeration and SerialNo reading

PostPosted: Mon 1. Aug 2011, 22:32
by IRTrans
Hi,
there is no call available that will give you the serial number.

Why do you need it?

If there is more than one IRTrans USB device connected to the server the ordering of the devices will always be the same because the server sorts them by the USB Serial numbers.

IRTrans

Re: Device Enumeration and SerialNo reading

PostPosted: Mon 1. Aug 2011, 22:45
by tiveria
The idea was to use the serial number to guide the user while the setup process.
As the number is printed on the device, it would make lives easier.

Re: Device Enumeration and SerialNo reading

PostPosted: Tue 2. Aug 2011, 01:27
by IRTrans
It would be very complicated for us to extend this due to compatibility with older versions.

IRTrans

Re: Device Enumeration and SerialNo reading

PostPosted: Tue 2. Aug 2011, 08:36
by tiveria
That's a pity as this would really be helpful.
How does the IRTrans Tray application read out the Serial No?

Re: Device Enumeration and SerialNo reading

PostPosted: Tue 2. Aug 2011, 11:09
by IRTrans
The Transtray does not read it out. It just shows the log output of the irserver.

The problem is, that the .NET API has to read out all the information from the server via TCP Calls. Extending these calls would mean that older versions are no longer compatible with newer server versions.

IRTrans

Re: Device Enumeration and SerialNo reading

PostPosted: Tue 2. Aug 2011, 15:50
by tiveria
ok, but this would mean, i could also directly talk to the irserver, read the log and then parse them.

Re: Device Enumeration and SerialNo reading

PostPosted: Tue 2. Aug 2011, 16:00
by IRTrans
Right now the irserver does not offer any call to read out the serial numbers.

They are only shown in the log on startup of the irserver when the devices are initialized.

IRTrans