Lines Matching full:model

107 static int health_fault_get(const struct bt_mesh_model *model,  in health_fault_get()  argument
118 health_get_registered(model, company_id, &sdu); in health_fault_get()
120 if (bt_mesh_model_send(model, ctx, &sdu, NULL, NULL)) { in health_fault_get()
127 static int health_fault_clear_unrel(const struct bt_mesh_model *model, in health_fault_clear_unrel() argument
131 struct bt_mesh_health_srv *srv = model->rt->user_data; in health_fault_clear_unrel()
139 return srv->cb->fault_clear(model, company_id); in health_fault_clear_unrel()
145 static int health_fault_clear(const struct bt_mesh_model *model, in health_fault_clear() argument
150 struct bt_mesh_health_srv *srv = model->rt->user_data; in health_fault_clear()
160 err = srv->cb->fault_clear(model, company_id); in health_fault_clear()
166 health_get_registered(model, company_id, &sdu); in health_fault_clear()
168 if (bt_mesh_model_send(model, ctx, &sdu, NULL, NULL)) { in health_fault_clear()
175 static int health_fault_test_unrel(const struct bt_mesh_model *model, in health_fault_test_unrel() argument
179 struct bt_mesh_health_srv *srv = model->rt->user_data; in health_fault_test_unrel()
189 return srv->cb->fault_test(model, test_id, company_id); in health_fault_test_unrel()
195 static int health_fault_test(const struct bt_mesh_model *model, in health_fault_test() argument
200 struct bt_mesh_health_srv *srv = model->rt->user_data; in health_fault_test()
214 err = srv->cb->fault_test(model, test_id, company_id); in health_fault_test()
221 health_get_registered(model, company_id, &sdu); in health_fault_test()
223 if (bt_mesh_model_send(model, ctx, &sdu, NULL, NULL)) { in health_fault_test()
230 static int send_attention_status(const struct bt_mesh_model *model, in send_attention_status() argument
235 struct bt_mesh_health_srv *srv = model->rt->user_data; in send_attention_status()
246 if (bt_mesh_model_send(model, ctx, &msg, NULL, NULL)) { in send_attention_status()
253 static int attention_get(const struct bt_mesh_model *model, in attention_get() argument
259 return send_attention_status(model, ctx); in attention_get()
262 static int attention_set_unrel(const struct bt_mesh_model *model, in attention_set_unrel() argument
272 bt_mesh_attention(model, time); in attention_set_unrel()
277 static int attention_set(const struct bt_mesh_model *model, in attention_set() argument
285 err = attention_set_unrel(model, ctx, buf); in attention_set()
290 return send_attention_status(model, ctx); in attention_set()
293 static int send_health_period_status(const struct bt_mesh_model *model, in send_health_period_status() argument
301 net_buf_simple_add_u8(&msg, model->pub->period_div); in send_health_period_status()
303 if (bt_mesh_model_send(model, ctx, &msg, NULL, NULL)) { in send_health_period_status()
310 static int health_period_get(const struct bt_mesh_model *model, in health_period_get() argument
316 return send_health_period_status(model, ctx); in health_period_get()
319 static int health_period_set_unrel(const struct bt_mesh_model *model, in health_period_set_unrel() argument
333 model->pub->period_div = period; in health_period_set_unrel()
338 static int health_period_set(const struct bt_mesh_model *model, in health_period_set() argument
346 err = health_period_set_unrel(model, ctx, buf); in health_period_set()
351 return send_health_period_status(model, ctx); in health_period_set()
416 srv->cb->attn_off(srv->model); in attention_off()
420 static int health_srv_init(const struct bt_mesh_model *model) in health_srv_init() argument
422 struct bt_mesh_health_srv *srv = model->rt->user_data; in health_srv_init()
429 if (!model->pub) { in health_srv_init()
434 model->pub->update = health_pub_update; in health_srv_init()
438 srv->model = model; in health_srv_init()
440 if (bt_mesh_model_in_primary(model)) { in health_srv_init()
451 void bt_mesh_attention(const struct bt_mesh_model *model, uint8_t time) in bt_mesh_attention() argument
455 if (!model) { in bt_mesh_attention()
462 model = srv->model; in bt_mesh_attention()
464 srv = model->rt->user_data; in bt_mesh_attention()
468 srv->cb->attn_on(model); in bt_mesh_attention()