Testing TPS

This simulates most TPS UPoCs. TPS is a series of Tcl procedures composed of procedure argument elements, where:

  • Procs lists the name of the procedure.
  • Arguments lists any special arguments to pass in through the ARGS key.

Tcl Procedure Stream (TPS) modules permit the alteration of message processing by setting each message’s disposition before exiting the module. In addition, these entry points let you modify a message’s data, metadata, or flow.

Use Script Editor to build any TPS.

If specifying a file location for test output, then use the "/" as the file delimiter (all platforms) or begin the file path with a "\\" (Windows).

Use hcitpstest to verify modules in a TPS. Test each module in the stream with hcitpstest before placing the next module into the stream.

This process might require the use of an end-processing module to verify that the messages are leaving the module. It can also verify that a module stream has the correct disposition.

It is important to verify each TPS module before configuring it into your system. Although TPS provides substantial capability to modify data, an erroneous application of TPS functions can result in messages being delivered incorrectly, or not being delivered at all.

Additionally, you should verify each module in the TPS. The return value of each procedure affects the arguments of the subsequent procedure, and, depending on the procedure’s return value, a subsequent procedure might not be invoked.

TPS can run in run, startup, time, or shutdown mode, although certain protocol thread Tcl procedures are only run in Startup mode during thread start-up.

The system sets the Tcl system encoding as UTF-8, so the default file encoding for input/output is in UTF-8.

The default encoding of StdIn, StdOut, and StdErr is ANSI. Use the fconfigure command to change the encoding of StdIn, StdOut, and StdErr. For example, to change the encoding to UTF-8 when you use the TPS Test Tool in the IDE.

Message data that is obtained or changed by Tcl is always UTF-8. A warning is given to remind you that string lengths are in bytes and are not the same as character (code point) lengths.

Note: Global variable support is available for the hcitpstest command line tool. The global variable indicator $$ (double dollar) has a confict with the shell special variable, which has meaning as the current PID on Linux/AIX platforms. To use a global variable in the Testing Tool on Linux/AIX plaforms, escape the $$ using one of these forms. For example:
  • hcitpstest -a '$$variablename'
  • hcitpstest -a \$\$variablename

On Windows, use hcitpstest -a $$variablename.

  1. Select the Procs Edit button to open the TPS Editor dialog box, where you can select the TPS procedures to run when the command is run.
  2. Specify the testing data file in Choose Data File. You can also click the folder button to open a file browser to select the data file. By default, the file browser locates on the $HCISITEDIR/formats/ folder.
  3. Leak Detection: Select to check for memory leaks.
  4. Mode: Click the arrow to open a list of modes. TPS can run in Run, Startup, Time, or Shutdown mode, although certain protocol thread Tcl procedures are only run in Startup mode during thread start-up.
  5. Select the line termination format in which to save the test messages. Click the arrow to open a list of formats.
    Newline Terminated reads the data in the file until it finds a newline character, making all that data one message, and sends that to the parser. It then reads until it finds the next newline character, makes a second message, and sends that to the parser.
    Length Encoded reads the first 10 characters to determine how long the first message is, reads that many characters into a message, and then sends it to the parser.
    EOF Terminated reads the file until it gets to the end-of-file character, takes that as a message, and sends it to the parser.
  6. Specify the encoding in the Encoding field, or click the arrow to open a list of different encodings that identify the encoding of messages in the selected data file. The command converts the messages from the identified encoding to UTF-8 to perform the test. When you select an encoding from the list, an -x encoding option is added to the corresponding command line.
  7. Select how to process records.
    process all records reads the selected data file and processes all the records in it.
    process one record reads the selected data file and processes only the first record in the file.
  8. Click the Caller Context arrow to to select from a list of caller context names.
  9. Select Initial Startup to start the connection.
  10. For Interval, specify the interval to wait between calls. This option is available when Time is chosen for the mode.
  11. For Max Messages, specify the maximum number of messages. This option is available when Time is chosen for the mode.
  12. Select Save To File to save the message to a file. These are saved to base.KILL or base.CONTINUE, depending on the disposition returned by the TPS. Specify the file name in the field.
  13. Select Send To Proc to save to a Tcl end procedure. This enables the selection list. Click the arrow to select from a list of procedures. The default is hcitpstestshowbydisp.
  14. For Arguments, specify any arguments to pass in. This text box is available when Send To Proc is selected.
  15. If required, then select Grep to filter the output.
  16. Click Run Command to run the command shown in Preview Command to Issue.
    As the test is being configured, a command-line command and the requisite parameters are generated in Preview Command to Issue. This is for display only. A command cannot be manually entered.