⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yaps.html

📁 使用Modem发送网上传呼
💻 HTML
📖 第 1 页 / 共 3 页
字号:
The options <em>-d</em> and <em>-e</em> accept a date representation whichmust be (according to option parsing) one argument, e.g. if it containsspaces it must be quoted. If the first character of date is a plus(<strong>+</strong>) sign, then the date is taken as an offset to thecurrent time. All further definitions are seperated by spaces:<Ul><Li> &lt;hour&gt;<strong>:</strong>&lt;min&gt;<strong>:</strong>&lt;sec&gt;<Li> &lt;day&gt;<strong>.</strong>&lt;month&gt;<strong>.</strong>&lt;year&gt;<Li> &lt;month&gt;<strong>/</strong>&lt;day&gt;<strong>/</strong>&lt;year&gt;<Li> &lt;numeric&gt; if less than 30 is taken as the hour<Li> &lt;numeric&gt; if greater or equal than 30 is taken as minutes</Ul><H1 ID="syntax">Sending/Expecting Syntax</H1>Whenever communication over the serial line takes place the send/expectfunctions are comming into play. There are three important functions, whichare called from several parts: sending of data, expecting data and asend/expect function. Each is explained in detail here (including thesupported syntax):<H2>Sending</H2>Sending itself is nothing fancy, just all data will be written to the serialline.<H2>Expecting</H2>Expecting means to wait for some pattern to arrive. It is possible to expectmore than one sequence and the function returns the matching entry, atimeout or an error condition.<H2>Send/Expect</H2>Most communication parts call this function (which then calls the functionsabove.) This function requires a string with tokens seperated bywhitespaces. A token may contain whitespaces, if the token is enclosed insingle or double quotes. These quotes (as any other quotes) are removedduring the preparse. The first character of the token is relevant for themethod to be executed. Each token is preparsed to remove/interpret specialcharacters. Following special characters are interpreted:<Ul Compact><Li> Backslash <strong>\</strong><BR>The backslash is used to escape any other special character (inclusivequotes and the backslash itself) or to insert typical control characters.These are supported:     <Ul>     <Li> \a -&gt; Bel     <Li> \b -&gt; Bs     <Li> \f -&gt; Ff     <Li> \l -&gt; Lf     <Li> \n -&gt; Nl (system depended)     <Li> \r -&gt; CR     <Li> \s -&gt; Space     <Li> \t -&gt; Tab     </Ul><Li> Up arrow <strong>^</strong><BR>This is used to insert control characters, e.g. ^M means CR.<Li> Percent <strong>%&lt;nr&gt;</strong><BR>This inserts optional paramter <strong>nr</strong>, if supplied.</Ul><P>These character initiate the behaviour of the token:<Dl><Dt> <strong>&lt;</strong> Expect<Dd> The rest of the token is for expecting. If the token contains<strong>-</strong> then the token is split again and each subtoken istreated as expect/send, if the expect failed. The expect token may beseperated by <strong>|</strong> to indicate alternatives. The expect isfailed, if an error occurs, a timeout arised or not the first alternativesmatches. The <strong>&lt;</strong> may be appended by a numeric value, whichis used as the timeout in seconds.<Dt> <strong>!</strong> Command<Dd> To insert dynamic commands into the sequence use this construct.Following is an optional numeric value <strong>n</strong> and a commandcharacter. If <strong>n</strong> is not set, its default value is one.Following characters are supported:     <Ul>     <Li> d - sleep <strong>n</strong> seconds     <Li> D - sleep <strong>n</strong> miliseconds     <Li> b - send break (length depends on <strong>n</strong> and the	  implementation)     <Li> h - hangup the line (lowering DTR by <strong>n</strong> * 0,5	  seconds.)     <Li> o - waits for output to drain     <Li> &lt; - flushes the input queue     <Li> &gt; - flushes the output queue     <Li> f - forces the sequence to fail     <Li> s - forces the sequence to succeed     </Ul><Dt> Any other character<Dd> This string is just send to the remote side.</Dl><H1 ID="script">Scripting</H1>Scripting has the advantage (compared to the ASCII protocol) that one ismore flexible. As there are a lot of scripting languages around, there willbe no specific one for this package. As long as such a language isembeddable into C programs, it should not be too complicate to integrate itinto this package.<P>This section explains the additional function (or simular) for the availablescripting languages. The syntax itself is explained in the distribution ofeach scripting package.<H2>SLang</H2>Beside the new functions there is an extension to the string class, so youcan use (beside others) the plus sign to concaternate strings. One time thispart should make its way into the main SLang distribution.<H3>Variable index</H3><Dl><Dt> int NO_ERR;<Dd> This is the return value for a function, that ended successful.<Dt> int ERR_FAIL;<Dd> This is the return value for a function, that encountered an error, butwhich allowes the script to continue.<Dt> int ERR_FATAL;<Dd> Dito, but the script should not continue any more.<Dt> int ERR_ABORT;<Dd> Dito, but no further action should take place.<Dt> int rds;<Dd> Is set to <em>True</em>, if a delivery status should be requested.<Dt> int delay_day, delay_mon, delay_year, delay_hour, delay_min, delay_sec;<Dd> This is the time/date to delay the delivery of the message.<Dt> int expire_day, expire_mon, expire_year, expire_hour, expire_min, expire_sec;<Dd> This is the time/date to expire a buffered message.<Dt> int False;<Dd> The numeric value for False.<Dt> int True;<Dd> Dito for True.</Dl><H3>Function index</H3><Dl><Dt> void setcb (string func, string sep);<Dd> This enable the line callback facility and stores each line into alocal variable, which will be overwritten after each new encountered line. Aline is considered as complete, if one character in <strong>sep</strong> isreceived. If <strong>func</strong> is the name of a defined function, thenthis function is called on every completed new line. The line is passed asthe paramter to this function.<Dt> void clrcb (void);<Dd> Clears the line callback facility.<Dt> string line (void);<Dd> Returns the last complete read in line, if the line callback facilityis enabled.<Dt> void hangup (void);<Dd> Tries to hangup, if the modem is currently off-hook. This is done bylowering the DTR line.<Dt> int send (string str);<Dd> Sends the string to the remote side. Returns <strong>True</strong> onsuccess, <strong>False</strong> otherwise.<Dt> int csend (string str);<Dd> Dito, but the string is converted before it is sended to the remoteside.<Dt> int expect (int tout, string str1, ..., string strn, int cnt);<Dd> The function waits <strong>tout</strong> seconds until one of thestrings is received. If no string is received, <strong>0</strong> isreturned, <strong>-1</strong> on error. Otherwise the number of the stringis returned (<strong>1</strong> for <strong>str1</strong>,<strong>2</strong> for <strong>str2</strong>, etc). <strong>cnt</strong> isthe number of strings to wait for.<Dt> int send_expect (int tout, string expr);<Dd> This function executes the <strong>expr</strong> with its internalsend/expect evaluater and returns <strong>True</strong>, when the sequencehad been executed completely, otherwies <strong>False</strong>.<Dt> void drain (int secs);<Dd> This function reads and discards any character for<strong>secs</strong> seconds.<Dt> void cvdef (int src, int dst);<Dd> Defines a converion rule. Every character <strong>src</strong> will bereplaced by <strong>dst</strong>. The conversion is used in <em>csend()</em>.<Dt> void cvundef (int ch);<Dd> Undefines the conversion rule for <strong>ch</strong>.<Dt> void cvinval (int ch);<Dd> Marks the character <strong>ch</strong> as invalid.<Dt> string conv (string str);<Dd> Converts the string <strong>str</strong> using the defined conversionrules and returns the converted string.</Dl><H2>Lua</H2><!-- TODO! --><H1 ID="sample">Examples</H1>Here are some examples that may help you to understand the software a bitbetter. First you should read the example configuration file <a href="yaps.rc">yaps.rc</a>. This could be used as a base for your ownglobal configuration file.<H2>Calling</H2>Typically the program is called <strong>yaps &lt;pagerid&gt;&lt;message&gt;</strong>. <em>pagerid</em> is either the exact pagerid ofthe receiver or an alias found in the alias section. <em>message</em> is themessage to send by itself. If a pager-id leads to more than one provider,then the first is used. To force a special service use the <strong>-s&lt;service&gt;</strong> switch.<H2>Script protocol</H2>In the contrib directory, you can find <a href="contrib/tap.sl">tap.sl</a>,an example on how to use the scripting facility to emulate a protocol. Thisis a minimal, but working reimplemetation of TAP.<H1 ID="chlog">Changelog</H1>This is a list of changes:<Ul Plain><Li> 9. May 1997: V 0.90 released     <Ul Compact>     <Li> Minor cleanup on calling sending routines     <Li> Added optional multiple receiver per message     <Li> Changing UCP to prepare the real implementation     <Li> Preparing the creation of a client/server solution     <Li> Compile configuration moved to seperate file      </Ul><Li> 13. May 1997: V 0.91 released     <Ul Compact>     <Li> Converted `char *' to `string_t *' in several places     <Li> Added max-messages configuration option     <Li> Moved some configuration stuff to config.h     <Li> Got UCP docu! Implemented it partial (as much as it makes sense)     <Li> Added option -d/-e as UCP (in extended mode) can support it     <Li> Added special date handling functions for this purpose     <Li> Changed copyright to the GPL     <Li> Use transparent data in extended UCP, if characters with          set 8th bit are found     <Li> Better message splitting     <Li> Added some sanity checks     </Ul><Li> 22. May 1997: V 0.92 released     <Ul Compact>     <Li> Added handling of configuration variants     <Li> Added include option in configuration files     <Li> First bugs encountered by tester fixed     <Li> Message can now be read from stdin, if message == '-'          (idea by &lt;markus@mail.yezz.de&gt;)     <Li> Message can now be empty, if message == '.'     <Li> Minor bugfixing/Makefilehandling (reported by Frank K&auml;fer)     <Li> Enhanced lockfile handling, including SysV4 lockfiles (inspirated	  by Frank K&auml;fer)     <Li> Total rewrite of UCP sending     </Ul><Li> 26. May 1997: V 0.93 released     <Ul Compact>     <Li> UCP works again including delivery report     <Li> Added checking of pager id for a service     <Li> Added signature in configuration file     <Li> Added value start escaping with backslash     <Li> Changed checking of pager id for service     <Li> Automatic assign of a pager id to a service     <Li> Could now handle more than one service at one call     </Ul><Li> 30. May 1997: V 0.94 released     <Ul Compact>     <Li> Workaround for serial bug in sunos/solaris (by Frank K&auml;fer)     <Li> If the system does not support Posix regular expression, a simple          replacement is added     <Li> More comments in yaps.rc (as wished by Frank K&auml;fer ;-)     <Li> Change handling of control chars in TAP/pre V1.6 (hint by          &lt;markus@mail.yezz.de&gt;)     <Li> Added default conversion rules     <Li> Added force/-f     <Li> Added long options support     <Li> Added getopt() for systems without this function     <Li> Added valid-cid/change-cid/rm-invalids-cid/rm-invalids-pid     </Ul><Li> 3. June 1997: V 0.95 released     <Ul Compact>     <Li> Added final status report     <Li> Added a 2nd checking scheme     <Li> Added support for lua (another scripting language)     <Li> Removed porting approach, should be done by someone who	  has access to such an OS.     <Li> Added reading of pager-id/message pairs from file     <Li> Added cost calculation     <Li> Enhanced logfile handling     </Ul><Li> 14. June 1997: V 0.96 released</Ul></Body></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -