Target Wake Time (TWT) service period gradually increases

Hi,

I have a simple function that is triggered by the built in NET_EVENT_WIFI_TWT_SLEEP_STATE callback event that times the TWT wake and sleep intervals. I set these values to be 20000us and 3000000us respectively, but notice that TWT service periods gradually increases up to a point (in this case around 80ms) and then drops back down to the originally requested TWT service period. This inconsistency is not very ideal for my purposes, and I was wondering if there is a way to keep the service period consistent. Below is my function that times the wake and sleep intervals and my issue shown in screenshots.

Thanks.

static void handle_wifi_twt_sleep (struct net_mgmt_event_callback *cb){
	int64_t awakeTime;
	int64_t sleepTime;
	int *sleep_state = (int*) cb->info;
	if (*sleep_state == 1){
		LOG_INF("STA awake");
		sleepTime = k_uptime_delta(&sleepStartTime);
		LOG_INF("Sleep Time: %lli", sleepTime);
		awakeStartTime = k_uptime_get();
		gpio_pin_toggle_dt(&led);
	}
	else{
		LOG_INF("STA asleep");
		awakeTime = k_uptime_delta(&awakeStartTime);
		LOG_INF("Awake Time: %lli", awakeTime);
		sleepStartTime = k_uptime_get();
		gpio_pin_toggle_dt(&led);

	}
}

Parents Reply Children
Related