Lines Matching full:model
108 static int health_fault_get(struct bt_mesh_model *model, in health_fault_get() argument
119 health_get_registered(model, company_id, &sdu); in health_fault_get()
121 if (bt_mesh_model_send(model, ctx, &sdu, NULL, NULL)) { in health_fault_get()
128 static int health_fault_clear_unrel(struct bt_mesh_model *model, in health_fault_clear_unrel() argument
132 struct bt_mesh_health_srv *srv = model->user_data; in health_fault_clear_unrel()
140 return srv->cb->fault_clear(model, company_id); in health_fault_clear_unrel()
146 static int health_fault_clear(struct bt_mesh_model *model, in health_fault_clear() argument
151 struct bt_mesh_health_srv *srv = model->user_data; in health_fault_clear()
161 err = srv->cb->fault_clear(model, company_id); in health_fault_clear()
167 health_get_registered(model, company_id, &sdu); in health_fault_clear()
169 if (bt_mesh_model_send(model, ctx, &sdu, NULL, NULL)) { in health_fault_clear()
176 static int health_fault_test_unrel(struct bt_mesh_model *model, in health_fault_test_unrel() argument
180 struct bt_mesh_health_srv *srv = model->user_data; in health_fault_test_unrel()
190 return srv->cb->fault_test(model, test_id, company_id); in health_fault_test_unrel()
196 static int health_fault_test(struct bt_mesh_model *model, in health_fault_test() argument
201 struct bt_mesh_health_srv *srv = model->user_data; in health_fault_test()
215 err = srv->cb->fault_test(model, test_id, company_id); in health_fault_test()
222 health_get_registered(model, company_id, &sdu); in health_fault_test()
224 if (bt_mesh_model_send(model, ctx, &sdu, NULL, NULL)) { in health_fault_test()
231 static int send_attention_status(struct bt_mesh_model *model, in send_attention_status() argument
236 struct bt_mesh_health_srv *srv = model->user_data; in send_attention_status()
247 if (bt_mesh_model_send(model, ctx, &msg, NULL, NULL)) { in send_attention_status()
254 static int attention_get(struct bt_mesh_model *model, in attention_get() argument
260 return send_attention_status(model, ctx); in attention_get()
263 static int attention_set_unrel(struct bt_mesh_model *model, in attention_set_unrel() argument
273 bt_mesh_attention(model, time); in attention_set_unrel()
278 static int attention_set(struct bt_mesh_model *model, in attention_set() argument
286 err = attention_set_unrel(model, ctx, buf); in attention_set()
291 return send_attention_status(model, ctx); in attention_set()
294 static int send_health_period_status(struct bt_mesh_model *model, in send_health_period_status() argument
302 net_buf_simple_add_u8(&msg, model->pub->period_div); in send_health_period_status()
304 if (bt_mesh_model_send(model, ctx, &msg, NULL, NULL)) { in send_health_period_status()
311 static int health_period_get(struct bt_mesh_model *model, in health_period_get() argument
317 return send_health_period_status(model, ctx); in health_period_get()
320 static int health_period_set_unrel(struct bt_mesh_model *model, in health_period_set_unrel() argument
334 model->pub->period_div = period; in health_period_set_unrel()
339 static int health_period_set(struct bt_mesh_model *model, in health_period_set() argument
347 err = health_period_set_unrel(model, ctx, buf); in health_period_set()
352 return send_health_period_status(model, ctx); in health_period_set()
417 srv->cb->attn_off(srv->model); in attention_off()
421 static int health_srv_init(struct bt_mesh_model *model) in health_srv_init() argument
423 struct bt_mesh_health_srv *srv = model->user_data; in health_srv_init()
430 if (!model->pub) { in health_srv_init()
435 model->pub->update = health_pub_update; in health_srv_init()
439 srv->model = model; in health_srv_init()
441 if (bt_mesh_model_in_primary(model)) { in health_srv_init()
452 void bt_mesh_attention(struct bt_mesh_model *model, uint8_t time) in bt_mesh_attention() argument
456 if (!model) { in bt_mesh_attention()
463 model = srv->model; in bt_mesh_attention()
465 srv = model->user_data; in bt_mesh_attention()
469 srv->cb->attn_on(model); in bt_mesh_attention()