Generic OnOff Client

The Generic OnOff Client model remotely controls the state of a Generic OnOff Server model.

Extended models

None.

Persistent storage

None.

Shell commands

The Bluetooth Mesh shell subsystem provides a set of commands to interact with the Generic OnOff Client model instantiated on a device.

To make these commands available, enable the following Kconfig options:

mesh models onoff instance get-all

Print all instances of the Generic OnOff Client model on the device.

mesh models onoff instance set <ElemIdx>

Select the Generic OnOff Client model instantiated on the specified element ID. This instance will be used in message sending. If no model instance is selected, the first model instance found on the device will be used by default.

  • ElemIdx - Element index where the model instance is found.

mesh models onoff get

Get the OnOff state value of the bound server.

mesh models onoff set <OnOff> [TransTime(ms) [Delay(ms)]]

Set the OnOff state value of the server and wait for a response.

  • OnOff - OnOff state value to set. Use on, enable, or any non-zero value to enable the state.

  • TransTime - If present, defines the transition time in the message in milliseconds.

  • Delay - If present, defines the delay in the message in milliseconds.

mesh models onoff set-unack <onOff> [TransTime(ms) [Delay(ms)]]

Set the OnOff state value of the server without requesting a response.

  • OnOff - OnOff state value to set. Use on, enable, or any non-zero value to enable the state.

  • TransTime - If present, defines the transition time in the message in milliseconds.

  • Delay - If present, defines the delay in the message in milliseconds.

API documentation

Header file: include/bluetooth/mesh/gen_onoff_cli.h
Source file: subsys/bluetooth/mesh/gen_onoff_cli.c
Generic OnOff Client model