Preparing a new service that uses the opendds backend (idl import)¶
This involves converting the service’s idl file to a Kanzi Connect simulator service xml file, and then using this to generate source code.
Prepare the directory structure:
The file/folder structure is expected to look as follows:
<root>/sources/services/[servicename]_service/dds/[ServiceName].idl
<root>/interfaces/definitions/
Notes about the above folder and file names:
[ServiceName]
must start with a capital[servicename]
is the lowercase of [ServiceName]
Run the idl-import tool to create a Kanzi Connect simulator service xml file from the supplied idl:
Change to the <root> folder and run:
<KanziConnectInstallation>/SDK/tools/connect-idl-import/idl-import -i sources/services/[servicename]_service/dds/[ServiceName].idl -o interfaces/definitions/[servicename]_interface.xml
Run the ktp tool to generate opendds compatible source from the xml:
While in the
[root]
folder, run:<KanziConnectInstallation>/SDK/tools/ktp/ktp -i interfaces/definitions/[servicename]_interface.xml -t [connect_root]/SDK/tools/code_generation/ktp/idl-opendds/gen.tpl -d sources/services
Notes about source generation:
[servicename]_service.hpp
and[servicename]_service.cpp files
are not overwritten by default. To force the overwrite, add the following to the command line above:overwriteService=true
The default iorFile configuration is
repo.ior
. To change this, specify the following on the command line:iorFile="filename"
Complete service code generation according to the usual steps required to prepare a service from an xml file. This step may already be automated.