10#ifndef ZEPHYR_INCLUDE_BLUETOOTH_MESH_ACCESS_H_
11#define ZEPHYR_INCLUDE_BLUETOOTH_MESH_ACCESS_H_
18#define BT_MESH_KEY_UNUSED_ELT_(IDX, _) BT_MESH_KEY_UNUSED
19#define BT_MESH_ADDR_UNASSIGNED_ELT_(IDX, _) BT_MESH_ADDR_UNASSIGNED
20#define BT_MESH_UUID_UNASSIGNED_ELT_(IDX, _) NULL
21#define BT_MESH_MODEL_KEYS_UNUSED(_keys) \
22 { LISTIFY(_keys, BT_MESH_KEY_UNUSED_ELT_, (,)) }
23#define BT_MESH_MODEL_GROUPS_UNASSIGNED(_grps) \
24 { LISTIFY(_grps, BT_MESH_ADDR_UNASSIGNED_ELT_, (,)) }
25#if CONFIG_BT_MESH_LABEL_COUNT > 0
26#define BT_MESH_MODEL_UUIDS_UNASSIGNED() \
27 .uuids = (const uint8_t *[]){ LISTIFY(CONFIG_BT_MESH_LABEL_COUNT, \
28 BT_MESH_UUID_UNASSIGNED_ELT_, (,)) },
30#define BT_MESH_MODEL_UUIDS_UNASSIGNED()
33#define BT_MESH_MODEL_RUNTIME_INIT(_user_data) \
34 .rt = &(struct bt_mesh_model_rt_ctx){ .user_data = (_user_data) },
51#define BT_MESH_ADDR_UNASSIGNED 0x0000
52#define BT_MESH_ADDR_ALL_NODES 0xffff
53#define BT_MESH_ADDR_RELAYS 0xfffe
54#define BT_MESH_ADDR_FRIENDS 0xfffd
55#define BT_MESH_ADDR_PROXIES 0xfffc
56#define BT_MESH_ADDR_DFW_NODES 0xfffb
57#define BT_MESH_ADDR_IP_NODES 0xfffa
58#define BT_MESH_ADDR_IP_BR_ROUTERS 0xfff9
67#define BT_MESH_KEY_UNUSED 0xffff
68#define BT_MESH_KEY_ANY 0xffff
69#define BT_MESH_KEY_DEV 0xfffe
70#define BT_MESH_KEY_DEV_LOCAL BT_MESH_KEY_DEV
71#define BT_MESH_KEY_DEV_REMOTE 0xfffd
72#define BT_MESH_KEY_DEV_ANY 0xfffc
80#define BT_MESH_ADDR_IS_UNICAST(addr) ((addr) && (addr) < 0x8000)
84#define BT_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) < 0xff00)
88#define BT_MESH_ADDR_IS_FIXED_GROUP(addr) ((addr) >= 0xff00 && (addr) < 0xffff)
92#define BT_MESH_ADDR_IS_VIRTUAL(addr) ((addr) >= 0x8000 && (addr) < 0xc000)
96#define BT_MESH_ADDR_IS_RFU(addr) ((addr) >= 0xff00 && (addr) <= 0xfff8)
101#define BT_MESH_IS_DEV_KEY(key) (key == BT_MESH_KEY_DEV_LOCAL || \
102 key == BT_MESH_KEY_DEV_REMOTE)
105#define BT_MESH_APP_SEG_SDU_MAX 12
108#define BT_MESH_APP_UNSEG_SDU_MAX 15
111#if defined(CONFIG_BT_MESH_RX_SEG_MAX)
112#define BT_MESH_RX_SEG_MAX CONFIG_BT_MESH_RX_SEG_MAX
114#define BT_MESH_RX_SEG_MAX 0
118#if defined(CONFIG_BT_MESH_TX_SEG_MAX)
119#define BT_MESH_TX_SEG_MAX CONFIG_BT_MESH_TX_SEG_MAX
121#define BT_MESH_TX_SEG_MAX 0
125#define BT_MESH_TX_SDU_MAX MAX((BT_MESH_TX_SEG_MAX * \
126 BT_MESH_APP_SEG_SDU_MAX), \
127 BT_MESH_APP_UNSEG_SDU_MAX)
130#define BT_MESH_RX_SDU_MAX MAX((BT_MESH_RX_SEG_MAX * \
131 BT_MESH_APP_SEG_SDU_MAX), \
132 BT_MESH_APP_UNSEG_SDU_MAX)
143#define BT_MESH_ELEM(_loc, _mods, _vnd_mods) \
145 .rt = &(struct bt_mesh_elem_rt_ctx) { 0 }, \
147 .model_count = ARRAY_SIZE(_mods), \
148 .vnd_model_count = ARRAY_SIZE(_vnd_mods), \
150 .vnd_models = (_vnd_mods), \
179#define BT_MESH_MODEL_ID_CFG_SRV 0x0000
181#define BT_MESH_MODEL_ID_CFG_CLI 0x0001
183#define BT_MESH_MODEL_ID_HEALTH_SRV 0x0002
185#define BT_MESH_MODEL_ID_HEALTH_CLI 0x0003
187#define BT_MESH_MODEL_ID_REMOTE_PROV_SRV 0x0004
189#define BT_MESH_MODEL_ID_REMOTE_PROV_CLI 0x0005
191#define BT_MESH_MODEL_ID_BRG_CFG_SRV 0x0008
193#define BT_MESH_MODEL_ID_BRG_CFG_CLI 0x0009
195#define BT_MESH_MODEL_ID_PRIV_BEACON_SRV 0x000a
197#define BT_MESH_MODEL_ID_PRIV_BEACON_CLI 0x000b
199#define BT_MESH_MODEL_ID_SAR_CFG_SRV 0x000e
201#define BT_MESH_MODEL_ID_SAR_CFG_CLI 0x000f
203#define BT_MESH_MODEL_ID_OP_AGG_SRV 0x0010
205#define BT_MESH_MODEL_ID_OP_AGG_CLI 0x0011
207#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_SRV 0x0012
209#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_CLI 0x0013
211#define BT_MESH_MODEL_ID_SOL_PDU_RPL_SRV 0x0014
213#define BT_MESH_MODEL_ID_SOL_PDU_RPL_CLI 0x0015
215#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_SRV 0x000c
217#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_CLI 0x000d
227#define BT_MESH_MODEL_ID_GEN_ONOFF_SRV 0x1000
229#define BT_MESH_MODEL_ID_GEN_ONOFF_CLI 0x1001
231#define BT_MESH_MODEL_ID_GEN_LEVEL_SRV 0x1002
233#define BT_MESH_MODEL_ID_GEN_LEVEL_CLI 0x1003
235#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_SRV 0x1004
237#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_CLI 0x1005
239#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV 0x1006
241#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV 0x1007
243#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_CLI 0x1008
245#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV 0x1009
247#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV 0x100a
249#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_CLI 0x100b
251#define BT_MESH_MODEL_ID_GEN_BATTERY_SRV 0x100c
253#define BT_MESH_MODEL_ID_GEN_BATTERY_CLI 0x100d
255#define BT_MESH_MODEL_ID_GEN_LOCATION_SRV 0x100e
257#define BT_MESH_MODEL_ID_GEN_LOCATION_SETUPSRV 0x100f
259#define BT_MESH_MODEL_ID_GEN_LOCATION_CLI 0x1010
261#define BT_MESH_MODEL_ID_GEN_ADMIN_PROP_SRV 0x1011
263#define BT_MESH_MODEL_ID_GEN_MANUFACTURER_PROP_SRV 0x1012
265#define BT_MESH_MODEL_ID_GEN_USER_PROP_SRV 0x1013
267#define BT_MESH_MODEL_ID_GEN_CLIENT_PROP_SRV 0x1014
269#define BT_MESH_MODEL_ID_GEN_PROP_CLI 0x1015
271#define BT_MESH_MODEL_ID_SENSOR_SRV 0x1100
273#define BT_MESH_MODEL_ID_SENSOR_SETUP_SRV 0x1101
275#define BT_MESH_MODEL_ID_SENSOR_CLI 0x1102
277#define BT_MESH_MODEL_ID_TIME_SRV 0x1200
279#define BT_MESH_MODEL_ID_TIME_SETUP_SRV 0x1201
281#define BT_MESH_MODEL_ID_TIME_CLI 0x1202
283#define BT_MESH_MODEL_ID_SCENE_SRV 0x1203
285#define BT_MESH_MODEL_ID_SCENE_SETUP_SRV 0x1204
287#define BT_MESH_MODEL_ID_SCENE_CLI 0x1205
289#define BT_MESH_MODEL_ID_SCHEDULER_SRV 0x1206
291#define BT_MESH_MODEL_ID_SCHEDULER_SETUP_SRV 0x1207
293#define BT_MESH_MODEL_ID_SCHEDULER_CLI 0x1208
295#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SRV 0x1300
297#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV 0x1301
299#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_CLI 0x1302
301#define BT_MESH_MODEL_ID_LIGHT_CTL_SRV 0x1303
303#define BT_MESH_MODEL_ID_LIGHT_CTL_SETUP_SRV 0x1304
305#define BT_MESH_MODEL_ID_LIGHT_CTL_CLI 0x1305
307#define BT_MESH_MODEL_ID_LIGHT_CTL_TEMP_SRV 0x1306
309#define BT_MESH_MODEL_ID_LIGHT_HSL_SRV 0x1307
311#define BT_MESH_MODEL_ID_LIGHT_HSL_SETUP_SRV 0x1308
313#define BT_MESH_MODEL_ID_LIGHT_HSL_CLI 0x1309
315#define BT_MESH_MODEL_ID_LIGHT_HSL_HUE_SRV 0x130a
317#define BT_MESH_MODEL_ID_LIGHT_HSL_SAT_SRV 0x130b
319#define BT_MESH_MODEL_ID_LIGHT_XYL_SRV 0x130c
321#define BT_MESH_MODEL_ID_LIGHT_XYL_SETUP_SRV 0x130d
323#define BT_MESH_MODEL_ID_LIGHT_XYL_CLI 0x130e
325#define BT_MESH_MODEL_ID_LIGHT_LC_SRV 0x130f
327#define BT_MESH_MODEL_ID_LIGHT_LC_SETUPSRV 0x1310
329#define BT_MESH_MODEL_ID_LIGHT_LC_CLI 0x1311
339#define BT_MESH_MODEL_ID_BLOB_SRV 0x1400
341#define BT_MESH_MODEL_ID_BLOB_CLI 0x1401
351#define BT_MESH_MODEL_ID_DFU_SRV 0x1402
353#define BT_MESH_MODEL_ID_DFU_CLI 0x1403
355#define BT_MESH_MODEL_ID_DFD_SRV 0x1404
357#define BT_MESH_MODEL_ID_DFD_CLI 0x1405
389#define BT_MESH_MODEL_OP_1(b0) (b0)
390#define BT_MESH_MODEL_OP_2(b0, b1) (((b0) << 8) | (b1))
391#define BT_MESH_MODEL_OP_3(b0, cid) ((((b0) << 16) | 0xc00000) | (cid))
394#define BT_MESH_LEN_EXACT(len) (-len)
396#define BT_MESH_LEN_MIN(len) (len)
399#define BT_MESH_MODEL_OP_END { 0, 0, NULL }
401#if !defined(__cplusplus) || defined(__DOXYGEN__)
408#define BT_MESH_MODEL_NO_OPS ((struct bt_mesh_model_op []) \
409 { BT_MESH_MODEL_OP_END })
417#define BT_MESH_MODEL_NONE ((const struct bt_mesh_model []){})
436#define BT_MESH_MODEL_CNT_CB(_id, _op, _pub, _user_data, _keys, _grps, _cb) \
439 BT_MESH_MODEL_RUNTIME_INIT(_user_data) \
441 .keys = (uint16_t []) BT_MESH_MODEL_KEYS_UNUSED(_keys), \
443 .groups = (uint16_t []) BT_MESH_MODEL_GROUPS_UNASSIGNED(_grps), \
444 .groups_cnt = _grps, \
445 BT_MESH_MODEL_UUIDS_UNASSIGNED() \
468#define BT_MESH_MODEL_CNT_VND_CB(_company, _id, _op, _pub, _user_data, _keys, _grps, _cb) \
470 .vnd.company = (_company), \
472 BT_MESH_MODEL_RUNTIME_INIT(_user_data) \
475 .keys = (uint16_t []) BT_MESH_MODEL_KEYS_UNUSED(_keys), \
477 .groups = (uint16_t []) BT_MESH_MODEL_GROUPS_UNASSIGNED(_grps), \
478 .groups_cnt = _grps, \
479 BT_MESH_MODEL_UUIDS_UNASSIGNED() \
495#define BT_MESH_MODEL_CB(_id, _op, _pub, _user_data, _cb) \
496 BT_MESH_MODEL_CNT_CB(_id, _op, _pub, _user_data, \
497 CONFIG_BT_MESH_MODEL_KEY_COUNT, \
498 CONFIG_BT_MESH_MODEL_GROUP_COUNT, _cb)
516#if defined(CONFIG_BT_MESH_LARGE_COMP_DATA_SRV)
517#define BT_MESH_MODEL_METADATA_CB(_id, _op, _pub, _user_data, _cb, _metadata) \
520 BT_MESH_MODEL_RUNTIME_INIT(_user_data) \
522 .keys = (uint16_t []) BT_MESH_MODEL_KEYS_UNUSED(CONFIG_BT_MESH_MODEL_KEY_COUNT), \
523 .keys_cnt = CONFIG_BT_MESH_MODEL_KEY_COUNT, \
524 .groups = (uint16_t []) BT_MESH_MODEL_GROUPS_UNASSIGNED(CONFIG_BT_MESH_MODEL_GROUP_COUNT), \
525 .groups_cnt = CONFIG_BT_MESH_MODEL_GROUP_COUNT, \
526 BT_MESH_MODEL_UUIDS_UNASSIGNED() \
529 .metadata = _metadata, \
532#define BT_MESH_MODEL_METADATA_CB(_id, _op, _pub, _user_data, _cb, _metadata) \
533 BT_MESH_MODEL_CB(_id, _op, _pub, _user_data, _cb)
550#define BT_MESH_MODEL_VND_CB(_company, _id, _op, _pub, _user_data, _cb) \
551 BT_MESH_MODEL_CNT_VND_CB(_company, _id, _op, _pub, _user_data, \
552 CONFIG_BT_MESH_MODEL_KEY_COUNT, \
553 CONFIG_BT_MESH_MODEL_GROUP_COUNT, _cb)
571#if defined(CONFIG_BT_MESH_LARGE_COMP_DATA_SRV)
572#define BT_MESH_MODEL_VND_METADATA_CB(_company, _id, _op, _pub, _user_data, _cb, _metadata) \
574 .vnd.company = (_company), \
576 BT_MESH_MODEL_RUNTIME_INIT(_user_data) \
579 .keys = (uint16_t []) BT_MESH_MODEL_KEYS_UNUSED(CONFIG_BT_MESH_MODEL_KEY_COUNT), \
580 .keys_cnt = CONFIG_BT_MESH_MODEL_KEY_COUNT, \
581 .groups = (uint16_t []) BT_MESH_MODEL_GROUPS_UNASSIGNED(CONFIG_BT_MESH_MODEL_GROUP_COUNT), \
582 .groups_cnt = CONFIG_BT_MESH_MODEL_GROUP_COUNT, \
583 BT_MESH_MODEL_UUIDS_UNASSIGNED() \
585 .metadata = _metadata, \
588#define BT_MESH_MODEL_VND_METADATA_CB(_company, _id, _op, _pub, _user_data, _cb, _metadata) \
589 BT_MESH_MODEL_VND_CB(_company, _id, _op, _pub, _user_data, _cb)
602#define BT_MESH_MODEL(_id, _op, _pub, _user_data) \
603 BT_MESH_MODEL_CB(_id, _op, _pub, _user_data, NULL)
617#define BT_MESH_MODEL_VND(_company, _id, _op, _pub, _user_data) \
618 BT_MESH_MODEL_VND_CB(_company, _id, _op, _pub, _user_data, NULL)
631#define BT_MESH_TRANSMIT(count, int_ms) ((count) | (((int_ms / 10) - 1) << 3))
640#define BT_MESH_TRANSMIT_COUNT(transmit) (((transmit) & (uint8_t)BIT_MASK(3)))
649#define BT_MESH_TRANSMIT_INT(transmit) ((((transmit) >> 3) + 1) * 10)
661#define BT_MESH_PUB_TRANSMIT(count, int_ms) BT_MESH_TRANSMIT(count, \
671#define BT_MESH_PUB_TRANSMIT_COUNT(transmit) BT_MESH_TRANSMIT_COUNT(transmit)
680#define BT_MESH_PUB_TRANSMIT_INT(transmit) ((((transmit) >> 3) + 1) * 50)
690#define BT_MESH_PUB_MSG_TOTAL(pub) (BT_MESH_PUB_TRANSMIT_COUNT((pub)->retransmit) + 1)
701#define BT_MESH_PUB_MSG_NUM(pub) (BT_MESH_PUB_TRANSMIT_COUNT((pub)->retransmit) + 1 - (pub)->count)
770#define BT_MESH_MODEL_PUB_DEFINE(_name, _update, _msg_len) \
771 NET_BUF_SIMPLE_DEFINE_STATIC(bt_mesh_pub_msg_##_name, _msg_len); \
772 static struct bt_mesh_model_pub _name = { \
773 .msg = &bt_mesh_pub_msg_##_name, \
801#define BT_MESH_MODELS_METADATA_ENTRY(_len, _id, _data) \
803 .len = (_len), .id = _id, .data = _data, \
807#define BT_MESH_MODELS_METADATA_NONE NULL
810#define BT_MESH_MODELS_METADATA_END { 0, 0, NULL }
828 const char *name,
size_t len_rd,
905#ifdef CONFIG_BT_MESH_MODEL_EXTENSIONS
924#if (CONFIG_BT_MESH_LABEL_COUNT > 0) || defined(__DOXYGEN__)
935#if defined(CONFIG_BT_MESH_LARGE_COMP_DATA_SRV) || defined(__DOXYGEN__)
955 void (*
end)(
int err,
void *cb_data);
960#define BT_MESH_TTL_DEFAULT 0xff
963#define BT_MESH_TTL_MAX 0x7f
1063 const char *name,
const void *data,
int bt_mesh_model_correspond(const struct bt_mesh_model *corresponding_mod, const struct bt_mesh_model *base_mod)
Let a model correspond to another.
int bt_mesh_model_publish(const struct bt_mesh_model *model)
Send a model publication message.
bool bt_mesh_model_is_extended(const struct bt_mesh_model *model)
Check if model is extended by another model.
#define BT_MESH_PUB_TRANSMIT_COUNT(transmit)
Decode Publish Retransmit count from a given value.
Definition access.h:671
static bool bt_mesh_model_pub_is_retransmission(const struct bt_mesh_model *model)
Check if a message is being retransmitted.
Definition access.h:1004
int bt_mesh_models_metadata_change_prepare(void)
Indicate that the metadata will change on next bootup.
void bt_mesh_model_data_store_schedule(const struct bt_mesh_model *mod)
Schedule the model's user data store in persistent storage.
int bt_mesh_model_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *msg, const struct bt_mesh_send_cb *cb, void *cb_data)
Send an Access Layer message.
int bt_mesh_comp2_register(const struct bt_mesh_comp2 *comp2)
Register composition data page 2 of the device.
int bt_mesh_comp_change_prepare(void)
Indicate that the composition data will change on next bootup.
const struct bt_mesh_elem * bt_mesh_model_elem(const struct bt_mesh_model *mod)
Get the element that a model belongs to.
static bool bt_mesh_model_in_primary(const struct bt_mesh_model *mod)
Get whether the model is in the primary element of the device.
Definition access.h:1046
const struct bt_mesh_model * bt_mesh_model_find_vnd(const struct bt_mesh_elem *elem, uint16_t company, uint16_t id)
Find a vendor model.
int bt_mesh_model_data_store(const struct bt_mesh_model *mod, bool vnd, const char *name, const void *data, size_t data_len)
Immediately store the model's user data in persistent storage.
const struct bt_mesh_model * bt_mesh_model_find(const struct bt_mesh_elem *elem, uint16_t id)
Find a SIG model.
int bt_mesh_model_extend(const struct bt_mesh_model *extending_mod, const struct bt_mesh_model *base_mod)
Let a model extend another.
ssize_t(* settings_read_cb)(void *cb_arg, void *data, size_t len)
Function used to read the data from the settings storage in h_set handler implementations.
Definition settings.h:61
__SIZE_TYPE__ ssize_t
Definition types.h:28
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Composition data page 2 record.
Definition access.h:1165
uint16_t id
Mesh profile ID.
Definition access.h:1167
uint8_t y
Minor version.
Definition access.h:1173
uint8_t x
Major version.
Definition access.h:1171
const uint8_t * elem_offset
Element offset list.
Definition access.h:1180
struct bt_mesh_comp2_record::@143 version
Mesh Profile Version.
uint16_t data_len
Length of additional data.
Definition access.h:1182
uint8_t z
Z version.
Definition access.h:1175
const void * data
Additional data.
Definition access.h:1184
uint8_t elem_offset_cnt
Element offset count.
Definition access.h:1178
Node Composition data page 2.
Definition access.h:1188
size_t record_cnt
The number of Mesh Profile records on a device.
Definition access.h:1190
const struct bt_mesh_comp2_record * record
List of records.
Definition access.h:1192
Node Composition.
Definition access.h:1155
uint16_t pid
Product ID.
Definition access.h:1157
uint16_t cid
Company ID.
Definition access.h:1156
uint16_t vid
Version ID.
Definition access.h:1158
const struct bt_mesh_elem * elem
List of elements.
Definition access.h:1161
size_t elem_count
The number of elements in this device.
Definition access.h:1160
Mesh Element runtime information.
Definition access.h:156
uint16_t addr
Unicast Address.
Definition access.h:158
Abstraction that describes a Mesh Element.
Definition access.h:154
struct bt_mesh_elem::bt_mesh_elem_rt_ctx rt
const struct bt_mesh_model *const models
The list of SIG models in this element.
Definition access.h:169
const uint16_t loc
Location Descriptor (GATT Bluetooth Namespace Descriptors)
Definition access.h:162
const uint8_t model_count
The number of SIG models in this element.
Definition access.h:164
const struct bt_mesh_model *const vnd_models
The list of vendor models in this element.
Definition access.h:171
const uint8_t vnd_model_count
The number of vendor models in this element.
Definition access.h:166
Vendor model ID.
Definition access.h:883
uint16_t company
Vendor's company ID.
Definition access.h:885
uint16_t id
Model ID.
Definition access.h:887
const struct bt_mesh_model * next
Definition access.h:907
void * user_data
Model-specific user data.
Definition access.h:910
uint8_t mod_idx
Definition access.h:902
uint16_t flags
Definition access.h:903
uint8_t elem_idx
Definition access.h:901
Model callback functions.
Definition access.h:813
int(*const init)(const struct bt_mesh_model *model)
Model init callback.
Definition access.h:857
int(*const settings_set)(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg)
Set value handler of user data tied to the model.
Definition access.h:827
void(*const reset)(const struct bt_mesh_model *model)
Model reset callback.
Definition access.h:869
int(*const start)(const struct bt_mesh_model *model)
Callback called when the mesh is started.
Definition access.h:843
void(*const pending_store)(const struct bt_mesh_model *model)
Callback used to store pending model's user data.
Definition access.h:879
Model opcode handler.
Definition access.h:363
const uint32_t opcode
OpCode encoded using the BT_MESH_MODEL_OP_* macros.
Definition access.h:365
const ssize_t len
Message length.
Definition access.h:373
int(*const func)(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf)
Handler function for this opcode.
Definition access.h:384
Model publication context.
Definition access.h:708
int(* update)(const struct bt_mesh_model *mod)
Callback for updating the publication buffer.
Definition access.h:757
uint16_t key
Publish AppKey Index.
Definition access.h:714
uint16_t retr_update
Call update callback on every retransmission.
Definition access.h:718
uint8_t delayable
Use random delay for publishing.
Definition access.h:726
uint16_t cred
Friendship Credentials Flag.
Definition access.h:715
uint8_t retransmit
Retransmit Count & Interval Steps.
Definition access.h:721
uint16_t addr
Publish Address.
Definition access.h:712
uint8_t count
Transmissions left.
Definition access.h:724
uint8_t period_div
Divisor for the Period.
Definition access.h:723
struct net_buf_simple * msg
Publication buffer, containing the publication message.
Definition access.h:737
uint8_t ttl
Publish Time to Live.
Definition access.h:720
const struct bt_mesh_model * mod
The model the context belongs to.
Definition access.h:710
uint32_t period_start
Start of the current period.
Definition access.h:728
uint16_t send_rel
Force reliable sending (segment acks)
Definition access.h:716
uint16_t fast_period
Use FastPeriodDivisor.
Definition access.h:717
const uint8_t * uuid
Label UUID if Publish Address is Virtual Address.
Definition access.h:713
uint8_t period
Publish Period.
Definition access.h:722
struct k_work_delayable timer
Publish Period Timer.
Definition access.h:760
Abstraction that describes a Mesh Model instance.
Definition access.h:891
const uint8_t **const uuids
List of Label UUIDs the model is subscribed to.
Definition access.h:926
const struct bt_mesh_mod_id_vnd vnd
Vendor model ID.
Definition access.h:896
struct bt_mesh_model::bt_mesh_model_rt_ctx rt
uint16_t *const groups
Subscription List (group or virtual addresses)
Definition access.h:921
const struct bt_mesh_model_op *const op
Opcode handler list.
Definition access.h:930
uint16_t *const keys
AppKey List.
Definition access.h:917
const struct bt_mesh_model_cb *const cb
Model callback structure.
Definition access.h:933
const uint16_t keys_cnt
Definition access.h:918
const uint16_t id
SIG model ID.
Definition access.h:894
const uint16_t groups_cnt
Definition access.h:922
struct bt_mesh_model_pub *const pub
Model Publication.
Definition access.h:914
const struct bt_mesh_models_metadata_entry *const metadata
Definition access.h:937
Models Metadata Entry struct.
Definition access.h:782
const uint16_t len
Definition access.h:784
const void *const data
Definition access.h:790
const uint16_t id
Definition access.h:787
Message sending context.
Definition msg.h:76
Callback structure for monitoring model message sending.
Definition access.h:942
void(* start)(uint16_t duration, int err, void *cb_data)
Handler called at the start of the transmission.
Definition access.h:949
void(* end)(int err, void *cb_data)
Handler called at the end of the transmission.
Definition access.h:955
A structure used to submit work after a delay.
Definition kernel.h:3985
Simple network buffer representation.
Definition net_buf.h:89