nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
dm_srv.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
14#ifndef BT_MESH_DM_SRV_H__
15#define BT_MESH_DM_SRV_H__
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
22#include <zephyr/bluetooth/addr.h>
23#include <zephyr/sys/slist.h>
24#include <zephyr/bluetooth/mesh/access.h>
25#include "dm_common.h"
26
32 const struct bt_mesh_model *model;
34 bool is_busy;
38 struct k_sem dm_ready_sem;
40 uint16_t target_addr;
42 struct bt_mesh_msg_ctx rsp_ctx;
46 struct k_work_delayable timeout;
47
48 struct {
52 uint8_t entry_cnt;
58};
59
68#define BT_MESH_MODEL_DM_SRV_INIT(_mem, _cnt) \
69 { \
70 .results.res = _mem, \
71 .results.entry_cnt = _cnt, \
72 .cfg.ttl = CONFIG_BT_MESH_DEFAULT_TTL, \
73 .cfg.timeout = CONFIG_BT_MESH_DM_SRV_DEFAULT_TIMEOUT, \
74 .cfg.delay = CONFIG_BT_MESH_DM_SRV_REFLECTOR_DELAY, \
75 .results.last_entry_idx = 0, \
76 .results.available_entries = 0, \
77 }
78
85#define BT_MESH_MODEL_DM_SRV(_srv) \
86 BT_MESH_MODEL_VND_CB(BT_MESH_VENDOR_COMPANY_ID, BT_MESH_MODEL_ID_DM_SRV, \
87 _bt_mesh_dm_srv_op, NULL, \
88 BT_MESH_MODEL_USER_DATA(struct bt_mesh_dm_srv, _srv), \
89 &_bt_mesh_dm_srv_cb)
90
93extern const struct bt_mesh_model_op _bt_mesh_dm_srv_op[];
94extern const struct bt_mesh_model_cb _bt_mesh_dm_srv_cb;
95
98#ifdef __cplusplus
99}
100#endif
101
102#endif /* BT_MESH_DM_SRV_H__ */
103
dm_dev_role
Role definition.
Definition: dm.h:28
Definition: dm_common.h:59
Definition: dm_common.h:29
uint8_t entry_cnt
Definition: dm_srv.h:52
uint16_t target_addr
Definition: dm_srv.h:40
struct bt_mesh_dm_srv::@167 results
const struct bt_mesh_model * model
Definition: dm_srv.h:32
struct bt_mesh_dm_res_entry * res
Definition: dm_srv.h:50
struct bt_mesh_dm_cfg cfg
Definition: dm_srv.h:36
uint8_t available_entries
Definition: dm_srv.h:56
uint8_t last_entry_idx
Definition: dm_srv.h:54
struct bt_mesh_tid_ctx prev_transaction
Definition: dm_srv.h:30
struct k_work_delayable timeout
Definition: dm_srv.h:46
bool is_busy
Definition: dm_srv.h:34
struct k_sem dm_ready_sem
Definition: dm_srv.h:38
enum dm_dev_role current_role
Definition: dm_srv.h:44
struct bt_mesh_msg_ctx rsp_ctx
Definition: dm_srv.h:42
Definition: dm_srv.h:28
Definition: model_types.h:46