home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / utils / sercli.shr / sercli / doc / ToDo < prev   
Encoding:
Text File  |  1993-06-14  |  14.8 KB  |  332 lines

  1. **  Fix EOL translation to be smarter on data received from the .device &
  2.     add translation code for FIFO->.device
  3.  
  4.     In the same breath, could make EOF a configurable key, rather than
  5.     binding ^\, and allow for arbitrary i/o translation tables...
  6.  
  7. **  Currently, all data from FIFO is immediately put into a buffer
  8.     (allocating one if necessary) and that buffer is sent to the .device.
  9.  
  10.     The buffer is of fixed size.  No effort is made to glom multiple chunks
  11.     of data from FIFO into a single .device i/o request.
  12.  
  13.     This obviously is going to be bad for memory fragmentation (only a few
  14.     bytes used in large buffers attached to IOExtSer structures), and may
  15.     be bad for performance (by creating a bunch of i/o requests
  16.     w/relatively little data).
  17.  
  18. **  FIFO EOF has two big problems:
  19.     **    Current mechanism (close_fifo() immediately followed by an
  20.     open_fifo() ) results in a way-ward FIFO connect.  For some reason,
  21.     it works okay if I exit sercli & restart, but just doing the
  22.     close_fifo()/open_fifo() isn't enough.  It's possible that there's
  23.     a consideration of time-delay...
  24.  
  25.     **    Whether you call the above a bug, per se, in sercli, I can almost
  26.     certainly fix it.  However, another problem exists: EOF is only
  27.     generated by FIFO if _all_ writers have closed the FIFO and at
  28.     least one used the FIFOF_EOF flag when closing.  As long as I have
  29.     a RemCLI open on the same FIFO as sercli, FIFO will NOT generate an
  30.     EOF for sercli, thus CD/^\ events cannot be reliably handled with
  31.     current FIFO versions.    If a new version of FIFO cannot be had to
  32.     fix this, I may have to simply use DOS Packets.
  33.  
  34. **  Add a ^C (or some such) check to sercli so that it can be aborted at
  35.     any time even without ARexx or Intuition access to it?  (By `^C', I do
  36.     not mean the .device<->FIFO i/o monitoring; I mean look for a
  37.     SIGF_BREAKC (or whatever) signal, of course.)
  38.  
  39. **  Add controls (via both config & ARexx) for turning on/off the ^[c-f]
  40.     DOS breaks.  Relatedly, add ^\ -> EOF conversion.  Lastly, monitor CD
  41.     (OPTIONALLY); if CD is gone, then do something drastic like send all 4
  42.     standard break signals, SIGF_ABORT, and an EOF all in concert.
  43.     [CD should now be monitored; currently only generates an EOF, and
  44.      then not correctly (see above); also have done ^\ -> EOF
  45.      conversion, but have similar problems.]
  46.  
  47.     (This somewhat ties into the later (chronologically earlier) suggestion
  48.      of `on: serial: no carrier: ...'.)
  49.  
  50. **  This file is disorganized.    Maybe I should experiment with putting it
  51.     into HyperText form?  *grin*  (Or else re-structure the thoughts I
  52.     ramble on about...)
  53.  
  54. **  Make naming conventions more consistant.  In particular, make the
  55.     serial.c functions all of one form (e.g., <verb>_<noun>_<modifier>,
  56.     such as open_ser(), write_ser_asynch()...)
  57.  
  58.     Clean up the names in the source (the serial.c file was mostly written
  59.     over a period of about a week, last spring, and I picked at least one
  60.     or two truly horrible names for types/variables...*grin*).
  61.  
  62.     (Mostly satisfactory, for now...)
  63.  
  64. **  Add some kind of intelligent error handling for i/o...
  65.  
  66.     (Started already; see errors.[ch].  Not really ideal, but will work for
  67.      my immediate needs.)
  68.  
  69.     (Mostly staisfactory, for now...)
  70.  
  71.     (However, a generic event-handler, or my rkr.lib is pro'ly next up; it
  72.      could then become the ARexx/config/error handler for sercli.)
  73.  
  74. **  XPR support...
  75.  
  76. **  Make sercli _not_ exit when an EOF comes down the pipe (FIFO:).
  77.     (Shouldn't be too hard to add.)  This way, programs can be run to use
  78.     FIFO:, and after they terminate, sercli will persevere.  The point is
  79.     to permit the "main" program to use ARexx i/o, if desired, but to
  80.     launch other programs (such as a compiled C or interpreted LISP or
  81.     SCHEME program) as plain stdio users; when the "plain stdio users"
  82.     exit, the "main" program can resume, safely assuming that sercli is
  83.     still around.
  84.  
  85.     This of course requires that an ARexx command be defined ('quit'?) to
  86.     cause sercli to die alogether.  Relatedly would be serial i/o support
  87.     directly through ARexx message ports, and control of who sees how much
  88.     of what. See elsewhere.
  89.  
  90.     Alternative/intermediate fix: Don't use the 'e' flag with FIFO:.  By
  91.     not using the 'e' flag, FIFO: will not pass the EOF event on to sercli,
  92.     and so sercli will not notice.  Note that sercli will still try to send
  93.     stuff through FIFO:, and FIFO: may conceivably back-up and overflow.
  94.     Controls to cause sercli to stop sending data to FIFO:, and to avoid
  95.     overflow problems, need to be put in eventually.
  96.  
  97.     [No, this isn't necessary; just use rlaunch to run programs under
  98.      sercli; that way, when they end their shell, FIFO can keep on
  99.      going.]
  100.  
  101. **  ASK on AMIGA_PROG if {io_Baud} (etc.) can be set on open, or only by
  102.     SDCMD_SETPARAMS.  (1.3 autodocs describes SERF_XDISABLED as being the
  103.     only bit "that can be changed via a SetParams call while the device is
  104.     active," while L&D states that it (along with SERF_SHARED and
  105.     SERF_7WIRE) "must be set before open."
  106.  
  107.     Related: It does not seem that all serial configurations are being set.
  108.     I need to try a SDCMD_QUERY, and see what that brings me.
  109.  
  110.     ---
  111.  
  112.     Asked; response was not of much real (authoritative) help.
  113.  
  114.     ---
  115.  
  116.     Also, error-handler does not handle cases for serial error being
  117.     out-of-range (a table of 15 codes (1-15), taken from RKM:L&D, is used;
  118.     if a too-low, or too-high error code comes through, the results are
  119.     undefined.    (This is not so much a problem with serial.c as with
  120.     sercli.c, although perhaps I should toss the serial error-handler into
  121.     serial.c...)
  122.  
  123. **  Buffer FIFO: to avoid problems with blocking i/o?
  124.  
  125. **  Make i/o available through the ARexx port (rather than, or in addition
  126.     to, through FIFO:...provide _both_ streams to the script?  (on script's
  127.     request?) ), in one manner or another (right now, all programs must use
  128.     FIFO:, which I've found results in some weird necessities for clean
  129.     launch/cleanup).
  130.  
  131.     I should, then, be able to provide a "timeoutable" read command, which
  132.     would be very cumbersome to implement through ARexx scripts using stdio
  133.     (not impossible, though)...
  134.  
  135.     Additionally, being able to "turn off" serial output, serial input,
  136.     FIFO: input, FIFO: output, and even the ARexx port input & output would
  137.     be a nice feature (thus, a "master" ARexx script could turn off it's
  138.     own input from sercli, launch a shell command, and turn on the FIFO:
  139.     i/o, then wait for the program to complete, whereupon it would disable
  140.     FIFO: i/o, re-enable its own i/o, and pick up where it left off).
  141.  
  142.     (Turning "off" ARexx input does not mean that additional commands
  143.     (e.g., turning ARexx input back on, "bps: <n>", etc.) would not be
  144.     honored, only that no input from the modem could be received through
  145.     the ARexx port, even when requested, until ARexx input is turned back
  146.     on...)
  147.  
  148. **  Make a command/config option for setting the _format_ of the displayed
  149.     text line, plus selecting the "visual flags" to display.
  150.  
  151. **  Commands have been advanced somewhat.  See above for idea about
  152.     allowing ARexx commands to handle the i/o as well as permitting stdio
  153.     (stdio has several limitations that an ARexx command interface need not
  154.     be bothered with.)
  155.  
  156.     The below list does not represent the current set of commands (a set of
  157.     serial config commands are supported (but not much tested) ).
  158.  
  159.     ---
  160.  
  161.     Right now, the ARexx commands are in a disarray.  What is desired is:
  162.     set remote status: <remote status>
  163.     set window size: <x> <y>
  164.     set window position: <x> <y>        ;; really need this?
  165.     set window title: <full title>        ;; really need this?
  166.  
  167.     Could also convert into functions, or at least get rid of the ':' char.
  168.  
  169.     Each would return a string to represent the 'old' information (the old
  170.     remote status, the old x/y position, etc...).
  171.  
  172. **  ISSUE:  There were, once, synonyms for many of the keywords supported
  173.     (e.g., "bps" and "baud" were treated identically; now, only "bps" is
  174.     supported and "baud" should cause an error). Would it be desirable to
  175.     put the synonyms back in?
  176.  
  177. **  [Hmm...  I think I _do_ want to use a serial-init structure, despite
  178.      the immediately-following comment.  It would make serial.c independant
  179.      of sercli, as it should be. [further thought: No, use ANSI C variable
  180.      args on the stack...much better] ]
  181.  
  182.     Change open_ser() to take a pointer to a serial-init structure (and put
  183.     "globals" in there, so that multiple ports could be open
  184.     simultaneously?  Hmm....that would require giving a param to
  185.     close_ser(), as well...).  (NO, just run sercli multiple times!)
  186.     (Globals are used for the config controls.  Maybe eventually put this
  187.     stuff in a clean structure (or IFF FORM (is FORM the right thing for a
  188.     config file, necessarily?) & use a binary config file (set with an
  189.     Intuition-based tool, like jconfig, jinit, or Preferences).)
  190.  
  191. **  [This may go in at the same time I allow the ARexx port to reconfigure
  192.      its own name & the fifo name...  Which means I might do it. *grin*]
  193.  
  194.     Perhaps allow ARexx script to cause sercli to shut down serial.device &
  195.     reopen under a new device name/unit?
  196.  
  197.     (Really trivial to add this, since "hard" parameter changes already
  198.     require that the serial port be shut down...)
  199.  
  200. **  Some kind of control for what to happen if we lose carrier...?
  201.     on lost carrier: <command>
  202.  
  203.     Or something more generic, even?
  204.     on string: <string>: <command>
  205.     on event: <event type>: <response>
  206.     on: <general>: <specific>: <response type>: <detail>
  207.  
  208.     Examples of the last may be:
  209.     on: serial status: no dtr: sercli: exit
  210.     on: serial string: CARRIER DETECT: rexx: launch_bbs.rexx
  211.     on: serial string: name?: send: Richard Rauch
  212.     on: window event: close: sercli: exit
  213.         (This would exclude ':' from occuring in the <string>s, unless
  214.         things were made substantially(???) more complicated...)
  215.  
  216.         Or just have sercli send up a BREAK (^[c-f]) and assume that
  217.         the program running under the shell will know what to do?
  218.  
  219.         The problem with responding on certain strings is that for
  220.         every byte that comes in, checks would have to be made to see
  221.         what state to put things in.  With several strings being
  222.         monitored, this could slow things down.  One _could_, of
  223.         course, assume that the text-to-check represents a whole line,
  224.         or the tail-end of a line...or perhaps not-so-cumbersome state
  225.         machine could be set up to handle it...
  226.  
  227.         Or, assume that these (at least the string responses) are
  228.         always to be to prompts from a BBS, so we could only need do
  229.         such a check after a pause in the input stream, and then only
  230.         on the last line (or last <n> bytes/lines?).
  231.  
  232.         Some way of turning off these on:... events is needed.  I think
  233.         something of the following form would be a desirable way to
  234.         remove the "event monitor" for an inbound serial string of
  235.         "name?":
  236.         on: serial string: name?: nop:
  237.  
  238.         (Note, one "fewer" params/keys, here.  After "nop:", nothing is
  239.         needed (no detail is needed for a "nop:").
  240.  
  241.         Possibly, some others (like exit) could be placed in the same
  242.         sense as "nop:".  Also, perhaps it would be a good idea to
  243.         fully endorse the idea of trailing colons being unecessar (so
  244.         long as there are no spaces between the last keyword and the
  245.         eol).  Perhaps also cause colons to be always used as
  246.         delimiters.
  247.  
  248.         (This would suggest allowing an "escape" convention for
  249.          colons...)
  250.  
  251.     I suspect that all of this is getting _much_ too general for what I
  252.     want to do, but it's a thought to keep in mind, at least for now.
  253.  
  254. **  Change how config stuff is handled so that config & ARexx commands can
  255.     dispense with the ':' character (as a special character, anyway).
  256.  
  257.     On the other hand, a colon is as good as any other character for
  258.     delimiting tokens -- unless one forces the user to enter all tokens as
  259.     single words or has a rather elaborate command processor.
  260.  
  261. **  Some visual flags to represent the serial line state?
  262.  
  263.     Also make the window default to 640 pixels across?
  264.  
  265. **  Change program name to sersh or sershell?
  266.  
  267. **  Maybe the line-oriented serial read should support some line-editing
  268.     (like allow <BACKSPACE> to remove chars from the buffer, and ^x to
  269.     clear the entire buffer).
  270.  
  271.     NAH.  Let the FIFO:, or shell do that cooking.  Maybe when (if)
  272.     serial.c gets split off into its own .lib, this would be worth doing.
  273.     Not right now, though.
  274.  
  275. **  Handling of serial.c defaults is pro'ly not correct, as I think on it.
  276.     I.e., sercli's internal defaults are rammed, unconditionally, into the
  277.     serial.device via SDCMD_SETPARAMS.    This means that Preferences
  278.     settings will always get overridden with internal sercli defaults
  279.     (whoops).
  280.  
  281.     I should address this either by using taglist type things, or else by
  282.     using flags to indicate what is to be set/not set.
  283.  
  284.     Relatedly, after setting serial params, all i/o requests should pro'ly
  285.     be updated with the new contents; not sure, but it can't hurt much.
  286.  
  287.     Parity and hardware/software flow control handshaking defaults should
  288.     be changed to be defaulted by Preferences (and DOCUMENTED as defaulted
  289.     by Preferences...)
  290.  
  291. **  Remove some globals (particularly serial.c's configuration globals, but
  292.     perhaps others as well...).
  293.  
  294.     This would be in preperation for breaking portions off into a seperate
  295.     .lib.
  296.  
  297. **  Make read_sercli_config() take a file name param, so that it can be
  298.     completely generalized, and used as readily in `sercli' as in a `door?'
  299.     Also change name to read_config()?
  300.  
  301. **  Break out serial.c, and others, into a seperate dir (make part of
  302.     a custom lib) so that their maintenance can occur external to sercli.
  303.  
  304. **  Break up sercli.c and maybe serial.c; they are a bit on the large side
  305.     for my taste.  (Clear some junk out of main(), by putting some func's
  306.     in other files, maybe put all the fifo handling stuff in a fifo.c
  307.     file?)
  308.  
  309. **  RCS maint. is not yet tested.  It should no longer _force_ all files to
  310.     be re-done.  Different RCS files should be permitted to have different
  311.     RCS versions & still retain the same symbolic name.
  312.  
  313.     The `changes' files are no longer used as automatic references for RCS
  314.     `update messages'.
  315.  
  316.     The biggest problems:
  317.     **    No automatic version bumping, yet (aside from the "meaningless" ?.?
  318.     numbering that RCS does for every ci).    Fortunately, esssentially
  319.     only one symbol ({name}, in the src/dmakefile) need be manually
  320.     updated.
  321.  
  322.     I dislike having to modify the dmakefile just to update the
  323.     version-number; I should export the version info permamently into
  324.     some other file, I guess...
  325.  
  326.     **    Because some info is duplicated across more than one "changes"
  327.     file, the doc/changes.text file can have a lot of redundancy if not
  328.     manually trimmed.
  329.  
  330.     (E.g., the FifoName string was in a series of files; converting it
  331.      to prog_id affected several files...)
  332.