Generic Level models

The Generic Level models allows remote control of integer states on a mesh device.

The Generic Level models also feature their own common types, listed below. For types common to all models, see Bluetooth mesh models.

Common types

This section lists the types common to the Generic Level mesh models.

Header file: include/bluetooth/mesh/gen_lvl.h
group bt_mesh_lvl

Common API for the Bluetooth mesh Generic Level models.

Defines

BT_MESH_LVL_MIN

Generic Level minimum value.

BT_MESH_LVL_MAX

Generic Level maximum value.

struct bt_mesh_lvl_set
#include <gen_lvl.h>

Generic Level set message parameters.

Public Members

int16_t lvl

New level.

bool new_transaction

Whether this is a new action.

const struct bt_mesh_model_transition *transition

Transition time parameters for the state change, or NULL.

When sending, setting the transition to NULL makes the receiver use its default transition time parameters, or 0 if no default transition time is set.

struct bt_mesh_lvl_delta_set
#include <gen_lvl.h>

Generic Level delta set message parameters.

Public Members

int32_t delta

Translation from original value.

bool new_transaction

Whether this is a new transaction. If true, the delta should be relative to the current value. If false, the delta should be relative to the original value in the previous delta_set command.

const struct bt_mesh_model_transition *transition

Transition time parameters for the state change, or NULL.

When sending, setting the transition to NULL makes the receiver use its default transition time parameters, or 0 if no default transition time is set.

struct bt_mesh_lvl_move_set
#include <gen_lvl.h>

Generic Level move set message parameters.

Public Members

int16_t delta

Translation to make for every transition step.

bool new_transaction

Whether this is a new action.

const struct bt_mesh_model_transition *transition

Transition parameters, or NULL. delay indicates time until the move should start, time indicates the amount of time each delta step should take.

When sending, setting the transition to NULL makes the receiver use its default transition time parameters, or 0 if no default transition time is set.

struct bt_mesh_lvl_status
#include <gen_lvl.h>

Generic Level status message parameters.

Public Members

int16_t current

Current level value.

int16_t target

Target value for the ongoing transition. If there’s no ongoing transition, target should match value.

int32_t remaining_time

Time remaining of the ongoing transition (in milliseconds), or SYS_FOREVER_MS. If there’s no ongoing transition, remaining_time is 0.