In mqtt_cyclic_timer() you check if it's time to send a new PINGREQ, based on
client->keep_alive and client->cyclick_tick.
The if statement is:
if ((client->cyclic_tick * MQTT_CYCLIC_TIMER_INTERVAL) >= client->keep_alive)
After connection mqtt_cyclic_timer() is fired after
MQTT_CYCLIC_TIMER_INTERVAL. Now suppose MQTT_CYCLIC_TIMER_INTERVAL is 5
seconds and client->keep_alive is 5 seconds. The first time
mqtt_cyclic_timer() is called, it should send PINGREQ. However it doesn't,
because client->cyclic_tick is zero.
I think it's better to preincrement client->cyclic_tick to take into account
the first period that was already expired. Of course, the increment of
client->cyclic_tick should be deleted on the else branch.