Skip to content

Commit bfb6bd4

Browse files
committed
Fix interval type in STATE_REG_HOLD_OFF for overdue registrations
Updated `interval` type from `time_t` to `int32_t` in registration.c to correctly handle negative differences when currentTime exceeds targetP->registration. This fixes a bug where unsigned `time_t` caused large positive intervals, delaying registrations. The change ensures compliance with LwM2M registration timing requirements. Signed-off-by: CMT-Ashish <[email protected]>
1 parent d9f3866 commit bfb6bd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/registration.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2069,7 +2069,7 @@ void registration_step(lwm2m_context_t * contextP,
20692069
#ifndef LWM2M_VERSION_1_0
20702070
case STATE_REG_HOLD_OFF:
20712071
{
2072-
time_t interval = targetP->registration - currentTime;
2072+
int32_t interval = targetP->registration - currentTime;
20732073
if (0 >= interval)
20742074
{
20752075
prv_register(contextP, targetP);

0 commit comments

Comments
 (0)