Bluetooth: Mesh: Use 32-bit math for Node ID duration
The Node Identity duration is at most 60 seconds, so it's safe to use
32-bit timestamps.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
diff --git a/subsys/bluetooth/host/mesh/proxy.c b/subsys/bluetooth/host/mesh/proxy.c
index b3e732a..e724e65 100644
--- a/subsys/bluetooth/host/mesh/proxy.c
+++ b/subsys/bluetooth/host/mesh/proxy.c
@@ -914,7 +914,7 @@
#endif /* PB_GATT */
#if defined(CONFIG_BT_MESH_GATT_PROXY)
-static s64_t node_id_start;
+static u32_t node_id_start;
#define ID_TYPE_NET 0x00
#define ID_TYPE_NODE 0x01
@@ -1014,11 +1014,11 @@
}
if (node_id_start) {
- s64_t active = k_uptime_get() - node_id_start;
+ u32_t active = k_uptime_get_32() - node_id_start;
if (active < NODE_ID_TIMEOUT) {
remaining = NODE_ID_TIMEOUT - active;
- BT_DBG("Node ID active for %lld ms, %d ms remaining",
+ BT_DBG("Node ID active for %u ms, %u ms remaining",
active, remaining);
} else {
sub->node_id = BT_MESH_NODE_IDENTITY_STOPPED;
@@ -1030,7 +1030,7 @@
if (sub->node_id == BT_MESH_NODE_IDENTITY_RUNNING) {
proxy_adv_param = &fast_adv_param;
if (node_id_adv(sub) == 0 && !node_id_start) {
- node_id_start = k_uptime_get();
+ node_id_start = k_uptime_get_32();
remaining = NODE_ID_TIMEOUT;
}
} else if (bt_mesh_gatt_proxy_get() == BT_MESH_GATT_PROXY_ENABLED) {