#include <time.h>
-#include "frsh_fosa.h"
#include "frsh_energy_management_types.h"
#include "frsh_core_types.h"
/**
* frsh_resource_set_power_level()
*
- * Set the powerlevel of the CPU given by resource_id. We assume
- * resource_type = FRSH_RT_PROCESSOR.
+ * Set the power level of the resource identified by the supplied type and id.
+ *
+ * @note
+ * Only implementation for resource_type = FRSH_RT_PROCESSOR is mandatory,
+ * if the energy management module is present.
**/
-int frsh_resource_set_power_level(frsh_resource_id_t resource_id,
- int power_level);
+int frsh_resource_set_power_level(frsh_resource_type_t resource_type,
+ frsh_resource_id_t resource_id,
+ frsh_power_level_t power_level);
+/**
+ * frsh_resource_get_power_level()
+ *
+ * Get version of the previous function.
+ **/
+int frsh_resource_get_power_level(frsh_resource_type_t resource_type,
+ frsh_resource_id_t resource_id,
+ frsh_power_level_t *power_level);
+/**
+ * frsh_resource_get_num_power_levels()
+ *
+ * Get the number of power levels available for the resource identified
+ * by the supplied type and id.
+ *
+ * @note
+ * The power levels that may be used, for the identified resource,
+ * in other functions through a power_level_t type, range from 0
+ * to the value returned by this function minus 1.
+ *
+ * @note
+ * The power level 0 identifies the configuration with the maximum
+ * performance (and energy consumption) for the resource.
+ *
+ * @note
+ * Only implementation for resource_type = FRSH_RT_PROCESSOR is mandatory,
+ * if the energy management module is present.
+ */
+int frsh_resource_get_num_power_levels(frsh_resource_type_t resource_type,
+ frsh_resource_id_t resource_id,
+ frsh_power_level_t *num_power_levels);
//////////////////////////////////////////////////////////////////////
-// BATTERY DURATION AND MANAGING POWER LEVELS
+// BATTERY EXPIRATION AND MANAGING POWER LEVELS
//////////////////////////////////////////////////////////////////////
+/* /\** IS THIS NEEDED AT ALL ? I GUESS NOT - COMMENTED */
+/* * frsh_resource_get_battery_expiration() */
+/* * */
+/* * Get the foreseen expiration time of the battery for the resource */
+/* * identified by the supplied type and id. */
+/* * */
+/* int frsh_battery_get_expiration(frsh_resource_type_t resource_type, */
+/* frsh_resource_id_t resource_id, */
+/* frsh_rel_time_t *expiration); */
+
/**
- * frsh_resource_get_battery_duration()
+ * frsh_battery_get_expiration()
*
- * Get the remaining battery duration of the CPU given by resource_id.
- * We assume resource_type = FRSH_RT_PROCESSOR.
+ * Get the foreseen expiration time of the system battery(ies).
**/
-int frsh_resource_get_battery_duration(frsh_resource_id_t resource_id,
- struct timespec *duration);
+int frsh_battery_get_expiration(struct timespec *expiration);
/*@}*/