#ifndef mac_common_interval_h #define mac_common_interval_h /* Cesar project {{{ * * Copyright (C) 2009 Spidcom * * <<>> * * }}} */ /** * \file mac/common/interval.h * \brief Functions to handle intervals * \ingroup mac_common * * This header declares function to handle intervals (add a new interval for * example). */ #include "mac/common/tonemap.h" /** Number of allocated FSM. */ extern u8 mac_interval_fsm_count_; /** Number of FSM repetition in the beacon period. */ extern u8 mac_interval_repetition_count_; BEGIN_DECLS /** * Clear temporary intervals list. * \param tms the tone maps structure. */ void mac_interval_clear (tonemaps_t *tms); /** * Append an intervals to the temporary intervals list. * \param tms the tone maps structure. * \param end_offset_atu the offset of the end of the intervals (in ATU). * \param tmi the tone map index to use for this interval. * \return the count of intervals, or 0 if the interval can not be added (no * more place, or interval lower than the last one. * * This function does not check end_offset_atu is valid (not too much overt * the beacon period) nor TMI is valid (TMI exists). */ u8 mac_interval_append (tonemaps_t *tms, u16 end_offset_atu, u8 tmi); /** * Switch intervals list to the temporary intervals list. * \param tms the tone maps structure. * \param group_intervals_nb number of intervals per group, or 0 if no * group. * This function swap the pointers of intervals and intervals_temp. */ void mac_interval_commit_changes (tonemaps_t *tms, u8 group_intervals_nb); #endif /* mac_common_interval_h */