return 0;
}
-#define DPMS_TIMEOUT 5000
-#define DPMS_GET_MAX_RETRY 3
int dpms_get_power(enum dpms_state *state)
{
- int try = 0;
int ret;
if (!state)
return -EINVAL;
- do {
- try++;
- if (try > DPMS_GET_MAX_RETRY) {
- _E("Dbus Timeout occurred %d times in a row.", DPMS_GET_MAX_RETRY);
- assert(0);
- }
-
- ret = dbus_handle_method_sync_timeout(ENLIGHTENMENT_BUS_NAME,
- ENLIGHTENMENT_OBJECT_PATH,
- ENLIGHTENMENT_INTERFACE_NAME,
- "get",
- NULL, NULL, DPMS_TIMEOUT);
- } while (ret < 0);
+ ret = dbus_handle_method_sync(ENLIGHTENMENT_BUS_NAME,
+ ENLIGHTENMENT_OBJECT_PATH,
+ ENLIGHTENMENT_INTERFACE_NAME,
+ "get",
+ NULL, NULL);
+ if (ret < 0)
+ return ret;
*state = ret;
return 0;