Logiweb(TM)

7.16.2 Extend requests

Prev Up Next Page 273 of 800 Search internet


The base page defines a constant named lgcio-interface. The value of lgcio-interface is a long string (22975 characters) which contains a valid C-source. To see the string click here.

Rather than defining a function named 'main', the lgcio-interface defines a function named 'trigger' which Logiweb uses for communicating with the interface.

To use the lgcio-interface, one has to load it and to associate a message type to it. This is done using an extend request.

The extend request for loading the lgcio-interface has the following form:

<< << 0 ,, !"extend" >> ,, << << r ,, i >> ,, v >> ,, lgcio-interface >>

The values of r and i must be integers. The value of v is ignored.

Once a Logiweb machine has executed the extend request above, it can use << << r ,, i >> ,, v >> as a new request type. The values of r and i must be the values given in the extend request. The value of v is interpreted as a vector tree.

When the Logiweb machine sends a << << r ,, i >> ,, v >> request, all bytes in v are sent to the interface one by one using the trigger function. What the trigger function does to those bytes is up to the trigger function.

The trigger function must have the following signature:

   int trigger(int c)

Each byte c is transferred to the interface by calling trigger(c) and ignoring the return value. Bytes are naturals in the range 0..255.

When all bytes in v are sent, the machine prompts the interface for a reply. It does so by calling trigger(-1) successively until it returns -1. All return values before the -1 must be bytes, and the machine forms a singleton list s of those bytes. Then the machine forms a reply message of form << << r ,, i >> ,, s >>.

Prev Up Next Page 273 of 800 Search logiweb.eu

Copyright © 2010 Klaus Grue, GRD-2010-01-05