Zephyr Project API  3.4.0
A Scalable Open Source RTOS
access.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2017 Intel Corporation
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef ZEPHYR_INCLUDE_BLUETOOTH_MESH_ACCESS_H_
11#define ZEPHYR_INCLUDE_BLUETOOTH_MESH_ACCESS_H_
12
13#include <zephyr/sys/util.h>
16
17/* Internal macros used to initialize array members */
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_MODEL_KEYS_UNUSED(_keys) \
21 { LISTIFY(_keys, BT_MESH_KEY_UNUSED_ELT_, (,)) }
22#define BT_MESH_MODEL_GROUPS_UNASSIGNED(_grps) \
23 { LISTIFY(_grps, BT_MESH_ADDR_UNASSIGNED_ELT_, (,)) }
24
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#define BT_MESH_ADDR_UNASSIGNED 0x0000
37#define BT_MESH_ADDR_ALL_NODES 0xffff
38#define BT_MESH_ADDR_RELAYS 0xfffe
39#define BT_MESH_ADDR_FRIENDS 0xfffd
40#define BT_MESH_ADDR_PROXIES 0xfffc
41#define BT_MESH_ADDR_DFW_NODES 0xfffb
42#define BT_MESH_ADDR_IP_NODES 0xfffa
43#define BT_MESH_ADDR_IP_BR_ROUTERS 0xfff9
44
45#define BT_MESH_KEY_UNUSED 0xffff
46#define BT_MESH_KEY_ANY 0xffff
47#define BT_MESH_KEY_DEV 0xfffe
48#define BT_MESH_KEY_DEV_LOCAL BT_MESH_KEY_DEV
49#define BT_MESH_KEY_DEV_REMOTE 0xfffd
50#define BT_MESH_KEY_DEV_ANY 0xfffc
51
52#define BT_MESH_ADDR_IS_UNICAST(addr) ((addr) && (addr) < 0x8000)
53#define BT_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) < 0xff00)
54#define BT_MESH_ADDR_IS_FIXED_GROUP(addr) ((addr) >= 0xff00 && (addr) < 0xffff)
55#define BT_MESH_ADDR_IS_VIRTUAL(addr) ((addr) >= 0x8000 && (addr) < 0xc000)
56#define BT_MESH_ADDR_IS_RFU(addr) ((addr) >= 0xff00 && (addr) <= 0xfff8)
57
58#define BT_MESH_IS_DEV_KEY(key) (key == BT_MESH_KEY_DEV_LOCAL || \
59 key == BT_MESH_KEY_DEV_REMOTE)
60
62#define BT_MESH_APP_SEG_SDU_MAX 12
63
65#define BT_MESH_APP_UNSEG_SDU_MAX 15
66
68#if defined(CONFIG_BT_MESH_RX_SEG_MAX)
69#define BT_MESH_RX_SEG_MAX CONFIG_BT_MESH_RX_SEG_MAX
70#else
71#define BT_MESH_RX_SEG_MAX 0
72#endif
73
75#if defined(CONFIG_BT_MESH_TX_SEG_MAX)
76#define BT_MESH_TX_SEG_MAX CONFIG_BT_MESH_TX_SEG_MAX
77#else
78#define BT_MESH_TX_SEG_MAX 0
79#endif
80
82#define BT_MESH_TX_SDU_MAX MAX((BT_MESH_TX_SEG_MAX * \
83 BT_MESH_APP_SEG_SDU_MAX), \
84 BT_MESH_APP_UNSEG_SDU_MAX)
85
87#define BT_MESH_RX_SDU_MAX MAX((BT_MESH_RX_SEG_MAX * \
88 BT_MESH_APP_SEG_SDU_MAX), \
89 BT_MESH_APP_UNSEG_SDU_MAX)
90
100#define BT_MESH_ELEM(_loc, _mods, _vnd_mods) \
101{ \
102 .loc = (_loc), \
103 .model_count = ARRAY_SIZE(_mods), \
104 .vnd_model_count = ARRAY_SIZE(_vnd_mods), \
105 .models = (_mods), \
106 .vnd_models = (_vnd_mods), \
107}
108
113
120
122 struct bt_mesh_model * const models;
124 struct bt_mesh_model * const vnd_models;
125};
126
127/* Foundation Models */
128#define BT_MESH_MODEL_ID_CFG_SRV 0x0000
129#define BT_MESH_MODEL_ID_CFG_CLI 0x0001
130#define BT_MESH_MODEL_ID_HEALTH_SRV 0x0002
131#define BT_MESH_MODEL_ID_HEALTH_CLI 0x0003
132#define BT_MESH_MODEL_ID_REMOTE_PROV_SRV 0x0004
133#define BT_MESH_MODEL_ID_REMOTE_PROV_CLI 0x0005
134#define BT_MESH_MODEL_ID_PRIV_BEACON_SRV 0x000a
135#define BT_MESH_MODEL_ID_PRIV_BEACON_CLI 0x000b
136#define BT_MESH_MODEL_ID_SAR_CFG_SRV 0x000e
137#define BT_MESH_MODEL_ID_SAR_CFG_CLI 0x000f
138#define BT_MESH_MODEL_ID_OP_AGG_SRV 0x0010
139#define BT_MESH_MODEL_ID_OP_AGG_CLI 0x0011
140#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_SRV 0x0012
141#define BT_MESH_MODEL_ID_LARGE_COMP_DATA_CLI 0x0013
142#define BT_MESH_MODEL_ID_SOL_PDU_RPL_SRV 0x0014
143#define BT_MESH_MODEL_ID_SOL_PDU_RPL_CLI 0x0015
144#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_SRV 0x000c
145#define BT_MESH_MODEL_ID_ON_DEMAND_PROXY_CLI 0x000d
146
147/* Models from the Mesh Model Specification */
148#define BT_MESH_MODEL_ID_GEN_ONOFF_SRV 0x1000
149#define BT_MESH_MODEL_ID_GEN_ONOFF_CLI 0x1001
150#define BT_MESH_MODEL_ID_GEN_LEVEL_SRV 0x1002
151#define BT_MESH_MODEL_ID_GEN_LEVEL_CLI 0x1003
152#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_SRV 0x1004
153#define BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_CLI 0x1005
154#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV 0x1006
155#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV 0x1007
156#define BT_MESH_MODEL_ID_GEN_POWER_ONOFF_CLI 0x1008
157#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV 0x1009
158#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV 0x100a
159#define BT_MESH_MODEL_ID_GEN_POWER_LEVEL_CLI 0x100b
160#define BT_MESH_MODEL_ID_GEN_BATTERY_SRV 0x100c
161#define BT_MESH_MODEL_ID_GEN_BATTERY_CLI 0x100d
162#define BT_MESH_MODEL_ID_GEN_LOCATION_SRV 0x100e
163#define BT_MESH_MODEL_ID_GEN_LOCATION_SETUPSRV 0x100f
164#define BT_MESH_MODEL_ID_GEN_LOCATION_CLI 0x1010
165#define BT_MESH_MODEL_ID_GEN_ADMIN_PROP_SRV 0x1011
166#define BT_MESH_MODEL_ID_GEN_MANUFACTURER_PROP_SRV 0x1012
167#define BT_MESH_MODEL_ID_GEN_USER_PROP_SRV 0x1013
168#define BT_MESH_MODEL_ID_GEN_CLIENT_PROP_SRV 0x1014
169#define BT_MESH_MODEL_ID_GEN_PROP_CLI 0x1015
170#define BT_MESH_MODEL_ID_SENSOR_SRV 0x1100
171#define BT_MESH_MODEL_ID_SENSOR_SETUP_SRV 0x1101
172#define BT_MESH_MODEL_ID_SENSOR_CLI 0x1102
173#define BT_MESH_MODEL_ID_TIME_SRV 0x1200
174#define BT_MESH_MODEL_ID_TIME_SETUP_SRV 0x1201
175#define BT_MESH_MODEL_ID_TIME_CLI 0x1202
176#define BT_MESH_MODEL_ID_SCENE_SRV 0x1203
177#define BT_MESH_MODEL_ID_SCENE_SETUP_SRV 0x1204
178#define BT_MESH_MODEL_ID_SCENE_CLI 0x1205
179#define BT_MESH_MODEL_ID_SCHEDULER_SRV 0x1206
180#define BT_MESH_MODEL_ID_SCHEDULER_SETUP_SRV 0x1207
181#define BT_MESH_MODEL_ID_SCHEDULER_CLI 0x1208
182#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SRV 0x1300
183#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV 0x1301
184#define BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_CLI 0x1302
185#define BT_MESH_MODEL_ID_LIGHT_CTL_SRV 0x1303
186#define BT_MESH_MODEL_ID_LIGHT_CTL_SETUP_SRV 0x1304
187#define BT_MESH_MODEL_ID_LIGHT_CTL_CLI 0x1305
188#define BT_MESH_MODEL_ID_LIGHT_CTL_TEMP_SRV 0x1306
189#define BT_MESH_MODEL_ID_LIGHT_HSL_SRV 0x1307
190#define BT_MESH_MODEL_ID_LIGHT_HSL_SETUP_SRV 0x1308
191#define BT_MESH_MODEL_ID_LIGHT_HSL_CLI 0x1309
192#define BT_MESH_MODEL_ID_LIGHT_HSL_HUE_SRV 0x130a
193#define BT_MESH_MODEL_ID_LIGHT_HSL_SAT_SRV 0x130b
194#define BT_MESH_MODEL_ID_LIGHT_XYL_SRV 0x130c
195#define BT_MESH_MODEL_ID_LIGHT_XYL_SETUP_SRV 0x130d
196#define BT_MESH_MODEL_ID_LIGHT_XYL_CLI 0x130e
197#define BT_MESH_MODEL_ID_LIGHT_LC_SRV 0x130f
198#define BT_MESH_MODEL_ID_LIGHT_LC_SETUPSRV 0x1310
199#define BT_MESH_MODEL_ID_LIGHT_LC_CLI 0x1311
200#define BT_MESH_MODEL_ID_BLOB_SRV 0x1400
201#define BT_MESH_MODEL_ID_BLOB_CLI 0x1401
202#define BT_MESH_MODEL_ID_DFU_SRV 0x1402
203#define BT_MESH_MODEL_ID_DFU_CLI 0x1403
204#define BT_MESH_MODEL_ID_DFD_SRV 0x1404
205#define BT_MESH_MODEL_ID_DFD_CLI 0x1405
206
211
219
229 int (*const func)(struct bt_mesh_model *model,
230 struct bt_mesh_msg_ctx *ctx,
231 struct net_buf_simple *buf);
232};
233
234#define BT_MESH_MODEL_OP_1(b0) (b0)
235#define BT_MESH_MODEL_OP_2(b0, b1) (((b0) << 8) | (b1))
236#define BT_MESH_MODEL_OP_3(b0, cid) ((((b0) << 16) | 0xc00000) | (cid))
237
239#define BT_MESH_LEN_EXACT(len) (-len)
241#define BT_MESH_LEN_MIN(len) (len)
242
244#define BT_MESH_MODEL_OP_END { 0, 0, NULL }
245
246#if !defined(__cplusplus) || defined(__DOXYGEN__)
253#define BT_MESH_MODEL_NO_OPS ((struct bt_mesh_model_op []) \
254 { BT_MESH_MODEL_OP_END })
255
262#define BT_MESH_MODEL_NONE ((struct bt_mesh_model []){})
263
281#define BT_MESH_MODEL_CNT_CB(_id, _op, _pub, _user_data, _keys, _grps, _cb) \
282{ \
283 .id = (_id), \
284 .pub = _pub, \
285 .keys = (uint16_t []) BT_MESH_MODEL_KEYS_UNUSED(_keys), \
286 .keys_cnt = _keys, \
287 .groups = (uint16_t []) BT_MESH_MODEL_GROUPS_UNASSIGNED(_grps), \
288 .groups_cnt = _grps, \
289 .op = _op, \
290 .cb = _cb, \
291 .user_data = _user_data, \
292}
293
312#define BT_MESH_MODEL_CNT_VND_CB(_company, _id, _op, _pub, _user_data, _keys, _grps, _cb) \
313{ \
314 .vnd.company = (_company), \
315 .vnd.id = (_id), \
316 .op = _op, \
317 .pub = _pub, \
318 .keys = (uint16_t []) BT_MESH_MODEL_KEYS_UNUSED(_keys), \
319 .keys_cnt = _keys, \
320 .groups = (uint16_t []) BT_MESH_MODEL_GROUPS_UNASSIGNED(_grps), \
321 .groups_cnt = _grps, \
322 .user_data = _user_data, \
323 .cb = _cb, \
324}
325
338#define BT_MESH_MODEL_CB(_id, _op, _pub, _user_data, _cb) \
339 BT_MESH_MODEL_CNT_CB(_id, _op, _pub, _user_data, \
340 CONFIG_BT_MESH_MODEL_KEY_COUNT, \
341 CONFIG_BT_MESH_MODEL_GROUP_COUNT, _cb)
342
343
358#if defined(CONFIG_BT_MESH_LARGE_COMP_DATA_SRV)
359#define BT_MESH_MODEL_METADATA_CB(_id, _op, _pub, _user_data, _cb, _metadata) \
360{ \
361 .id = (_id), \
362 .pub = _pub, \
363 .keys = (uint16_t []) BT_MESH_MODEL_KEYS_UNUSED(CONFIG_BT_MESH_MODEL_KEY_COUNT), \
364 .keys_cnt = CONFIG_BT_MESH_MODEL_KEY_COUNT, \
365 .groups = (uint16_t []) BT_MESH_MODEL_GROUPS_UNASSIGNED(CONFIG_BT_MESH_MODEL_GROUP_COUNT), \
366 .groups_cnt = CONFIG_BT_MESH_MODEL_GROUP_COUNT, \
367 .op = _op, \
368 .cb = _cb, \
369 .user_data = _user_data, \
370 .metadata = _metadata, \
371}
372#else
373#define BT_MESH_MODEL_METADATA_CB(_id, _op, _pub, _user_data, _cb, _metadata) \
374 BT_MESH_MODEL_CB(_id, _op, _pub, _user_data, _cb)
375#endif
376
391#define BT_MESH_MODEL_VND_CB(_company, _id, _op, _pub, _user_data, _cb) \
392 BT_MESH_MODEL_CNT_VND_CB(_company, _id, _op, _pub, _user_data, \
393 CONFIG_BT_MESH_MODEL_KEY_COUNT, \
394 CONFIG_BT_MESH_MODEL_GROUP_COUNT, _cb)
395
411#define BT_MESH_MODEL_VND_METADATA_CB(_company, _id, _op, _pub, _user_data, _cb, _metadata) \
412{ \
413 .vnd.company = (_company), \
414 .vnd.id = (_id), \
415 .op = _op, \
416 .pub = _pub, \
417 .keys = (uint16_t []) BT_MESH_MODEL_KEYS_UNUSED(CONFIG_BT_MESH_MODEL_KEY_COUNT), \
418 .keys_cnt = CONFIG_BT_MESH_MODEL_KEY_COUNT, \
419 .groups = (uint16_t []) BT_MESH_MODEL_GROUPS_UNASSIGNED(CONFIG_BT_MESH_MODEL_GROUP_COUNT), \
420 .groups_cnt = CONFIG_BT_MESH_MODEL_GROUP_COUNT, \
421 .user_data = _user_data, \
422 .cb = _cb, \
423 .metadata = _metadata, \
424}
425
437#define BT_MESH_MODEL(_id, _op, _pub, _user_data) \
438 BT_MESH_MODEL_CB(_id, _op, _pub, _user_data, NULL)
439
452#define BT_MESH_MODEL_VND(_company, _id, _op, _pub, _user_data) \
453 BT_MESH_MODEL_VND_CB(_company, _id, _op, _pub, _user_data, NULL)
454#endif /* !defined(__cplusplus) || defined(__DOXYGEN__) */
455
466#define BT_MESH_TRANSMIT(count, int_ms) ((count) | (((int_ms / 10) - 1) << 3))
467
475#define BT_MESH_TRANSMIT_COUNT(transmit) (((transmit) & (uint8_t)BIT_MASK(3)))
476
484#define BT_MESH_TRANSMIT_INT(transmit) ((((transmit) >> 3) + 1) * 10)
485
496#define BT_MESH_PUB_TRANSMIT(count, int_ms) BT_MESH_TRANSMIT(count, \
497 (int_ms) / 5)
498
506#define BT_MESH_PUB_TRANSMIT_COUNT(transmit) BT_MESH_TRANSMIT_COUNT(transmit)
507
515#define BT_MESH_PUB_TRANSMIT_INT(transmit) ((((transmit) >> 3) + 1) * 50)
516
525#define BT_MESH_PUB_MSG_TOTAL(pub) (BT_MESH_PUB_TRANSMIT_COUNT((pub)->retransmit) + 1)
526
536#define BT_MESH_PUB_MSG_NUM(pub) (BT_MESH_PUB_TRANSMIT_COUNT((pub)->retransmit) + 1 - (pub)->count)
537
546
570
589 int (*update)(struct bt_mesh_model *mod);
590
593};
594
602#define BT_MESH_MODEL_PUB_DEFINE(_name, _update, _msg_len) \
603 NET_BUF_SIMPLE_DEFINE_STATIC(bt_mesh_pub_msg_##_name, _msg_len); \
604 static struct bt_mesh_model_pub _name = { \
605 .msg = &bt_mesh_pub_msg_##_name, \
606 .update = _update, \
607 }
608
615 /* Length of the metadata */
617
618 /* ID of the metadata */
620
621 /* Pointer to raw data */
622 void *data;
623};
624
633#define BT_MESH_MODELS_METADATA_ENTRY(_len, _id, _data) \
634 { \
635 .len = (_len), .id = _id, .data = _data, \
636 }
637
639#define BT_MESH_MODELS_METADATA_NONE NULL
640
642#define BT_MESH_MODELS_METADATA_END { 0, 0, NULL }
643
659 int (*const settings_set)(struct bt_mesh_model *model,
660 const char *name, size_t len_rd,
661 settings_read_cb read_cb, void *cb_arg);
662
675 int (*const start)(struct bt_mesh_model *model);
676
689 int (*const init)(struct bt_mesh_model *model);
690
701 void (*const reset)(struct bt_mesh_model *model);
702
711 void (*const pending_store)(struct bt_mesh_model *model);
712};
713
720};
721
724 union {
729 };
730
731 /* Internal information, mainly for persistent storage */
732 uint8_t elem_idx; /* Belongs to Nth element */
733 uint8_t mod_idx; /* Is the Nth model in the element */
734 uint16_t flags; /* Model flags for internal bookkeeping */
735
737 struct bt_mesh_model_pub * const pub;
738
740 uint16_t * const keys;
742
746
748 const struct bt_mesh_model_op * const op;
749
751 const struct bt_mesh_model_cb * const cb;
752
753#ifdef CONFIG_BT_MESH_MODEL_EXTENSIONS
754 /* Pointer to the next model in a model extension list. */
756#endif
757
758#ifdef CONFIG_BT_MESH_LARGE_COMP_DATA_SRV
759 /* Pointer to the array of model metadata entries. */
760 struct bt_mesh_models_metadata_entry **metadata;
761#endif
762
765};
766
775 void (*start)(uint16_t duration, int err, void *cb_data);
781 void (*end)(int err, void *cb_data);
782};
783
784
786#define BT_MESH_TTL_DEFAULT 0xff
787
789#define BT_MESH_TTL_MAX 0x7f
790
802 struct bt_mesh_msg_ctx *ctx,
803 struct net_buf_simple *msg,
804 const struct bt_mesh_send_cb *cb,
805 void *cb_data);
806
821
830static inline bool bt_mesh_model_pub_is_retransmission(const struct bt_mesh_model *model)
831{
832 return model->pub->count != BT_MESH_PUB_TRANSMIT_COUNT(model->pub->retransmit);
833}
834
842
852 uint16_t id);
853
864 uint16_t company, uint16_t id);
865
872static inline bool bt_mesh_model_in_primary(const struct bt_mesh_model *mod)
873{
874 return (mod->elem_idx == 0);
875}
876
889 const char *name, const void *data,
890 size_t data_len);
891
904
924int bt_mesh_model_extend(struct bt_mesh_model *extending_mod,
925 struct bt_mesh_model *base_mod);
926
947int bt_mesh_model_correspond(struct bt_mesh_model *corresponding_mod,
948 struct bt_mesh_model *base_mod);
949
957
966
975
982 size_t elem_count;
984};
985
986#ifdef __cplusplus
987}
988#endif
989
994#endif /* ZEPHYR_INCLUDE_BLUETOOTH_MESH_ACCESS_H_ */
bool bt_mesh_model_is_extended(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:506
struct bt_mesh_elem * bt_mesh_model_elem(struct bt_mesh_model *mod)
Get the element that a model belongs to.
static bool bt_mesh_model_pub_is_retransmission(const struct bt_mesh_model *model)
Check if a message is being retransmitted.
Definition: access.h:830
void bt_mesh_model_data_store_schedule(struct bt_mesh_model *mod)
Schedule the model's user data store in persistent storage.
int bt_mesh_models_metadata_change_prepare(void)
Indicate that the metadata will change on next bootup.
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_publish(struct bt_mesh_model *model)
Send a model publication message.
int bt_mesh_comp_change_prepare(void)
Indicate that the composition data will change on next bootup.
int bt_mesh_model_correspond(struct bt_mesh_model *corresponding_mod, struct bt_mesh_model *base_mod)
Let a model correspond to another.
struct bt_mesh_model * bt_mesh_model_find(const struct bt_mesh_elem *elem, uint16_t id)
Find a SIG model.
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:872
int bt_mesh_model_data_store(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.
int bt_mesh_model_extend(struct bt_mesh_model *extending_mod, struct bt_mesh_model *base_mod)
Let a model extend another.
int bt_mesh_model_send(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.
ssize_t(* settings_read_cb)(void *cb_arg, void *data, size_t len)
Definition: settings.h:59
__SIZE_TYPE__ ssize_t
Definition: types.h:28
Message APIs.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Definition: access.h:977
uint16_t pid
Definition: access.h:979
uint16_t cid
Definition: access.h:978
uint16_t vid
Definition: access.h:980
struct bt_mesh_elem * elem
Definition: access.h:983
size_t elem_count
Definition: access.h:982
Definition: access.h:110
struct bt_mesh_model *const models
Definition: access.h:122
const uint16_t loc
Definition: access.h:115
const uint8_t model_count
Definition: access.h:117
struct bt_mesh_model *const vnd_models
Definition: access.h:124
uint16_t addr
Definition: access.h:112
const uint8_t vnd_model_count
Definition: access.h:119
Definition: access.h:715
uint16_t company
Definition: access.h:717
uint16_t id
Definition: access.h:719
Definition: access.h:645
int(*const settings_set)(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:659
void(*const reset)(struct bt_mesh_model *model)
Model reset callback.
Definition: access.h:701
void(*const pending_store)(struct bt_mesh_model *model)
Callback used to store pending model's user data.
Definition: access.h:711
int(*const start)(struct bt_mesh_model *model)
Callback called when the mesh is started.
Definition: access.h:675
int(*const init)(struct bt_mesh_model *model)
Model init callback.
Definition: access.h:689
Definition: access.h:208
const uint32_t opcode
Definition: access.h:210
const ssize_t len
Definition: access.h:218
int(*const func)(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf)
Handler function for this opcode.
Definition: access.h:229
Definition: access.h:543
uint16_t key
Definition: access.h:548
uint16_t retr_update
Definition: access.h:552
int(* update)(struct bt_mesh_model *mod)
Callback for updating the publication buffer.
Definition: access.h:589
uint16_t cred
Definition: access.h:549
uint8_t retransmit
Definition: access.h:555
uint16_t addr
Definition: access.h:547
uint8_t count
Definition: access.h:558
uint8_t period_div
Definition: access.h:557
struct net_buf_simple * msg
Publication buffer, containing the publication message.
Definition: access.h:569
struct bt_mesh_model * mod
Definition: access.h:545
uint8_t ttl
Definition: access.h:554
uint32_t period_start
Definition: access.h:560
uint16_t send_rel
Definition: access.h:550
uint16_t fast_period
Definition: access.h:551
uint8_t period
Definition: access.h:556
struct k_work_delayable timer
Definition: access.h:592
Definition: access.h:723
uint8_t elem_idx
Definition: access.h:732
const struct bt_mesh_mod_id_vnd vnd
Definition: access.h:728
uint16_t *const groups
Definition: access.h:744
const struct bt_mesh_model_op *const op
Definition: access.h:748
uint16_t *const keys
Definition: access.h:740
void * user_data
Definition: access.h:764
const struct bt_mesh_model_cb *const cb
Definition: access.h:751
uint16_t flags
Definition: access.h:734
const uint16_t keys_cnt
Definition: access.h:741
const uint16_t id
Definition: access.h:726
uint8_t mod_idx
Definition: access.h:733
struct bt_mesh_model * next
Definition: access.h:755
const uint16_t groups_cnt
Definition: access.h:745
struct bt_mesh_model_pub *const pub
Definition: access.h:737
Definition: access.h:614
const uint16_t len
Definition: access.h:616
void * data
Definition: access.h:622
const uint16_t id
Definition: access.h:619
Definition: msg.h:76
Definition: access.h:768
void(* start)(uint16_t duration, int err, void *cb_data)
Handler called at the start of the transmission.
Definition: access.h:775
void(* end)(int err, void *cb_data)
Handler called at the end of the transmission.
Definition: access.h:781
A structure used to submit work after a delay.
Definition: kernel.h:3793
Simple network buffer representation.
Definition: buf.h:83
static fdata_t data[2]
Definition: test_fifo_contexts.c:15
static void msg(uint64_t c64)
Definition: main.c:17
Misc utilities.