Generic OnOff models

The Generic OnOff models allows remote control of boolean states on a mesh device.

The Generic OnOff 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 OnOff mesh models.

Header file: include/bluetooth/mesh/gen_onoff.h
group bt_mesh_onoff

Common API for the Generic OnOff models.

struct bt_mesh_onoff_set
#include <gen_onoff.h>

Mandatory parameters for the Generic OnOff Set message.

Public Members

bool on_off

State to set.

bool reuse_transaction

Whether this should reuse the previous transaction identifier.

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_onoff_status
#include <gen_onoff.h>

Parameters for the Generic OnOff Status message.

Public Members

bool present_on_off

The present value of the Generic OnOff state.

bool target_on_off

The target value of the Generic OnOff state (optional).

int32_t remaining_time

Remaining time value in milliseconds.