Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Basic C initialization and runtime sequence



This article explains the initialization and runtime sequence of Basic C modules. Note that the C modules are associated with C libraries (dll).

Each function of the framework initialization and runtime sequence is associated to one or several functions to be accessed in the C library.

Overview

The initialization and runtime sequence of C modules follows several phases:
sequenceC

Initialization phase

When the module is initialized, the pointers to the Java functions to use to invoke services are given to the C library. These pointers allow to set values for Services datas:
  • void setIntInvoker(void (*intInvoker)(char*, int)) for setting the value of an int data
  • void setFloatInvoker(void (*intInvoker)(char*, float)) for setting the value of a float data
  • etc...
Also the C library init function is called. This function must have the following signature:
      init(void (*startInvoke)(long), void (*endInvoke)())
  • The first void (*startInvoke)(long) pointer points to the Java function which will be called at the start of a Service invocation
  • The second void (*endInvoke)() pointer points to the Java function which will be called at the end of a Service invocation

csequenceinit

Start phase

When the module is started, the C library start function is called. This function must have the following signature:
      start()


csequencestart

Runtime phase

Service notification

A Service notification follows the following steps:
  • The void startNotify(long) function is called with the ID of the Service as argument
  • The void receiveXXXX(char*, value) function is called for each Service data
  • The void endNotify(long) function is called with the ID of the Service as argument

csequencenotify

Service invocation

A Service invocation follows the following steps:
  • The C library calls the void (*startInvoke)(long) function with the ID of the Service to invoke as the argument
  • For each Data the C library wants to set the value, the C library calls the void (*xxxInvoker)(char*, value) function with the name of the data and the value as arguments. The function pointer called for each data type is the one specified during the initialization phase
  • The C library calls the void (*endInvoke)() function to specify that the Service invocation must be performed

csequenceinvoke

See also


Categories: concepts

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence