Silvair EnOcean Proxy Server¶
The Silvair EnOcean Proxy Server model integrates an EnOcean switch together with Generic OnOff Server and Generic Level Server models, enabling dimming and on/off light control. It implements the Silvair EnOcean Switch Mesh Proxy Server specification.
The model initializes the Bluetooth EnOcean library.
The EnOcean switch can be automatically commissioned if option CONFIG_BT_MESH_SILVAIR_ENOCEAN_AUTO_COMMISSION
is set.
The Silvair EnOcean Proxy Server uses either one or two elements on a node.
Each element handles its own button pair and has its own corresponding Generic OnOff Server and Generic Level Server models.
These models should not be accessed by the user application as the Silvair EnOcean Proxy Server model uses them to send messages.
The publication settings of these client models can be configured to control a specific light or a group of lights.
However, the Generic OnOff Server and Generic Level Server models need to be instantiated for each element.
BT_MESH_MODEL_SILVAIR_ENOCEAN_BUTTON
is provided to do this, and should be used as presented below:
struct bt_mesh_silvair_enocean_srv enocean;
static struct bt_mesh_elem elements[] = {
BT_MESH_ELEM(
1,
BT_MESH_MODEL_LIST(BT_MESH_MODEL_SILVAIR_ENOCEAN_BUTTON(&silvair_enocean, 0)),
BT_MESH_MODEL_LIST(BT_MESH_MODEL_SILVAIR_ENOCEAN_SRV(&silvair_enocean))),
BT_MESH_ELEM(
2,
BT_MESH_MODEL_LIST(BT_MESH_MODEL_SILVAIR_ENOCEAN_BUTTON(&silvair_enocean, 1)),
BT_MESH_MODEL_NONE),
};
The Silvair EnOcean Proxy Server does not require any message handler callbacks.
Note
The state machine behavior in this implementation of the Silvair EnOcean Switch Mesh Proxy Server specification differs slightly from the published specification document. As in accordance with the specification, no new Generic Delta Set messages are sent when a button is held down for longer than the delta timeout. The deviation from the specification is that the state machine stays in the Delta ON or Delta OFF state, meaning that a Generic OnOff message is not sent when the button is released, even after the delta times out.
Extended models¶
None
Persistent storage¶
If CONFIG_BT_ENOCEAN_STORE
is enabled, the Silvair EnOcean Proxy Server stores the commissioned EnOcean device address.
API documentation¶
include/bluetooth/mesh/vnd/silvair_enocean_srv.h
subsys/bluetooth/mesh/vnd/silvair_enocean_srv.c
-
group
bt_mesh_silvair_enocean_srv
API for the Silvair EnOcean Server.
Defines
-
BT_MESH_COMPANY_ID_SILVAIR
¶
-
BT_MESH_MODEL_ID_SILVAIR_ENOCEAN_SRV
¶
-
BT_MESH_SILVAIR_ENOCEAN_PROXY_BUTTONS
¶
-
BT_MESH_MODEL_SILVAIR_ENOCEAN_SRV
(_srv)¶ Silvair Enocean Proxy Server model entry.
- Parameters
_srv – [in] Pointer to a Silvair EnOcean Server model instance.
-
BT_MESH_MODEL_SILVAIR_ENOCEAN_BUTTON
(_srv, _idx)¶ Model entries for a button for a Silvair Enocean Proxy Server model.
One of these should be added for each rocker switch handled by the Silvair Enocean Proxy Server instance, each on its own element. This macro includes the Generic Level Client and Generic OnOff Client.
- Parameters
_srv – [in] Pointer to a Light Lightness Server model instance.
_idx – [in] Button index for the model entries. Must be in the range 0 to
BT_MESH_SILVAIR_ENOCEAN_PROXY_BUTTONS
.
Enums
-
struct
bt_mesh_silvair_enocean_srv
¶ - #include <silvair_enocean_srv.h>
Silvair Enocean Proxy Server instance.
Public Members
-
bt_addr_le_t
addr
¶ Enocean device address
-
struct bt_mesh_model_pub
pub
¶ Publish parameters
-
struct net_buf_simple
pub_buf
¶ Publication buffer
-
uint8_t
pub_data
[BT_MESH_MODEL_BUF_LEN
(BT_MESH_SILVAIR_ENOCEAN_PROXY_OP
,BT_MESH_SILVAIR_ENOCEAN_PROXY_MSG_MAXLEN
)]¶ Publication data
-
struct bt_mesh_model *
mod
¶ Access model pointer.
-
sys_snode_t
entry
¶ Entry in global list of Enocean Proxy models.
- #include <silvair_enocean_srv.h>
State for each button controlled by this instance
Public Members
Generic Level Client instance
Generic OnOff Client instance
Current state of the state machine
Target on/off in the state machine
Tick counter
Timer used for state machine timeouts
-
bt_addr_le_t
-