Skip to content

feat switching primitives

Romain Jacob edited this page Mar 14, 2019 · 3 revisions

Objective

Describe how to switch between different primitives in Baloo.

Description

A key novelty of Baloo is the ability to flexibly switch between different synchronous transmission primitives at run time. This allows to use the most-suited primitive for specific usages (e.g., disseminating a software update is different from collecting acknowledgements).

This feature is disabled by default; Glossy is then used for all communication.

Availability

Available for all supported platforms.

Note
Certain primitives are not available for all supported platforms. Refer to the respective platform descriptions.

Compatibility

Not compatible with the interference detection. Compatible with all the other features.

Using the feature

Switching between multiple synchronization primitves is implemented at the middleware layer, but it is controlled by the NET layer via the control packet.

The switching primitive feature is enabled with the following macro (typically in project-conf.h)

#define GMW_CONF_USE_MULTI_PRIMITIVES   1

In the current implementation of Baloo, other primitives can be used for the data slots only; the control packet is always send using Glossy.

When the feature is active, up to four primitives can be used in the same protocol, including Glossy. Glossy is identified as primitive 0 and is always enabled. The other primitives can be enabled/disabled using the following macro (typically in project-conf.h)

#define GMW_PRIM1_ENABLE 
#define GMW_PRIM2_ENABLE 
#define GMW_PRIM3_ENABLE 

They are enabled by default. Disabling one or several primitives allows to reduce the binary size by excluding the primitive from the build.

The mapping of primitives to IDs depends on the platform and is defined in the arch/platform/<platform>/gmw-conf-<platform>.h file. Below is the mapping for the sky mote.

#define GMW_PRIM_DEFAULT           GMW_PRIM_GLOSSY     /* default Glossy */
#define GMW_PRIM_GLOSSY            0
#define GMW_PRIM_CHAOS             1
#define GMW_PRIM_STROBING          2
/* forth primitive undefined */

The user selects the primitive to execute via the control information by indicating the primitive ID (i.e., 0, 1, 2, or 3; or with the mapping macro, e.g., GMW_PRIM_CHAOS). This can be done either

Some communication primitives may require specific configurations (see e.g., Chaos). Refer to the respective primitive descriptions for more details. Moreover, one must add the source file of the primitives to use in the application Makefile, e.g.

PROJECT_SOURCEFILES += chaos.c

Example

The baloo-test-chaos and baloo-test-strobing applications (see \examples) provide examples of this feature.