Re: [Hamlib-developer] serial ports and hamlib
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Stephane F. <f8...@fr...> - 2003-02-24 20:56:07
|
On Mon, Feb 24, 2003 at 07:00:29PM +0100, Joop Stakenborg wrote:
> If I remember correctly, someone on the xlog-discussion mailing list
> reported blocking of the gui when using /dev/usb. This also happens when
> using tlf. Both applications are using a polling frequency of around 350
> ms, which works okay with serial ports because the timeout is much lower
> (200 mS).
The 200mS is a _character_ timeout, ie. each byte has to be received
within 200mS of the previous one.
Now, let's do the math.
The communication is set to 1200 bauds, which is 120 byte/s using 8N1.
This allows 40 bytes per exange, since xlog/tlf poll ~3 times a sec.
Note: the link is full duplex, but most of the time the protocol is
half duplex.
This is still okay, but now, what if the rig is a bit slow at answering?
It may block the GUI and its event-handling loop.
That would be interessting to know at which speed the communication was
set. I don't see any reason why the USB serial driver would be slower.
I've made a silly program to measure rig_get_freq and rig_get_mode
in a loop:
(fillods@charybde:tests)$ ./rig_bench 311
Opened rig model 311, 'IC-706MkIIG'
Backend version: 0.2, Status: Beta
Serial speed: 19200 bauds
Port /dev/ttyS0 opened ok
Perform 100 loops...
Elapsed: 5.120s, Avg: 19.532895 loops/s, 0.051196 s/loop
port /dev/ttyS0 closed ok
> I guess I have to adjust the polling frequency when a usb device is
> used.
No, you shouldn't have to. However, that should be done with slow
serial rates.
Anyone here has an USB dongle to share his/her thoughts on the question?
Stephane
|