Skip to main content
Version: 2.5.0

Code organization

Because Luos engine allows you to manage your features as sharable blocks of code, we organized the code in a specific way allowing to easily integrate and share packages from your projects with as little friction as possible.

Luos engine's levelsโ€‹

Different levels on the embedded code are defined, corresponding to the different levels of information needed across your entire product.

LevelDescription
ProductA node or a set of nodes that communicate with each other. This is the place where you will have the configurations and information intended for all your boards.
NodeThis is the board's code. This is your actual Eclipse, PlatformIO, IAR, or any other project.
PackageA sharable folder containing code files managing one or more services.
ServiceLuos services can be drivers or apps. Each service can follow Luos profiles to be standard, but it can be custom too.
luos_img

Product code organization with Luosโ€‹

 Project
โ”‚
โ”œโ”€โ”€โ”€ product_config.h
โ””โ”€โ”€โ”€ Nodes
โ”œโ”€โ”€โ”€ Node_1
โ”‚ โ”œโ”€โ”€โ”€ node_config.h
โ”‚ โ”œโ”€โ”€โ”€ main.c
โ”‚ โ””โ”€โ”€โ”€ Packages
โ”‚ โ”œโ”€โ”€โ”€ Package_1
โ”‚ โ”‚ โ”œโ”€โ”€โ”€ package_1.c
โ”‚ โ”‚ โ””โ”€โ”€โ”€ package_1.h
โ”‚ โ””โ”€โ”€โ”€ Package_2
โ”‚ โ”œโ”€โ”€โ”€ package_2.c
โ”‚ โ””โ”€โ”€โ”€ package_2.h
โ”œโ”€โ”€โ”€ Node_2
โ”‚ โ”œโ”€โ”€โ”€ node_config.h
โ”‚ โ”œโ”€โ”€โ”€ main.c
โ”‚ โ””โ”€โ”€โ”€ Packages
โ”‚ โ””โ”€โ”€โ”€ Package_3
โ”‚ โ”œโ”€โ”€โ”€ package_3.c
โ”‚ โ””โ”€โ”€โ”€ package_3.h
โ”‚
โ””โ”€โ”€โ”€ Node_3
โ”œโ”€โ”€โ”€ node_config.h
โ”œโ”€โ”€โ”€ main.c
โ””โ”€โ”€โ”€ Packages
โ”œโ”€โ”€โ”€ Package_4
โ”‚ โ”œโ”€โ”€โ”€ package_4.c
โ”‚ โ””โ”€โ”€โ”€ package_4.h
โ”œโ”€โ”€โ”€ Package_5
โ”‚ โ”œโ”€โ”€โ”€ package_5.c
โ”‚ โ””โ”€โ”€โ”€ package_5.h
โ””โ”€โ”€โ”€ Package_6
โ”œโ”€โ”€โ”€ package_6.c
โ””โ”€โ”€โ”€ package_6.h

  • Product level

    product_config.h: This file describes the general configuration for the product, such as baudrate, timeout duration, etc. It also groups the list of custom types, profiles, and commands that allow services to communicate together. This folder is the same for all the nodes of the same product and should be included at the node level.

  • Node level

    node_config.h: This file describes the configuration of the board's pinout, USART for communication, timer, and DMA. It also configures the buffer size for Luos communication and the number of tasks.

    main.c/.h: The main files for the node that calls luos.h, initializes and calls the package (all the different Service_Init, Service_Loop).

  • Package level

    package.c/.h: Contains the Service_Init, Service_Loop, and Service_Msg_Handler. In these files, you can create services dedicated to your functions with Luos API.

  • Service level

    Uses Luos API and Service Profile in your package's code to create either a standard or a custom service that anybody can use.

Where is Luos engine?โ€‹

Luos engine's library is used at the node level. You will need to initialize the engine and call a loop function in your main program to be able to use the Luos engine API in your packages.

luos_img