![]() |
![]() |
![]() |
![]() |
6 APPENDIX
6.1 Test Functions
The following routines have been developed to test the functionality of the lqs module. Three test tasks are provided, which use these routines; qsTest1, qsTest2, and qsTest3. They are all equivalent except for the obituary behaviour.
The task qsTestX, where X is 1, 2 or 3, simply waits forever for a message and returns a reply if required. Messages to these tasks can be send from the local system or from another systems using the RTAP protocol.
The functions described in section 4.5 can be executed as tasks or under VxWorks shell.
A number of test scripts making use of these functions are available in the test directory. These may be adapted to the particular environment and executed under VxWorks shell in a similar way as the boot script.
Note that all the routines used by the test functions, and documented below, do not declare message buffers as local variables. Message buffers are declared in the main function and always passed via pointers to lower level routines. This is necessary to avoid problems of stack overflow. It is recommended to use a similar scheme for the LCU message system.
· local_proc_name_ptr is the process name of the application. It is used later by other local or remote processes to identify the application.
· read_comm_size is the maximum number of messages of the incoming message queue of the application, i.e. messages from Q Server to applications.
· local_proc_num_ptr is the pointer to an application variable, where the process number of the application is returned.
· qsErrMsgQ_C
If the given read_comm_size is too large, or the communication from Q Server task to application cannot be opened.
· The number of processes is currently limited to 254. The first process starts with 2 as 0 is reserved for environment obituary and 1 for the lqs process itself.
· Applications should define a small read_comm_size as each RTAP message size is defined to be more than 8 Kbytes. The maximum size is currently defined to 100.
· local_proc_num is the process number of the application. It must be obtained previously by an qsEnter operation.
· snd_msg is a pointer to a message buffer. It is required to send an obituary message (if the calling task should generate an obituary message on termination).
· qsErrMsgQ_C
If the Q Server task is aborted and the communication from Q Server task to application cannot be closed.
· qsErrPipe_C
If the Q Server task is aborted and the communication from application to Q Server task cannot be closed.
Applications should use this function to exit the Q Server environment. If not, when they exit or are aborted, the Q Server automatically detects this and generates an obituary if required.
This function is used to receive a Q Server message from another process. That process may either be running on the same LCU or on another environment.
· local_proc_num is the process number of the application. It must be obtained previously by an qsEnter operation.
· time_out_second allows the application to wait for a number of seconds for an incoming message before timing out. rtNO_TIMEOUT causes an indefinite timeout, rtNO_WAIT causes this function to return immediately if there is no message on the queue.
· qsErrObituary_C - If an Obituary message is received from the remote process, of the remote environment.
This function is used to send a Q Server message to another process. That process may be either be running under the same LCU or under another environment.
· local_proc_num is the process number of the application. It must be obtained previously by an qsEnter operation.
· time_out_second allows the application to wait for a number of seconds for an Ack message before timing out. rtNO_TIMEOUT causes an indefinite timeout. The option rtNO_WAIT causes this function to return immediately without waiting for Ack. This option should only be used when sending response messages.
· qsErrObituary_C - If an Obituary message is received from the remote process, of the remote environment.
This function is used to get the process number of another Q Server process. That process may be either be running under the same LCU or under another environment.
· local_proc_num is the process number of the application. It must be obtained previously by an qsEnter operation.
· time_out_second allows the application to wait for a number of seconds for the response message before timing out. rtNO_TIMEOUT causes an indefinite timeout. The option rtNO_WAIT causes this function to return immediately if there is no response on the queue, it shall never to be used then.
· remote_proc_num_ptr is the buffer to receive the remote process number. It is valid only of the function returns OK, undefined otherwise.
· qsErrObituary_C - If an Obituary message is received from the remote process, of the remote environment.
This function is used to get the process number of another Q Server process. That process may be either be running under the same LCU or under another environment.
· local_proc_num is the process number of the application. It must be obtained previously by an qsEnter operation.
· time_out_second allows the application to wait for a number of seconds for the response message before timing out. rtNO_TIMEOUT causes an indefinite timeout. The option rtNO_WAIT causes this function to return immediately if there is no response on the queue, it shall never to be used then.
· remote_proc_name_ptr is the pointer to the string to receive the remote process name. It is valid only of the function returns OK, undefined otherwise.
![]() Quadralay Corporation http://www.webworks.com Voice: (512) 719-3399 Fax: (512) 719-3606 sales@webworks.com |
![]() |
![]() |
![]() |
![]() |