Device Enumeration and SerialNo reading

The place where software developers meet

Moderator: marcus

Device Enumeration and SerialNo reading

Postby tiveria » Mon 1. Aug 2011, 08:32

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
tiveria
 
Posts: 20
Joined: Mon 1. Aug 2011, 07:48

Re: Device Enumeration and SerialNo reading

Postby IRTrans » Mon 1. Aug 2011, 10:50

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
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: Device Enumeration and SerialNo reading

Postby tiveria » Mon 1. Aug 2011, 22:25

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?
tiveria
 
Posts: 20
Joined: Mon 1. Aug 2011, 07:48

Re: Device Enumeration and SerialNo reading

Postby IRTrans » Mon 1. Aug 2011, 22:32

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
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: Device Enumeration and SerialNo reading

Postby tiveria » Mon 1. Aug 2011, 22:45

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.
tiveria
 
Posts: 20
Joined: Mon 1. Aug 2011, 07:48

Re: Device Enumeration and SerialNo reading

Postby IRTrans » Tue 2. Aug 2011, 01:27

It would be very complicated for us to extend this due to compatibility with older versions.

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: Device Enumeration and SerialNo reading

Postby tiveria » Tue 2. Aug 2011, 08:36

That's a pity as this would really be helpful.
How does the IRTrans Tray application read out the Serial No?
tiveria
 
Posts: 20
Joined: Mon 1. Aug 2011, 07:48

Re: Device Enumeration and SerialNo reading

Postby IRTrans » Tue 2. Aug 2011, 11:09

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
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: Device Enumeration and SerialNo reading

Postby tiveria » Tue 2. Aug 2011, 15:50

ok, but this would mean, i could also directly talk to the irserver, read the log and then parse them.
tiveria
 
Posts: 20
Joined: Mon 1. Aug 2011, 07:48

Re: Device Enumeration and SerialNo reading

Postby IRTrans » Tue 2. Aug 2011, 16:00

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
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32


Return to APIs

Who is online

Users browsing this forum: No registered users and 6 guests

cron