Hinweis für die Textformat-Version; um diese Version im PDF Format zu lesen, laden Sie bitte https://www.dk1ri.de/myc/Rules.pdf MYC Rules Author: DK1RI Version V01.02.03 20240416 This project can be found in https://github.com/dk1ri also. Introduction This paper describes the syntax of rules of the MYC system. For more details of the MYC system please check the reference. Definitions and formats see https://dk1ri.de/myc/Definitions.txt or https://dk1ri.de/myc/Definitions.pdf Some explanation Rules announcements start with “R” or “S” or “Q” “R” rules are valid always, “S” rules are used during configuration only and are not forwarded by the CR. “Q” rules are used for login. Rules are defined by FU and RU. A “R” / “S” rule may have one of these functions: ? A rule may restrict a combination of parameters of a command. This cannot be defined by an announcement. ? By default all commands are working always. A rule will show, when a command is not working, if other commands had created a specific status. Some commands are working under special conditions only (not always) ? By default commands are not executed by change of a status of another command. A rule can initiate this: eg the device can be switched off under special conditions. It is not the intention to show all conditions. If a device is switched off, some values may be set to “0”. Such a behavior is obvious and a rule may be used in specific cases only. - A rule can modify the semantic of a command ie the real values of a command under given conditions. These rules are used by the LD, which have the status of the system at any time and know all rules and modify / initiate commands accordingly. The SK should observe rules given for a device. This avoids sending not valid commands. Some limitation within a command should be described within the announcement of that command by . A FU will have rule announcements to inform about dependencies, which exist between the commands and status within the FU. If there are dependencies between different devices, a special rules-device RU will provide these rules. The rule will define, whether one or more commands are active or not, or that another command is executed. The syntax of the rules should be very simple. Up to now rules lines are readable, because they must be easily programmed as a part of the announcements of FUs. All “R” rules are always handled by the LD in the sequence it get the rules, starting with rules of FU. General Rules behavior “R” , “S” rules Each rule is one announcement line (for FU) or an (MYC string) answer or info of a “an” command (for RU). By default all commands are working. If a command should be disabled, there must be a rule. The rule is R ! … Enabling is done by R !! … If a command should be executed under some conditions only (not always): use R ? … Example is a reset under some conditions. If a command should be executed after another use ? AFTER . Example is a webserver, where a loading command is necessary to read a page. These rules use transmitted values (not real values). Exception, when MIN MAX is used. "Q"-rules “Q” rules are produced by the RU only and sent to the CR only and are not forwarded. They are used by the CR, because the CR knows the interface of the user. They are used for user management. As default the command-router allow all commands on all interfaces. The CR can block or allow commands, if necessary, for a specific user who logged in. "Q"-rules are the answer of a login request and describe the command-token to be used and not used. Format: Q;;[!][ TO ] [….] A basic command-token only means all token of the device. One Q rule per user; but * as username means all users. A !* as commandtoken means all commands are forbidden (default is: all allowed) Syntax is similar to "R" rules. special rules: Q d .. delete rules, sent by RU; * for all. This is an abbreviation, if many empty rules must be sent. The memory elements must be empty. Q * !* send at startup as first rule: login required for all. Default is, that all commands are allowed for all Q * * allow all users all commands (default) Simplification methods These methods are not essential, but may be used to reduce code [$TO$, $] IF|UNLESS .. identical rule for multiple commands. Rules syntax IF|UNLESS “R” “S” rules “Q” rules left side: [![!]$[ &

=[&

=|]] … specific parameters are affected only [![!]$][ ?] … all parameters Bracketing like: !($...) allowed right side: This describes the status which a answer commands would get. [!]$[&

] [ |] ... [!]$[&

] [ TO ] ... All words / tokens separated by a separator Reserved characters / words space separator ( ) bracketing [] left side: groups of commands ! right side: negation, left side: not active $ command following & Parameter following %”...” new real value (override description) ? left side, followed by a command token: active only if / unless .. * one or more characters IF UNLESS AND OR logic operator < > relational operator = left side: operator, right side: equal TO . delimiter for parameter AFTER NECESSARY_FOR + - * / arithmetic operator MIN MAX min / max value of a parameter; right side parameter. All parameters are real values Examples R !$2 IF $5 = 0 means: Command 2 will not work if status of command 5 is 0 R !$4 UNLESS $7 = 3500000 TO 3799999 OR $7 = 7000000 TO 7199999 means: Command 4 will work only unless state 7 is in the range of ............. This would be used if the transceiver will transmit in amateur radio band only The values are transmitted values, not values of R $252&0 = "wrong address" IF $8&3 < 16 $252 is an answer command and handled as info: error-message if fourth parameter (3) of command 8 is < 16 R !$2 IF $2&1 + $2&2 > $2&1MAX The sum of (real) parameter 1 and 2 must not exceed the real maximum value of parameter 1. real value as given by !! Q !* 1 30TO50 commands 1 and 30 to 50 forbidden for all Q * 0TO100 !500TO550 0 to 100 allowed, 500 to 550 forbidden for all Copyright Dieses Dokument darf unverändert kopiert werden. Die Ideen in diesem Dokument unterliegen der GPL (Gnu Public Licence,V2) soweit keine früheren, anderen Rechte betroffen sind. Die Verwendung der Unterlagen erfolgt auf eigene Gefahr; es wird keinerlei Garantie übernommen. This document can be copied without changes. The ideas of this document can be used under GPL (Gnu Public License, V2) as long as no earlier other rights are affected. The usage of this document is on own risk, there is no warranty. Reference [1] https://dk1ri.de/myc/MYC.pdf (german) [2] https://dk1ri.de/myc/MYC.en.pdf [3] https://dk1ri.de/myc/Description.txt or https://dk1ri.de/myc/Description.pdf [4] https://dk1ri.de/myc/commands.txt or https://dk1ri.de/myc/commands.pdf [5] https://dk1ri.de/myc/Reserved_tokens.txt or https://dk1ri.de/myc/Reserved_tokens.pdf [6] https://dk1ri.de/myc/Rules.txt or https://dk1ri.de/myc/Rules.pdf [7] https://dk1ri.de/myc/commandrouter.txt or https://dk1ri.de/myc/commandrouter.pdf [8] https://dk1ri.de/myc/Rules_device.txt or https://dk1ri.de/myc/Rules_device.pdf [9] https://dk1ri.de/myc/skin.txt or https://dk1ri.de/myc/skin.pdf [10] https://dk1ri.de/myc/logicdevice.txt or https://dk1ri.de/myc/logicdevice.pdf [11] https://dk1ri.de/myc/Definitions.txt or https://dk1ri.de/myc/Definitions.pdf [12] https://dk1ri.de/myc/spec_version.txt or https://dk1ri.de/myc/spec_version.pdf [13] https://dk1ri.de/myc/webserver.txt or https://dk1ri.de/myc/webserver.pdf [14] https://dk1ri.de/myc/ki.txt or https://dk1ri.de/myc/ki.pdf [15] https://dk1ri.de/myc/communication.txt or https://dk1ri.de/myc/communication.pdf [16] https://dk1ri.de/myc/Security.txt or https://dk1ri.de/myc/Security.pdf