summaryrefslogtreecommitdiff
path: root/mesh/model.c
diff options
context:
space:
mode:
authorBrian Gix <brian.gix@intel.com>2020-10-08 11:05:47 -0700
committerBrian Gix <brian.gix@gmail.com>2023-01-30 16:14:41 -0800
commitebb219614108b3e227b9fde2ff3fdb8ec99512f7 (patch)
tree0293ed4025e6ed368222458d3e81a69fcf04a473 /mesh/model.c
parent5ba57cf85140e2087fef0e617608ee33a04c5449 (diff)
downloadbluez-ebb219614108b3e227b9fde2ff3fdb8ec99512f7.tar.gz
mesh: Add internal Mesh Private Beacon model
Adds recgnition that the Mesh Private Beacon model is internal and foundational, without bindings.
Diffstat (limited to 'mesh/model.c')
-rw-r--r--mesh/model.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mesh/model.c b/mesh/model.c
index e2babea10..4ccafa17e 100644
--- a/mesh/model.c
+++ b/mesh/model.c
@@ -26,6 +26,7 @@
#include "mesh/cfgmod.h"
#include "mesh/prov.h"
#include "mesh/remprv.h"
+#include "mesh/prv-beacon.h"
#include "mesh/error.h"
#include "mesh/dbus.h"
#include "mesh/util.h"
@@ -81,6 +82,9 @@ static bool is_internal(uint32_t id)
if (id == REM_PROV_SRV_MODEL || id == REM_PROV_CLI_MODEL)
return true;
+ if (id == PRV_BEACON_SRV_MODEL || id == PRV_BEACON_CLI_MODEL)
+ return true;
+
return false;
}
@@ -647,6 +651,9 @@ static int update_binding(struct mesh_node *node, uint16_t addr, uint32_t id,
if (id == CONFIG_SRV_MODEL || id == CONFIG_CLI_MODEL)
return MESH_STATUS_INVALID_MODEL;
+ if (id == PRV_BEACON_SRV_MODEL || id == PRV_BEACON_CLI_MODEL)
+ return MESH_STATUS_INVALID_MODEL;
+
if (!appkey_have_key(node_get_net(node), app_idx))
return MESH_STATUS_INVALID_APPKEY;
@@ -1655,7 +1662,8 @@ static struct mesh_model *model_setup(struct mesh_net *net, uint8_t ele_idx,
SET_ID(SIG_VENDOR, db_mod->id));
/* Implicitly bind config server model to device key */
- if (db_mod->id == CONFIG_SRV_MODEL) {
+ if (db_mod->id == CONFIG_SRV_MODEL ||
+ db_mod->id == PRV_BEACON_SRV_MODEL) {
if (ele_idx != PRIMARY_ELE_IDX) {
l_free(mod);