ID: | 5117 |
From: | Majenko Technologies <ma...@majenko.co.uk> |
Date: | Sat, 4 Sep 2021 17:46:22 +0100 |
Subject: | Re: [pcb-rnd] [electronics] minilib and utility for DMM serial proto |
in-reply-to: | 5116 from rn...@igor2.repo.hu |
--0000000000008084e005cb2e28d1 Content-Type: text/plain; charset="UTF-8" I could do a Pty emulation driver actually. I did one for the PICkit2 by modifying pk2serial... That would be useful. I'll do that. On Sat, 4 Sep 2021, 17:26 , <rnd2@igor2.repo.hu> wrote: > > > On Sat, 4 Sep 2021, Majenko Technologies wrote: > > >I'm thinking a library that deals just with the device io. No protocols, > >just getting the raw data. Plugins for serial, HID Serial, raw USB > packets, > >etc. libut61x uses it to get the data from the device, and you specify > what > >plugin to use to get that data from the device. My programmes also use it > to > >get the data from the devices, etc. > > > >Like hid-rnd but for device io not human io. > > Sorry, that's what I don't believe in. If you look at the code, the > part that deals with the low level io, the ports, that's ut61_port_open() > and is 30 sloc. The rest of the code is ut61 specific. > > That 30 sloc needs to set a few things that only this specific device > needs: a fixed baud rate, a combination of RTS and DTR to power the > adapter. Of course you could bloat up this 30 sloc into 300 to have > everything configurabxle, but then you just have a wrapper around termios, > just an excess layer. It's easier to use termios directly. > > For the USB part: normally any usb serial converter would just have a > driver so you get a tty device. That's the abstraction of UNIX. Looking > at the sigrok code, this USB HID is just reimplementing the usual serial > port stuff, baud rate, parity, then read and write bytes. Instead of > inventing yet another software layer above libusb and termios, the proper > solution would be to write a serial driver for this device or if a driver > is overkill, emulate it over pty. > > > Best regards, > > Igor2 > --0000000000008084e005cb2e28d1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">I could do a Pty emulation driver actually. I did one for= the PICkit2 by modifying pk2serial...<div dir=3D"auto"><br></div><div dir= =3D"auto">That would be useful. I'll do that.</div></div><br><div class= =3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, 4 Sep 2021, = 17:26 , <<a href=3D"mailto:rnd2@igor2.repo.hu">rnd2@igor2.repo.hu</a>>= ; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .= 8ex;border-left:1px #ccc solid;padding-left:1ex"><br> <br> On Sat, 4 Sep 2021, Majenko Technologies wrote:<br> <br> >I'm thinking a library that deals just with the device io. No proto= cols,<br> >just getting the raw data. Plugins for serial, HID Serial, raw USB pack= ets,<br> >etc. libut61x uses it to get the data from the device, and you specify = what<br> >plugin to use to get that data from the device. My programmes also use = it to<br> >get the data from the devices, etc.=C2=A0<br> ><br> >Like hid-rnd but for device io not human io.<br> <br> Sorry, that's what I don't believe in. If you look at the code, the= <br> part that deals with the low level io, the ports, that's ut61_port_open= () <br> and is 30 sloc. The rest of the code is ut61 specific.<br> <br> That 30 sloc needs to set a few things that only this specific device <br> needs: a fixed baud rate, a combination of RTS and DTR to power the <br> adapter. Of course you could bloat up this 30 sloc into 300 to have <br> everything configurabxle, but then you just have a wrapper around termios, = <br> just an excess layer. It's easier to use termios directly.<br> <br> For the USB part: normally any usb serial converter would just have a <br> driver so you get a tty device. That's the abstraction of UNIX. Looking= <br> at the sigrok code, this USB HID is just reimplementing the usual serial <b= r> port stuff, baud rate, parity, then read and write bytes. Instead of <br> inventing yet another software layer above libusb and termios, the proper <= br> solution would be to write a serial driver for this device or if a driver <= br> is overkill, emulate it over pty.<br> <br> <br> Best regards,<br> <br> Igor2<br> </blockquote></div> --0000000000008084e005cb2e28d1--
Reply subtree:
5117 Re: [pcb-rnd] [electronics] minilib and utility for DMM serial proto from Majenko Technologies <ma...@majenko.co.uk>