Lines Matching refs:next_cycle
582 static int process_pubs(struct mqtt_sn_client *client, int64_t *next_cycle) in process_pubs() argument
630 if (next_attempt > now && (*next_cycle == 0 || next_attempt < *next_cycle)) { in process_pubs()
631 *next_cycle = next_attempt; in process_pubs()
635 LOG_DBG("next_cycle: %lld", *next_cycle); in process_pubs()
640 static int process_topics(struct mqtt_sn_client *client, int64_t *next_cycle) in process_topics() argument
698 if (next_attempt > now && (*next_cycle == 0 || next_attempt < *next_cycle)) { in process_topics()
699 *next_cycle = next_attempt; in process_topics()
703 LOG_DBG("next_cycle: %lld", *next_cycle); in process_topics()
708 static int process_ping(struct mqtt_sn_client *client, int64_t *next_cycle) in process_ping() argument
737 if (*next_cycle == 0 || next_ping < *next_cycle) { in process_ping()
738 *next_cycle = next_ping; in process_ping()
741 LOG_DBG("next_cycle: %lld", *next_cycle); in process_ping()
746 static int process_search(struct mqtt_sn_client *client, int64_t *next_cycle) in process_search() argument
765 if (*next_cycle == 0 || (client->ts_searchgw != 0 && client->ts_searchgw < *next_cycle)) { in process_search()
766 *next_cycle = client->ts_searchgw; in process_search()
768 if (*next_cycle == 0 || (client->ts_gwinfo != 0 && client->ts_gwinfo < *next_cycle)) { in process_search()
769 *next_cycle = client->ts_gwinfo; in process_search()
772 LOG_DBG("next_cycle: %lld", *next_cycle); in process_search()
777 static int process_advertise(struct mqtt_sn_client *client, int64_t *next_cycle) in process_advertise() argument
792 if (gw->adv_timer != -1 && (*next_cycle == 0 || gw->adv_timer < *next_cycle)) { in process_advertise()
793 *next_cycle = gw->adv_timer; in process_advertise()
796 LOG_DBG("next_cycle: %lld", *next_cycle); in process_advertise()
805 int64_t next_cycle = 0; in process_work() local
815 err = process_advertise(client, &next_cycle); in process_work()
821 err = process_search(client, &next_cycle); in process_work()
827 err = process_topics(client, &next_cycle); in process_work()
832 err = process_pubs(client, &next_cycle); in process_work()
837 err = process_ping(client, &next_cycle); in process_work()
843 if (next_cycle > 0) { in process_work()
844 LOG_DBG("next_cycle: %lld", next_cycle); in process_work()
845 k_work_schedule(dwork, K_MSEC(next_cycle - k_uptime_get())); in process_work()