Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

API Description

This section explains the application programming interface of the CANopen stack in detail. Before explaining the API functions in detail, the overall philosophy of the CANopen implementation may help to understand the naming conventions and data to function relationship.

The CANopen stack is implemented in an object oriented way:

  1. The data is strictly separated from the function. The data of a module is collected within a C structure and is called: class.
  2. The CANopen stack allocates no memory. The memory must be allocated within the device configuration or within the application. The allocated memory of a class is called: object
  3. The function of a class needs at least the reference to an object of that class type. As a convention, the functions expects this reference as first parameter. This reference is in most object oriented literature the this-pointer. Within the CANopen stack the name of this reference is an abbreviation of the class to highlight the membership of the function.

The following example source explains the principle implementation of a hypothetical module in this object oriented philosophy.

End of topic

  • No labels