From: ian Date: Wed, 21 May 2008 16:48:29 +0000 (+0000) Subject: wip multiplexer spec X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=9ebc70edf766f67781cc0fef0ed5a534533ac81a;p=trains.git wip multiplexer spec --- diff --git a/hostside/README.commands b/hostside/README.commands index f249a82..fdb6e6c 100644 --- a/hostside/README.commands +++ b/hostside/README.commands @@ -1,27 +1,34 @@ Protocol over new hostside stdin and to multiplexer: + U< ?... means realtime prints that message without any ? + when reflected by multiplexer, one of - + & + is prepended, as follows + - result of command by another client + + result of command by us + & asynchronous + ====================================================================== POSSIBLY-ASYNCHRONOUS REPORTING OF MESSAGES TO/FROM (MASTER) PIC - U< picioh out [...] + U< ?picioh out [...] In principle, all output to PICs, in raw form, but subject to suppression - U< picioh in junk [...] - U< picioh in aargh [...] - U< picioh in hello [...] - U< picioh in off [...] - U< picioh in toolong [...] - U< picioh in msg [...] + U< ?picioh in junk [...] + U< ?picioh in aargh [...] + U< ?picioh in hello [...] + U< ?picioh in off [...] + U< ?picioh in toolong [...] + U< ?picioh in msg [...] - U< picio out polarity <[[,...]]> literal < and > bracket segs - U< picio out unknown data printed in assoc'd picioh + U< ?picio out polarity <[[,...]]> literal < and > bracket segs + U< ?picio out unknown data printed in assoc'd picioh - U< picio in [] - U< picio out [] + U< ?picio in [] + U< ?picio out [] - U< picio in-info detect 0|1 decoded `picio in detect[01]' + U< ?picio in-info detect 0|1 decoded `picio in detect[01]' Suppression (see parse-proto-spec and realtime.c:serial_transmit) nmra data ping/pong special in other out @@ -31,35 +38,37 @@ POSSIBLY-ASYNCHRONOUS REPORTING OF MESSAGES TO/FROM (MASTER) PIC -v2 suppressed cooked raw with type cooked -v3 both both raw with type both - U< resolving + U< ?resolving - U< resolution inexplicable - U< resolution mispositioned head|tail - U< resolution movpos-change-failed / - U< resolution problems + U< ?resolution inexplicable + U< ?resolution mispositioned head|tail + U< ?resolution movpos-change-failed / + U< ?resolution problems - U< stastate + U< ?stastate - U< warning [ ] : - U< warning watchdog : PIC watchdog timer triggered - U< warning spurious : spurious short circuit (fault) etc. + U< ?warning [ ] : + U< ?warning watchdog : PIC watchdog timer triggered + U< ?warning spurious : spurious short circuit (fault) etc. - U< train signalling-problem .... - U< train signalling-problem : + U< ?train signalling-problem .... + U< ?train signalling-problem : - U< train forwards|backwards at [-]:+- - U< train has [-][/].... + U< ?train forwards|backwards at [-]:+- + U< ?train has [-][/].... is * for det_expected ! for foredetect @ for det_ignore - U< movpos feat point|relay - U< movpos position moving - U< movpos position stable + U< ?movpos feat point|relay + U< ?movpos position moving + U< ?movpos position stable may be ? for unknown - U< debug : - U< info : + U< ?debug : + U< ?info : + +MESSAGES TO SIMULATION LOG S picioh in suppressed [...] S command-in .... @@ -72,15 +81,68 @@ COMMANDS AND RESPONSES P> [...] results in: - R< executing [...] + R< ?executing [...] consequential messages including picio, signalling problems etc. then one of these - R< ack ok - R< ack - R< ack [] : ... - R< ack SignallingPredictedProblem \ + R< ?ack ok + R< ?ack + R< ?ack [] : ... + R< ?ack SignallingPredictedProblem \ |? : ... + when these come through the multiplexer, everything which is a + result of _other_ clients' activities, between and + inclusive, is prefixed with `-' if they are not due to + this client or `+' if they are. + + Some commands have ! at the end of their name + - that means they are privileged. + +====================================================================== + +MULTIPLEXER FACILITIES + + M< = indicates messages to and from the multiplexer about this + M> = specific client connection + + M< =connected + M< =permission normal|super + or + M< =denied + and later perhaps + M< =failing : + otherwise there is no need to quit - just send eof + + M< =select [~]... + first match wins; ~ discards the message; if nothing matches, + all are selected; patterns are matched against message with + _ replacing spaces and added to the end; patterns which contain + no * have _* appended; default is ~debug; total pattern length + is limited for safety and if it is too long it is truncated. + M> =select + + M< =replay [~]... + +broadcast messages start with % + + C> $replay% [!] + + M< %[!] ... depends on + must be [a-z][-0-9a-z]* + M> %[!] ... echoed to all clients + + +MULTIPLEXER-IMPLEMENTED FUNCTIONALITY AFFECTING WHOLE SYSTEM + + P> $[!] ... + R< ?executing $[!] + R< ?ack $[!] ok + + C> $realtime! kill|finish|start|start-manual + C> $save! + + C> $reserve + ====================================================================== DIRECT NMRA AND PIC INSTRUCTIONS @@ -106,8 +168,3 @@ DIRECT NMRA AND PIC INSTRUCTIONS !pic = and !nmra _ do exactly the same. - - - -ack ok commandname -ack errorcode commandname