Lines Matching full:pub

119 	if (!model->pub) {  in _mod_pub_set()
127 if (!model->pub->update && period) { in _mod_pub_set()
132 if (model->pub->addr == BT_MESH_ADDR_UNASSIGNED) { in _mod_pub_set()
136 model->pub->addr = BT_MESH_ADDR_UNASSIGNED; in _mod_pub_set()
137 model->pub->key = 0U; in _mod_pub_set()
138 model->pub->cred = 0U; in _mod_pub_set()
139 model->pub->ttl = 0U; in _mod_pub_set()
140 model->pub->period = 0U; in _mod_pub_set()
141 model->pub->retransmit = 0U; in _mod_pub_set()
142 model->pub->count = 0U; in _mod_pub_set()
143 model->pub->uuid = NULL; in _mod_pub_set()
145 if (model->pub->update) { in _mod_pub_set()
146 /* If this fails, the timer will check pub->addr and in _mod_pub_set()
149 (void)k_work_cancel_delayable(&model->pub->timer); in _mod_pub_set()
164 if (BT_MESH_ADDR_IS_VIRTUAL(model->pub->addr)) { in _mod_pub_set()
165 (void)bt_mesh_va_del(model->pub->uuid); in _mod_pub_set()
169 model->pub->addr = pub_addr; in _mod_pub_set()
170 model->pub->key = app_idx; in _mod_pub_set()
171 model->pub->cred = cred_flag; in _mod_pub_set()
172 model->pub->ttl = ttl; in _mod_pub_set()
173 model->pub->period = period; in _mod_pub_set()
174 model->pub->retransmit = retransmit; in _mod_pub_set()
175 model->pub->uuid = uuid; in _mod_pub_set()
177 if (model->pub->update) { in _mod_pub_set()
184 k_work_reschedule(&model->pub->timer, in _mod_pub_set()
190 (void)k_work_cancel_delayable(&model->pub->timer); in _mod_pub_set()
255 if (model->pub && model->pub->key == key_idx) { in mod_unbind()
673 idx_cred = mod->pub->key | (uint16_t)mod->pub->cred << 12; in send_mod_pub_status()
675 net_buf_simple_add_u8(&msg, mod->pub->ttl); in send_mod_pub_status()
676 net_buf_simple_add_u8(&msg, mod->pub->period); in send_mod_pub_status()
677 net_buf_simple_add_u8(&msg, mod->pub->retransmit); in send_mod_pub_status()
731 if (!mod->pub) { in mod_pub_get()
736 pub_addr = mod->pub->addr; in mod_pub_get()
2258 const struct bt_mesh_hb_pub *pub) in hb_pub_send_status() argument
2268 net_buf_simple_add_le16(&msg, pub->dst); in hb_pub_send_status()
2269 if (pub->dst == BT_MESH_ADDR_UNASSIGNED) { in hb_pub_send_status()
2272 net_buf_simple_add_u8(&msg, hb_pub_count_log(pub->count)); in hb_pub_send_status()
2273 net_buf_simple_add_u8(&msg, bt_mesh_hb_log(pub->period)); in hb_pub_send_status()
2274 net_buf_simple_add_u8(&msg, pub->ttl); in hb_pub_send_status()
2275 net_buf_simple_add_le16(&msg, pub->feat); in hb_pub_send_status()
2276 net_buf_simple_add_le16(&msg, pub->net_idx & 0xfff); in hb_pub_send_status()
2290 struct bt_mesh_hb_pub pub; in heartbeat_pub_get() local
2294 bt_mesh_hb_pub_get(&pub); in heartbeat_pub_get()
2296 return hb_pub_send_status(model, ctx, STATUS_SUCCESS, &pub); in heartbeat_pub_get()
2304 struct bt_mesh_hb_pub pub; in heartbeat_pub_set() local
2309 pub.dst = sys_le16_to_cpu(param->dst); in heartbeat_pub_set()
2312 pub.count = 0xfffe; in heartbeat_pub_set()
2314 pub.count = bt_mesh_hb_pwr2(param->count_log); in heartbeat_pub_set()
2318 pub.period = 0x10000; in heartbeat_pub_set()
2320 pub.period = bt_mesh_hb_pwr2(param->period_log); in heartbeat_pub_set()
2323 pub.ttl = param->ttl; in heartbeat_pub_set()
2324 pub.feat = sys_le16_to_cpu(param->feat); in heartbeat_pub_set()
2325 pub.net_idx = sys_le16_to_cpu(param->net_idx); in heartbeat_pub_set()
2328 if (BT_MESH_ADDR_IS_VIRTUAL(pub.dst)) { in heartbeat_pub_set()
2348 if (pub.net_idx > 0xfff) { in heartbeat_pub_set()
2349 LOG_ERR("Invalid NetKeyIndex 0x%04x", pub.net_idx); in heartbeat_pub_set()
2353 status = bt_mesh_hb_pub_set(&pub); in heartbeat_pub_set()
2356 return hb_pub_send_status(model, ctx, status, &pub); in heartbeat_pub_set()