diff options
-rw-r--r-- | src/user-awareness-monitors.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/user-awareness-monitors.c b/src/user-awareness-monitors.c index 735642b..04f69ce 100644 --- a/src/user-awareness-monitors.c +++ b/src/user-awareness-monitors.c @@ -1257,7 +1257,6 @@ int ua_monitor_set_user_presence_condition( { FUNC_ENTRY; ua_monitor_s *monitor = (ua_monitor_s *)handle; - unsigned int available_sensors = 0; UA_VALIDATE_INPUT_PARAMETER(handle); UA_VALIDATE_HANDLE(handle, ua_monitor_list); @@ -1276,15 +1275,13 @@ int ua_monitor_set_user_presence_condition( return UA_ERROR_INVALID_PARAMETER; } - _uam_get_available_sensors(&available_sensors); - - if (bitmask_and != (available_sensors & bitmask_and)) { + if (bitmask_and != (monitor->sensor_bitmask & bitmask_and)) { UA_ERR("AND bitmask out of range"); FUNC_EXIT; return UA_ERROR_INVALID_PARAMETER; } - if (bitmask_or != (available_sensors & bitmask_or)) { + if (bitmask_or != (monitor->sensor_bitmask & bitmask_or)) { UA_ERR("OR bitmask out of range"); FUNC_EXIT; return UA_ERROR_INVALID_PARAMETER; @@ -1306,7 +1303,6 @@ int ua_monitor_set_user_absence_condition( { FUNC_ENTRY; ua_monitor_s *monitor = (ua_monitor_s *)handle; - unsigned int available_sensors = 0; UA_VALIDATE_INPUT_PARAMETER(handle); UA_VALIDATE_HANDLE(handle, ua_monitor_list); @@ -1325,15 +1321,13 @@ int ua_monitor_set_user_absence_condition( return UA_ERROR_INVALID_PARAMETER; } - _uam_get_available_sensors(&available_sensors); - - if (bitmask_and != (available_sensors & bitmask_and)) { + if (bitmask_and != (monitor->sensor_bitmask & bitmask_and)) { UA_ERR("AND bitmask out of range"); FUNC_EXIT; return UA_ERROR_INVALID_PARAMETER; } - if (bitmask_or != (available_sensors & bitmask_or)) { + if (bitmask_or != (monitor->sensor_bitmask & bitmask_or)) { UA_ERR("OR bitmask out of range"); FUNC_EXIT; return UA_ERROR_INVALID_PARAMETER; |