esp_zb_sleep_set_threshold() function
Set the sleep threshold on the device. When the scheduler detects that the device can enter sleep mode, it will notify the application with the signal ESP_ZB_COMMON_SIGNAL_CAN_SLEEP. The default sleep threshold is 20 milliseconds.
Arguments
threshold_ms
Sleep threshold in milliseconds
Return value
ESP_OK if new threshold is valid and applied. ESP_FAIL if the user attempts to set a threshold greater than ESP_ZB_SLEEP_MAXIMUM_THRESHOLD_MS.