![]() |
![]() |
![]() |
![]() |
![]() |
PCOs
You can operate PCOs by either implicitly enqueueing messages in the PCO by using the receive command, or by customizing the PCO providing your own definition of the PCO behavior.
Customizing the Behavior of PCOs
The behavior of PCOs can be customized for achieving communications with "real" implementations under test. This is similar to the adaptation process. For more information, see Adaptation of Generated Code. The difference is that only the GciSend function and a polling/decoding function need to be implemented. Some familiarity with the GCI interface is required in order to successfully add a custom PCO implementation to the TTCN Exerciser - in particular, the use of the GciValue type should be known. Also, knowledge of the protocol and APIs for the implementation of the PCO is required.
Files
The TTCN Exerciser is interfacing to the code generator output in a manner that is conformant to the GCI interface recommendation. The adaptor.c file which is supplied with the TTCN Exerciser interface, is pretty much a plain adaptor that calls GCI equivalent functions in the TTCN Exerciser. It is possible to edit the adaptor.c file while still retaining functionality of the TTCN Exerciser.
Custom PCO Registration
PCOs may be registered in the main function, before the IsmMain function is called. The PCO registration is done by calling the IsmRegisterPCOImplementation function. This functions arguments are described in detail in the ism.h file. Conceptually, each registered PCO is polled at a maximum interval supplied when the PCO is registered. The PCO has an associated polling function that should be used to check if a message is completely received on the PCO, and in that case decode it and use the GciReceive function to notify the TTCN runtime behavior of the newly arrived message. For sending, the PCO, registration function also requires a Send function argument. This function should send a message to the implementation under test.
It should be noted that these functions should all be possible to call from multiple threads, since the TTCN Exerciser may use multithreading to implement concurrent TTCN.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |