mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-14 09:47:22 +00:00
mesh: Return change information from bt_mesh_iv_update()
This will soon be useful to the callers of bt_mesh_iv_update(), in particular Friend support. X-Original-Commit: 9b4b858eec665aa008c9836106130c21e3800c5a
This commit is contained in:
@@ -558,7 +558,7 @@ void bt_mesh_rpl_reset(void)
|
||||
}
|
||||
}
|
||||
|
||||
void bt_mesh_iv_update(u32_t iv_index, bool iv_update)
|
||||
bool bt_mesh_iv_update(u32_t iv_index, bool iv_update)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -568,13 +568,13 @@ void bt_mesh_iv_update(u32_t iv_index, bool iv_update)
|
||||
if (iv_index != bt_mesh.iv_index) {
|
||||
BT_WARN("IV Index mismatch: 0x%08x != 0x%08x",
|
||||
iv_index, bt_mesh.iv_index);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (iv_update) {
|
||||
/* Nothing to do */
|
||||
BT_DBG("Already in IV Update in Progress state");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
/* We're currently in Normal mode */
|
||||
@@ -583,7 +583,7 @@ void bt_mesh_iv_update(u32_t iv_index, bool iv_update)
|
||||
iv_index > bt_mesh.iv_index + 42) {
|
||||
BT_ERR("IV Index out of sync: " "0x%08x != 0x%08x",
|
||||
iv_index, bt_mesh.iv_index);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (iv_index > bt_mesh.iv_index + 1) {
|
||||
@@ -597,19 +597,19 @@ void bt_mesh_iv_update(u32_t iv_index, bool iv_update)
|
||||
if (iv_index == bt_mesh.iv_index + 1 && !iv_update) {
|
||||
BT_WARN("Ignoring new index in normal mode",
|
||||
iv_index, bt_mesh.iv_index);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!iv_update) {
|
||||
/* Nothing to do */
|
||||
BT_DBG("Already in Normal mode");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (iv_index != bt_mesh.iv_index + 1) {
|
||||
BT_WARN("Wrong new IV Index: 0x%08x != 0x%08x + 1",
|
||||
iv_index, bt_mesh.iv_index);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -618,7 +618,7 @@ void bt_mesh_iv_update(u32_t iv_index, bool iv_update)
|
||||
|
||||
if (delta < K_HOURS(96)) {
|
||||
BT_WARN("IV Update before minimum duration");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -626,7 +626,7 @@ void bt_mesh_iv_update(u32_t iv_index, bool iv_update)
|
||||
if (!iv_update && bt_mesh_tx_in_progress()) {
|
||||
BT_WARN("IV Update deferred because of pending transfer");
|
||||
bt_mesh.pending_update = 1;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
do_update:
|
||||
@@ -655,6 +655,8 @@ do_update:
|
||||
bt_mesh_net_beacon_update(&bt_mesh.sub[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int bt_mesh_net_resend(struct bt_mesh_subnet *sub, struct os_mbuf *buf,
|
||||
|
||||
@@ -279,7 +279,7 @@ bt_mesh_net_beacon_update(struct bt_mesh_subnet *sub);
|
||||
void
|
||||
bt_mesh_rpl_reset(void);
|
||||
|
||||
void
|
||||
bool
|
||||
bt_mesh_iv_update(u32_t iv_index, bool iv_update);
|
||||
|
||||
struct bt_mesh_subnet *
|
||||
|
||||
Reference in New Issue
Block a user