OpenTTCN/2.56.0/ANSI C SDK library reference/TCI-CD extensions/otSetDecoder

From OpenTTCN

Jump to: navigation, search

otSetDecoder

The otSetDecoder function registers either default decoder or decoder for a particular type.

void otSetDecoder(
    TciType type,
    TciDecodeFunctionPtr dfp);

Parameters

type

   

Type of values that the decoder function being registered claims to be able to decode, or 0 for default decoder.

dfp

   

Pointer to decoder function being registered.

Remarks

Similar to otSetEncoder(), but used to register type-specific decoders and the default decoder. Default decoder will be selected by the test execution also in cases when no decoding hypothesis is provided to the decode function. Otherwise, decoder is selected based on the type of decoding hypothesis. If several decoding hypotheses are applicable, then several decoders may be tried in sequence unless a value is successfully decoded.

Starting with SDK 2.54.0.RC8, this function provides a more powerful replacement to user-supplied tciDecode() function for specifying decoders. The actual name of the tciDecode() function does not have to be hard-coded anymore, although tciDecode() can still be used "as is", for example, for strict standard compliancy reasons. In order to specify tciDecode() as the only decoding function registered in the decoding subsystem that handles decoding of all types by default, add the following statement into initialization part of your code:

otSetDecoder(0, &tciDecode);

This will register tciDecode() as the only decoding function in the system.

For simplicity and for documentation compatibility reasons, activities performed by the test execution to select and call a correct decode function are collectively referred to as "performing tciDecode() function call", although as it can be seen from above this does not necessarily mean actual tciDecode() C function call.

Requirements

Header

Declared in <tci/tci_ext.h>; include <tci/tci.h>.

Library

openttcn-tcd-mt.lib

Compatibility

OpenTTCN ANSI C SDK 2.x and higher

See also

tciDecode

Views
Personal tools