* notify it to the system console and then terminate the FRSH
* implementation and dependant applications
**/
-int fosa_clock_get_time(fosa_clock_id_t clockid, struct timespec *current_time);
+int fosa_clock_get_time(fosa_clock_id_t clockid, fosa_abs_time_t *current_time);
/**
int fosa_timer_delete(fosa_timer_id_t timerid);
/**
- * fosa_timer_arm()
+ * fosa_rel_timer_arm()
*
- * Arm a timer
+ * Arm a timer with a relative time interval
*
* The timer specified by timer is armed and starts counting time.
*
- * If abstime is true, the value pointed to by value is the absolute
- * time at which the timer will expire. If value specifies a time instant
- * in the past, the timer expires immediately.
+ * The value pointed to by value is the relative interval that must
+ * elapse for the timer to expire. Negative values cause the timer to
+ * expire immediately.
*
- * If abstime is false, the value pointed to by value is the relative interval
- * that must elapse for the timer to expire.
+ * The time is measured with the clock associated with the timer when
+ * it was created.
*
- * In both cases, absolute or relative, the time is measured with the clock
- * associated with the timer when it was created.
+ * If the timer was already armed, the previous time or interval is discarded
+ * and the timer is rearmed with the new value.
+ *
+ * When the timer expires, it is disarmed.
+ *
+ * Returns 0 if successful; otherwise it returns an error code:
+ * FOSA_EINVAL: the value of timerid or value is invalid
+ *
+ * Alternatively, in case of error the implementation is allowed to
+ * notify it to the system console and then terminate the FRSH
+ * implementation and dependant applications
+ **/
+int fosa_rel_timer_arm
+ (fosa_timer_id_t timerid, const fosa_rel_time_t *value);
+
+/**
+ * fosa_abs_timer_arm()
+ *
+ * Arm a timer that will expire in an absolute time instant.
+ *
+ * The timer specified by timer is armed and starts counting time.
+ *
+ * The value pointed to by value is the absolute time at which the
+ * timer will expire. If value specifies a time instant in the past,
+ * the timer expires immediately.
+ *
+ * The time is measured with the clock associated with the timer when
+ * it was created.
*
* If the timer was already armed, the previous time or interval is discarded
* and the timer is rearmed with the new value.
* notify it to the system console and then terminate the FRSH
* implementation and dependant applications
**/
-int fosa_timer_arm
- (fosa_timer_id_t timerid, bool abstime,
- const struct timespec *value);
+int fosa_abs_timer_arm
+ (fosa_timer_id_t timerid, const fosa_abs_time_t *value);
+
+
+
/**
* fosa_timer_get_remaining_time()
* implementation and dependant applications
**/
int fosa_timer_get_remaining_time
- (fosa_timer_id_t timerid, struct timespec *remaining_time);
+ (fosa_timer_id_t timerid, fosa_rel_time_t *remaining_time);
/**
* fosa_timer_disarm()
* notify it to the system console and then terminate the FRSH
* implementation and dependant applications
**/
-int fosa_timer_disarm(fosa_timer_id_t timerid, struct timespec
- *remaining_time);
+int fosa_timer_disarm(fosa_timer_id_t timerid,
+ fosa_rel_time_t *remaining_time);
/*@}*/