TOC PREV NEXT INDEX

Put your logo here!


8 LCU Server for Driver Test Panels

7 The LCU Server part is hidden to the user of the panels. You can skip this chapter, unless you are interested in the internal communication between the panels and the device on the LCU.

The following sections describe the functions of the LCU server part (inducerServer) very briefly. The full documentation for the server commands is included in the CDT help-texts, and for the functions in their respective man-pages. Both are on-line accessible.

8.1 Remote Device Control Operations

Basic driver operations are performed with the OS functions open, close, ioctl, read, and write. The inducerServer provides the means to perform corresponding operations from remote hosts, i.e. it implements the server commands OPEN, CLOSE, IOCTL, etc. 1 which take similar arguments and return similar values as their OS-function counterparts.

In addition to this, the IOCTL command is very flexible, and allows to perform nested ioctl function calls by giving multiple repeated parameters to the command.

8.2 Device Monitoring

The command MONITOR spawns a separate task that periodically performs an ioctl operation to the device, compares the result with the previous one, and sends back a reply when it is different.

In the LCU's task list, the spawned task appears as `lccMONITOR'. There can be one monitor-task for each device, to which a panel is connected.

The SETMON command is used to initialize and terminate the MONITOR task.

8.3 Remote Function Calls

The EXEC server command can in some respect be compared with the exec command in Tcl. It executes a specified function on the LCU and returns the standard output produced, and additionally the function's return value. This has almost the effect of a remote VxWorks shell; however, currently only simple integer arguments can be passed to the funtion, no parsing is implemented.

The called functions are executed in the context of the inducerServer task.

Example: the command "EXEC devs" sent to the inducerServer returns as reply the list of devices.

8.4 Auxiliary Server Commands

Some more server commands are available:

· GETDEVS returns the list of devices installed on the LCU
· GETTICK returns the system-clock-rate
· GETDBG and SETDBG deal with debugging information
· VERSION returns the LCU module version
· EXIT terminates the server task

8.5 Memory Driver

The inducer module includes a memory driver, capable of redirecting a stream associated with a file-descriptor into memory. There are three functions available:

· inducerMemDrv - to install the memory driver
· inducerMemDevCreate - to create a memory device
· inducerMemDevDelete - to remove a memory device after use

The following code example is taken from the inducerServer EXEC command, and shows how to redirect the standard-output channel of a task into memory:

    /*
* Create mem-device, open it, and redirect stdout into memory:
*/
st = inducerMemDrv(); /* don't care about repeated calls */
if (st == ERROR) ...

st = inducerMemDevCreate(EXEC_DEV_NAME, msg->body, EXEC_DEV_SIZE);
if (st == ERROR) ...

/* append "0" to device-name as offset, to start at the beginning: */
newFd = open(EXEC_DEV_NAME "0", O_WRONLY, 0);
if (newFd < 0)
{
(void)inducerMemDevDelete(EXEC_DEV_NAME); /* don't forget clean-up! */
...
}

oldFd = ioTaskStdGet(0 /*self*/, 1 /*stdout*/);
ioTaskStdSet(0 /*self*/, 1 /*stdout*/, newFd);

/*
* Execute a function that outputs something to stdout:
*/
ret = ...(...);

/*
* Restore the old stdout, get offset, close the mem-device, and delete it:
*/
ioTaskStdSet(0 /*self*/, 1 /*stdout*/, oldFd);

nBytes = ioctl(newFd, FIOWHERE, 0); /* bytes written to stdout */

close(newFd);

st = inducerMemDevDelete(EXEC_DEV_NAME);
if (st == ERROR) ...

Detailed information is contained in the man-page in section 10.4.

1
READ and WRITE are not implemented yet.



Quadralay Corporation
http://www.webworks.com
Voice: (512) 719-3399
Fax: (512) 719-3606
sales@webworks.com
TOC PREV NEXT INDEX