15#ifndef BT_MESH_GEN_LOC_SRV_H__
16#define BT_MESH_GEN_LOC_SRV_H__
19#include <zephyr/sys/util.h>
33#define BT_MESH_LOC_SRV_INIT(_handlers) \
35 .handlers = _handlers, \
44#define BT_MESH_MODEL_LOC_SRV(_srv) \
45 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_LOCATION_SRV, \
46 _bt_mesh_loc_srv_op, &(_srv)->pub, \
47 BT_MESH_MODEL_USER_DATA(struct bt_mesh_loc_srv, \
49 &_bt_mesh_loc_srv_cb), \
50 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_LOCATION_SETUPSRV, \
51 _bt_mesh_loc_setup_srv_op, NULL, \
52 BT_MESH_MODEL_USER_DATA(struct bt_mesh_loc_srv, _srv), \
53 &_bt_mesh_loc_setup_srv_cb)
67 struct bt_mesh_msg_ctx *ctx,
83 struct bt_mesh_msg_ctx *ctx,
96 struct bt_mesh_msg_ctx *ctx,
112 struct bt_mesh_msg_ctx *ctx,
124 struct bt_mesh_model_pub
pub;
129 BT_MESH_MODEL_BUF_LEN(BT_MESH_LOC_OP_LOCAL_STATUS,
130 BT_MESH_LOC_MSG_LEN_LOCAL_STATUS),
131 BT_MESH_MODEL_BUF_LEN(BT_MESH_LOC_OP_GLOBAL_STATUS,
132 BT_MESH_LOC_MSG_LEN_GLOBAL_STATUS))];
169 struct bt_mesh_msg_ctx *ctx,
194 struct bt_mesh_msg_ctx *ctx,
198extern const struct bt_mesh_model_op _bt_mesh_loc_srv_op[];
199extern const struct bt_mesh_model_op _bt_mesh_loc_setup_srv_op[];
200extern const struct bt_mesh_model_cb _bt_mesh_loc_srv_cb;
201extern const struct bt_mesh_model_cb _bt_mesh_loc_setup_srv_cb;
int bt_mesh_loc_srv_local_pub(struct bt_mesh_loc_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_loc_local *local)
Publish the Local Location state.
int bt_mesh_loc_srv_global_pub(struct bt_mesh_loc_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_loc_global *global)
Publish the Global Location state.
void(*const global_get)(struct bt_mesh_loc_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_loc_global *rsp)
Get the Global Location state.
Definition gen_loc_srv.h:66
void(*const local_set)(struct bt_mesh_loc_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_loc_local *loc)
Set the Local Location state.
Definition gen_loc_srv.h:111
void(*const global_set)(struct bt_mesh_loc_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_loc_global *loc)
Set the Global Location state.
Definition gen_loc_srv.h:82
void(*const local_get)(struct bt_mesh_loc_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_loc_local *rsp)
Get the Local Location state.
Definition gen_loc_srv.h:95
Definition gen_loc_srv.h:56
uint8_t is_local_available
Definition gen_loc_srv.h:139
struct bt_mesh_loc_srv::@152 pub_state
uint8_t is_global_available
Definition gen_loc_srv.h:137
uint8_t pub_data[MAX(BT_MESH_MODEL_BUF_LEN(BT_MESH_LOC_OP_LOCAL_STATUS, BT_MESH_LOC_MSG_LEN_LOCAL_STATUS), BT_MESH_MODEL_BUF_LEN(BT_MESH_LOC_OP_GLOBAL_STATUS, BT_MESH_LOC_MSG_LEN_GLOBAL_STATUS))]
Definition gen_loc_srv.h:132
struct net_buf_simple pub_buf
Definition gen_loc_srv.h:126
const struct bt_mesh_loc_srv_handlers *const handlers
Definition gen_loc_srv.h:144
const struct bt_mesh_model * model
Definition gen_loc_srv.h:122
uint8_t was_last_local
Definition gen_loc_srv.h:141
struct bt_mesh_model_pub pub
Definition gen_loc_srv.h:124
Definition gen_loc_srv.h:120