/hal_espressif-latest/components/bt/esp_ble_mesh/mesh_core/ |
D | main.c | 50 if (bt_mesh_atomic_test_and_set_bit(bt_mesh.flags, BLE_MESH_VALID)) { in bt_mesh_provision() 66 bt_mesh_atomic_clear_bit(bt_mesh.flags, BLE_MESH_VALID); in bt_mesh_provision() 75 bt_mesh.seq = 0U; in bt_mesh_provision() 79 memcpy(bt_mesh.dev_key, dev_key, 16); in bt_mesh_provision() 89 bt_mesh_store_subnet(&bt_mesh.sub[0]); in bt_mesh_provision() 110 bt_mesh.iv_index = 0U; in bt_mesh_node_reset() 111 bt_mesh.seq = 0U; in bt_mesh_node_reset() 113 bt_mesh_atomic_clear_bit(bt_mesh.flags, BLE_MESH_VALID); in bt_mesh_node_reset() 115 k_delayed_work_cancel(&bt_mesh.ivu_timer); in bt_mesh_node_reset() 140 (void)memset(bt_mesh.dev_key, 0, sizeof(bt_mesh.dev_key)); in bt_mesh_node_reset() [all …]
|
D | net.c | 69 struct bt_mesh_net bt_mesh = { variable 70 .local_queue = SYS_SLIST_STATIC_INIT(&bt_mesh.local_queue), 152 return &bt_mesh.sub[0]; in bt_mesh_subnet_get() 155 for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { in bt_mesh_subnet_get() 156 if (bt_mesh.sub[i].net_idx == net_idx) { in bt_mesh_subnet_get() 157 return &bt_mesh.sub[i]; in bt_mesh_subnet_get() 222 if (cred->addr == bt_mesh.lpn.frnd) { in friend_cred_set() 416 if (bt_mesh_atomic_test_bit(bt_mesh.flags, BLE_MESH_IVU_IN_PROGRESS)) { in bt_mesh_net_flags() 436 BT_DBG("flags 0x%02x, IVI 0x%08x", flags, bt_mesh.iv_index); in bt_mesh_net_beacon_update() 439 bt_mesh.iv_index, sub->auth); in bt_mesh_net_beacon_update() [all …]
|
D | fast_prov.c | 33 return bt_mesh.dev_key; in bt_mesh_fast_prov_dev_key_get() 44 for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { in bt_mesh_fast_prov_subnet_get() 45 sub = &bt_mesh.sub[i]; in bt_mesh_fast_prov_subnet_get() 51 for (i = 0; i < ARRAY_SIZE(bt_mesh.p_sub); i++) { in bt_mesh_fast_prov_subnet_get() 52 sub = bt_mesh.p_sub[i]; in bt_mesh_fast_prov_subnet_get() 66 for (i = 0; i < ARRAY_SIZE(bt_mesh.app_keys); i++) { in bt_mesh_fast_prov_app_key_find() 67 key = &bt_mesh.app_keys[i]; in bt_mesh_fast_prov_app_key_find() 74 for (i = 0; i < ARRAY_SIZE(bt_mesh.p_app_keys); i++) { in bt_mesh_fast_prov_app_key_find() 75 key = bt_mesh.p_app_keys[i]; in bt_mesh_fast_prov_app_key_find() 105 bt_mesh.p_net_idx_next = net_idx; in bt_mesh_fast_prov_net_key_add() [all …]
|
D | lpn.c | 104 BT_DBG("%s -> %s", state2str(bt_mesh.lpn.state), state2str(state)); in lpn_set_state() 105 bt_mesh.lpn.state = state; in lpn_set_state() 113 for (i = 0; i < ARRAY_SIZE(bt_mesh.lpn.added); i++) { in group_zero() 126 for (i = 0; i < ARRAY_SIZE(bt_mesh.lpn.added); i++) { in group_set() 139 for (i = 0; i < ARRAY_SIZE(bt_mesh.lpn.added); i++) { in group_clear() 153 struct bt_mesh_lpn *lpn = &bt_mesh.lpn; in friend_clear_sent() 183 .net_idx = bt_mesh.sub[0].net_idx, in send_friend_clear() 185 .addr = bt_mesh.lpn.frnd, in send_friend_clear() 189 .sub = &bt_mesh.sub[0], in send_friend_clear() 196 .lpn_counter = sys_cpu_to_be16(bt_mesh.lpn.counter), in send_friend_clear() [all …]
|
D | provisioner_main.c | 81 if (bt_mesh.p_sub[0]) { in bt_mesh_provisioner_net_create() 86 sub = bt_mesh.p_sub[0]; in bt_mesh_provisioner_net_create() 122 bt_mesh.p_sub[0] = sub; in bt_mesh_provisioner_net_create() 125 bt_mesh.p_app_idx_next = 0x0000; in bt_mesh_provisioner_net_create() 126 bt_mesh.p_net_idx_next = 0x0001; in bt_mesh_provisioner_net_create() 131 bt_mesh_store_p_subnet(bt_mesh.p_sub[0]); in bt_mesh_provisioner_net_create() 134 bt_mesh.iv_index = prov->iv_index; in bt_mesh_provisioner_net_create() 135 bt_mesh_atomic_set_bit_to(bt_mesh.flags, BLE_MESH_IVU_IN_PROGRESS, in bt_mesh_provisioner_net_create() 143 bt_mesh.ivu_duration = BLE_MESH_IVU_MIN_HOURS; in bt_mesh_provisioner_net_create() 160 for (i = 0; i < ARRAY_SIZE(bt_mesh.p_sub); i++) { in bt_mesh_provisioner_main_reset() [all …]
|
D | local_operation.c | 183 for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { in bt_mesh_node_local_net_key_add() 184 if (bt_mesh.sub[i].net_idx != BLE_MESH_KEY_UNUSED) { in bt_mesh_node_local_net_key_add() 185 if ((bt_mesh.sub[i].kr_flag == false && in bt_mesh_node_local_net_key_add() 186 memcmp(bt_mesh.sub[i].keys[0].net, net_key, 16) == 0) || in bt_mesh_node_local_net_key_add() 187 (bt_mesh.sub[i].kr_flag == true && in bt_mesh_node_local_net_key_add() 188 memcmp(bt_mesh.sub[i].keys[1].net, net_key, 16) == 0)) { in bt_mesh_node_local_net_key_add() 195 for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { in bt_mesh_node_local_net_key_add() 196 if (bt_mesh.sub[i].net_idx == BLE_MESH_KEY_UNUSED) { in bt_mesh_node_local_net_key_add() 197 sub = &bt_mesh.sub[i]; in bt_mesh_node_local_net_key_add() 259 for (int i = 0; i < ARRAY_SIZE(bt_mesh.app_keys); i++) { in bt_mesh_node_local_app_key_add() [all …]
|
D | settings.c | 204 err = bt_mesh_load_core_settings(name, (uint8_t *)bt_mesh.flags, sizeof(bt_mesh.flags), &exist); in role_set() 214 bt_mesh_atomic_set_bit(bt_mesh.flags, BLE_MESH_NODE); in role_set() 235 memset(bt_mesh.dev_key, 0, sizeof(bt_mesh.dev_key)); in net_set() 244 memcpy(bt_mesh.dev_key, net.dev_key, sizeof(bt_mesh.dev_key)); in net_set() 248 BT_INFO("Restored DevKey %s", bt_hex(bt_mesh.dev_key, 16)); in net_set() 264 bt_mesh.iv_index = 0U; in iv_set() 265 bt_mesh_atomic_clear_bit(bt_mesh.flags, BLE_MESH_IVU_IN_PROGRESS); in iv_set() 273 bt_mesh.iv_index = iv.iv_index; in iv_set() 274 bt_mesh_atomic_set_bit_to(bt_mesh.flags, BLE_MESH_IVU_IN_PROGRESS, iv.iv_update); in iv_set() 275 bt_mesh.ivu_duration = iv.iv_duration; in iv_set() [all …]
|
D | lpn.h | 30 return bt_mesh.lpn.established; in bt_mesh_lpn_established() 40 return (addr == bt_mesh.lpn.frnd); in bt_mesh_lpn_match() 49 return (bt_mesh.lpn.state == BLE_MESH_LPN_WAIT_UPDATE); in bt_mesh_lpn_waiting_update() 58 return (bt_mesh.lpn.state == BLE_MESH_LPN_TIMER); in bt_mesh_lpn_timer()
|
D | access.c | 965 key = bt_mesh.dev_key; in bt_mesh_tx_devkey_get() 997 size = ARRAY_SIZE(bt_mesh.sub); in bt_mesh_rx_netkey_size() 1003 size = ARRAY_SIZE(bt_mesh.p_sub); in bt_mesh_rx_netkey_size() 1008 size = ARRAY_SIZE(bt_mesh.sub); in bt_mesh_rx_netkey_size() 1010 size += ARRAY_SIZE(bt_mesh.p_sub); in bt_mesh_rx_netkey_size() 1023 sub = &bt_mesh.sub[index]; in bt_mesh_rx_netkey_get() 1029 sub = bt_mesh.p_sub[index]; in bt_mesh_rx_netkey_get() 1034 if (index < ARRAY_SIZE(bt_mesh.sub)) { in bt_mesh_rx_netkey_get() 1035 sub = &bt_mesh.sub[index]; in bt_mesh_rx_netkey_get() 1037 sub = bt_mesh.p_sub[index - ARRAY_SIZE(bt_mesh.sub)]; in bt_mesh_rx_netkey_get() [all …]
|
D | friend.c | 106 for (i = 0; i < ARRAY_SIZE(bt_mesh.frnd); i++) { in bt_mesh_friend_find() 107 struct bt_mesh_friend *frnd = &bt_mesh.frnd[i]; in bt_mesh_friend_find() 210 for (i = 0; i < ARRAY_SIZE(bt_mesh.frnd); i++) { in bt_mesh_friend_clear_net_idx() 211 struct bt_mesh_friend *frnd = &bt_mesh.frnd[i]; in bt_mesh_friend_clear_net_idx() 229 for (i = 0; i < ARRAY_SIZE(bt_mesh.frnd); i++) { in bt_mesh_friend_sec_update() 230 struct bt_mesh_friend *frnd = &bt_mesh.frnd[i]; in bt_mesh_friend_sec_update() 445 meta->net.ctx.recv_dst, bt_mesh.seq, in unseg_app_sdu_encrypt() 467 if (meta.net.seq == bt_mesh.seq) { in unseg_app_sdu_prepare() 530 iv_index = (bt_mesh.iv_index - ((bt_mesh.iv_index & 1) != ivi)); in encrypt_friend_pdu() 588 upd->iv_index = sys_cpu_to_be32(bt_mesh.iv_index); in encode_update() [all …]
|
D | beacon.c | 126 net_buf_simple_add_be32(buf, bt_mesh.iv_index); in bt_mesh_beacon_create() 131 sub->net_idx, bt_mesh.iv_index, flags); in bt_mesh_beacon_create() 324 bt_mesh_atomic_test_bit(bt_mesh.flags, BLE_MESH_IVU_INITIATOR)) { in beacon_send() 400 sub->net_idx, iv_index, bt_mesh.iv_index); in secure_beacon_recv() 402 if (bt_mesh_atomic_test_bit(bt_mesh.flags, BLE_MESH_IVU_INITIATOR) && in secure_beacon_recv() 403 (bt_mesh_atomic_test_bit(bt_mesh.flags, BLE_MESH_IVU_IN_PROGRESS) == in secure_beacon_recv() 481 bt_mesh_atomic_set_bit_to(bt_mesh.flags, BLE_MESH_IVU_INITIATOR, enable); in bt_mesh_beacon_ivu_initiator() 521 if (!bt_mesh_atomic_test_bit(bt_mesh.flags, BLE_MESH_IVU_INITIATOR)) { in bt_mesh_beacon_disable()
|
D | test.c | 46 bt_mesh_atomic_set_bit(bt_mesh.flags, BLE_MESH_NODE); in bt_mesh_device_auto_enter_network() 63 for (i = 0; i < ARRAY_SIZE(bt_mesh.app_keys); i++) { in bt_mesh_device_auto_enter_network() 64 key = &bt_mesh.app_keys[i]; in bt_mesh_device_auto_enter_network() 69 if (i == ARRAY_SIZE(bt_mesh.app_keys)) { in bt_mesh_device_auto_enter_network()
|
D | proxy_server.c | 390 for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { in proxy_send_beacons() 391 struct bt_mesh_subnet *sub = &bt_mesh.sub[i]; in proxy_send_beacons() 405 for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { in bt_mesh_proxy_server_beacon_send() 406 if (bt_mesh.sub[i].net_idx != BLE_MESH_KEY_UNUSED) { in bt_mesh_proxy_server_beacon_send() 407 bt_mesh_proxy_server_beacon_send(&bt_mesh.sub[i]); in bt_mesh_proxy_server_beacon_send() 427 next_idx = sub - bt_mesh.sub; in bt_mesh_proxy_server_identity_start() 446 for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { in bt_mesh_proxy_identity_enable() 447 struct bt_mesh_subnet *sub = &bt_mesh.sub[i]; in bt_mesh_proxy_identity_enable() 1231 for (i = next_idx; i < ARRAY_SIZE(bt_mesh.sub); i++) { in next_sub() 1232 sub = &bt_mesh.sub[i]; in next_sub() [all …]
|
D | net.h | 315 extern struct bt_mesh_net bt_mesh; 317 #define BLE_MESH_NET_IVI_TX (bt_mesh.iv_index - \ 318 bt_mesh_atomic_test_bit(bt_mesh.flags, \ 320 #define BLE_MESH_NET_IVI_RX(rx) (bt_mesh.iv_index - (rx)->old_iv)
|
D | proxy_client.c | 797 for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { in bt_mesh_proxy_client_beacon_send() 798 if (bt_mesh.sub[i].net_idx != BLE_MESH_KEY_UNUSED) { in bt_mesh_proxy_client_beacon_send() 799 send = bt_mesh_proxy_client_beacon_send(&bt_mesh.sub[i]); in bt_mesh_proxy_client_beacon_send() 807 for (i = 0; i < ARRAY_SIZE(bt_mesh.p_sub); i++) { in bt_mesh_proxy_client_beacon_send() 808 if (bt_mesh.p_sub[i] && bt_mesh.p_sub[i]->net_idx != BLE_MESH_KEY_UNUSED) { in bt_mesh_proxy_client_beacon_send() 809 send = bt_mesh_proxy_client_beacon_send(bt_mesh.p_sub[i]); in bt_mesh_proxy_client_beacon_send()
|
D | transport.c | 300 if (bt_mesh_atomic_test_and_clear_bit(bt_mesh.flags, BLE_MESH_IVU_PENDING)) { in seg_tx_reset() 305 if (bt_mesh_net_iv_update(bt_mesh.iv_index, false)) { in seg_tx_reset() 472 tx->seq_auth = SEQ_AUTH(BLE_MESH_NET_IVI_TX, bt_mesh.seq); in send_seg() 585 for (i = 0; i < ARRAY_SIZE(bt_mesh.app_keys); i++) { in bt_mesh_app_key_find() 586 struct bt_mesh_app_key *key = &bt_mesh.app_keys[i]; in bt_mesh_app_key_find() 646 tx->ctx->addr, bt_mesh.seq, in bt_mesh_trans_send() 692 for (i = 0; i < ARRAY_SIZE(bt_mesh.rpl); i++) { in bt_mesh_rpl_check() 693 struct bt_mesh_rpl *rpl = &bt_mesh.rpl[i]; in bt_mesh_rpl_check() 1061 if (rx->ctx.addr == bt_mesh.lpn.frnd) { in ctl_recv() 1200 tx_seg->seq_auth = SEQ_AUTH(BLE_MESH_NET_IVI_TX, bt_mesh.seq); in ctl_send_seg() [all …]
|
D | cfg_srv.c | 188 for (i = 0; i < ARRAY_SIZE(bt_mesh.app_keys); i++) { in app_key_is_valid() 189 struct bt_mesh_app_key *key = &bt_mesh.app_keys[i]; in app_key_is_valid() 356 for (i = 0; i < ARRAY_SIZE(bt_mesh.app_keys); i++) { in bt_mesh_app_key_alloc() 357 struct bt_mesh_app_key *key = &bt_mesh.app_keys[i]; in bt_mesh_app_key_alloc() 645 for (i = 0U; i < ARRAY_SIZE(bt_mesh.app_keys); i++) { in app_key_get() 646 struct bt_mesh_app_key *key = &bt_mesh.app_keys[i]; in app_key_get() 2194 for (i = 0; i < ARRAY_SIZE(bt_mesh.sub); i++) { in net_key_add() 2195 if (bt_mesh.sub[i].net_idx == BLE_MESH_KEY_UNUSED) { in net_key_add() 2196 sub = &bt_mesh.sub[i]; in net_key_add() 2400 for (i = 0U; i < ARRAY_SIZE(bt_mesh.sub); i++) { in net_key_get() [all …]
|
D | adv.c | 350 if (bt_mesh_atomic_test_bit(bt_mesh.flags, BLE_MESH_SUSPENDED)) { in bt_mesh_adv_create_from_pool()
|
D | provisioner_prov.c | 1076 prov_ctx.curr_iv_index = bt_mesh.iv_index;
|