Grant Edwards wrote:> On 2014-08-05, Tim Wescott <tim@seemywebsite.please> wrote: > >> Thanks Rob. Eventually I may get my head wrapped around all the >> termios stuff, probably ten minutes before I get run over by a beer >> truck. > > If you think the application level termios stuff is a mess, you should > take a look at the serial port APIs in the kernel...If you don't like the termios API you should try the serial port API in Windows. You will love termios thereafter. -- Reinhardt
Linux question -- how to tell if serial port in /dev is for real?
Started by ●August 4, 2014
Reply by ●August 5, 20142014-08-05
Reply by ●August 5, 20142014-08-05
On Tue, 05 Aug 2014 16:15:44 -0700, Paul Rubin wrote:> Tim Wescott <tim@seemywebsite.really> writes: >> All of the desktop serial-port stuff I've done in the last decade has >> been in support of embedded work, ... >> So I'm constrained to C or C++. > > If this is about embedded Linux, Python works great for that.Will Python run on an ARM Cortex M0 with 64k of ROM and 8K of RAM? With room left over for actual application code? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by ●August 5, 20142014-08-05
On Wed, 06 Aug 2014 10:18:06 +0800, Reinhardt Behm wrote:> Grant Edwards wrote: > >> On 2014-08-05, Tim Wescott <tim@seemywebsite.please> wrote: >> >>> Thanks Rob. Eventually I may get my head wrapped around all the >>> termios stuff, probably ten minutes before I get run over by a beer >>> truck. >> >> If you think the application level termios stuff is a mess, you should >> take a look at the serial port APIs in the kernel... > > If you don't like the termios API you should try the serial port API in > Windows. You will love termios thereafter.I know both, to my sorrow. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by ●August 6, 20142014-08-06
On Wed, 06 Aug 2014 10:18:06 +0800, Reinhardt Behm <rbehm@hushmail.com> wrote:>Grant Edwards wrote: > >> On 2014-08-05, Tim Wescott <tim@seemywebsite.please> wrote: >> >>> Thanks Rob. Eventually I may get my head wrapped around all the >>> termios stuff, probably ten minutes before I get run over by a beer >>> truck. >> >> If you think the application level termios stuff is a mess, you should >> take a look at the serial port APIs in the kernel... > >If you don't like the termios API you should try the serial port API in >Windows. You will love termios thereafter.Which one? The traditional one or the TAPI one? ;-)
Reply by ●August 6, 20142014-08-06
Robert Wessel wrote:> On Wed, 06 Aug 2014 10:18:06 +0800, Reinhardt Behm > <rbehm@hushmail.com> wrote: > >>Grant Edwards wrote: >> >>> On 2014-08-05, Tim Wescott <tim@seemywebsite.please> wrote: >>> >>>> Thanks Rob. Eventually I may get my head wrapped around all the >>>> termios stuff, probably ten minutes before I get run over by a beer >>>> truck. >>> >>> If you think the application level termios stuff is a mess, you should >>> take a look at the serial port APIs in the kernel... >> >>If you don't like the termios API you should try the serial port API in >>Windows. You will love termios thereafter. > > > Which one? The traditional one or the TAPI one? ;-)I had to support the traditional API, both on Win Desktop and WinCE. Even these two are different and both are a mess, not only the initialization, but doing the real nonblocking data transfer. In Linux only the initialization is messy with termios. After that it is just a file and can be handled just as any file or socket (select, read, write). -- Reinhardt
Reply by ●August 6, 20142014-08-06
On 2014-08-05, Paul Rubin <no.email@nospam.invalid> wrote:> Tim Wescott <tim@seemywebsite.really> writes: >> All of the desktop serial-port stuff I've done in the last decade has >> been in support of embedded work, ... >> So I'm constrained to C or C++. > > If this is about embedded Linux, Python works great for that.Yea, I didn't understand why the desktop stuff was constrained to be C or C++ just because it was talking to an embedded system. I do a _lot_ of desktop serial port stuff in support of embedded work, and all the desktop stuff is in Python -- and some of it needs response time measured in tens of microseconds. I know a lot of other embedded developers do that as well. -- Grant
Reply by ●August 6, 20142014-08-06
On 2014-08-06, Tim Wescott <tim@seemywebsite.really> wrote:> On Tue, 05 Aug 2014 16:15:44 -0700, Paul Rubin wrote: > >> Tim Wescott <tim@seemywebsite.really> writes: >>> All of the desktop serial-port stuff I've done in the last decade has >>> been in support of embedded work, ... >>> So I'm constrained to C or C++. >> >> If this is about embedded Linux, Python works great for that. > > Will Python run on an ARM Cortex M0 with 64k of ROM and 8K of RAM? > With room left over for actual application code?No, but you said it was _desktop_ serial-port stuff. Your desktop is an M0 with 64K of ROM and 8K of RAM? And it suppors network access and an NNTP client! That is impressive. -- Grant
Reply by ●August 6, 20142014-08-06
On Wed, 06 Aug 2014 13:08:32 +0800, Reinhardt Behm <rbehm@hushmail.com> wrote:>Robert Wessel wrote: > >> On Wed, 06 Aug 2014 10:18:06 +0800, Reinhardt Behm >> <rbehm@hushmail.com> wrote: >> >>>Grant Edwards wrote: >>> >>>> On 2014-08-05, Tim Wescott <tim@seemywebsite.please> wrote: >>>> >>>>> Thanks Rob. Eventually I may get my head wrapped around all the >>>>> termios stuff, probably ten minutes before I get run over by a beer >>>>> truck. >>>> >>>> If you think the application level termios stuff is a mess, you should >>>> take a look at the serial port APIs in the kernel... >>> >>>If you don't like the termios API you should try the serial port API in >>>Windows. You will love termios thereafter. >> >> >> Which one? The traditional one or the TAPI one? ;-) > >I had to support the traditional API, both on Win Desktop and WinCE. Even >these two are different and both are a mess, not only the initialization, >but doing the real nonblocking data transfer. >In Linux only the initialization is messy with termios. After that it is >just a file and can be handled just as any file or socket (select, read, >write).TAPI is different, but only a bit cleaner.
Reply by ●August 6, 20142014-08-06
On Wed, 06 Aug 2014 13:08:32 +0800, Reinhardt Behm <rbehm@hushmail.com> wrote:>Robert Wessel wrote: > >> On Wed, 06 Aug 2014 10:18:06 +0800, Reinhardt Behm >> <rbehm@hushmail.com> wrote: >> >>>Grant Edwards wrote: >>> >>>> On 2014-08-05, Tim Wescott <tim@seemywebsite.please> wrote: >>>> >>>>> Thanks Rob. Eventually I may get my head wrapped around all the >>>>> termios stuff, probably ten minutes before I get run over by a beer >>>>> truck. >>>> >>>> If you think the application level termios stuff is a mess, you should >>>> take a look at the serial port APIs in the kernel... >>> >>>If you don't like the termios API you should try the serial port API in >>>Windows. You will love termios thereafter. >> >> >> Which one? The traditional one or the TAPI one? ;-)If one does not need any telephony related functions, why would one use the TAPI interface ? The basic Win32 CreateFile/ReadFile/WriteFile interface is easy to use. Of course you may also need GetComState/SetComState to set line speed and parity etc.> >I had to support the traditional API, both on Win Desktop and WinCE. Even >these two are different and both are a mess, not only the initialization, >but doing the real nonblocking data transfer.I use to allocate a blocking thread for each serial line. If I need to monitor activity on any of these lines, each thread will set an object when something is received and use WaitForMultipleObjects in the main thread to see which line has some activity.>In Linux only the initialization is messy with termios. After that it is >just a file and can be handled just as any file or socket (select, read, >write).The only reason I like the Linux approach is when a large number of serial lines (more than a few dozen) are needed or there is a need to wait for a mix of real serial ports and serial ports connected trough ethernet/serial converters (using TCP/UDP sockets), this can all be done in a single thread with a single select statement.
Reply by ●August 6, 20142014-08-06
On 6.8.14 05:39, Tim Wescott wrote:> On Wed, 06 Aug 2014 10:18:06 +0800, Reinhardt Behm wrote: > >> Grant Edwards wrote: >> >>> On 2014-08-05, Tim Wescott <tim@seemywebsite.please> wrote: >>> >>>> Thanks Rob. Eventually I may get my head wrapped around all the >>>> termios stuff, probably ten minutes before I get run over by a beer >>>> truck. >>> >>> If you think the application level termios stuff is a mess, you should >>> take a look at the serial port APIs in the kernel... >> >> If you don't like the termios API you should try the serial port API in >> Windows. You will love termios thereafter. > > I know both, to my sorrow. >Tim, I sent an email to you about both - did you get it? -- -Tauno







