From 721c8d7ed0d5ec3922aa2393a3cbbd05fd3fb690 Mon Sep 17 00:00:00 2001 From: dufour Date: Thu, 17 Sep 2009 12:54:24 +0000 Subject: * mac/common, ce/tx: - add new functions to handle intervals (append, clear and commit), - update CE/TX to use it, - update comments to better understand the intervals list management. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@5594 017c9cb6-072f-447c-8318-d5b54f68fe89 --- cesar/mac/common/interval.h | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 cesar/mac/common/interval.h (limited to 'cesar/mac/common/interval.h') diff --git a/cesar/mac/common/interval.h b/cesar/mac/common/interval.h new file mode 100644 index 0000000000..7730634097 --- /dev/null +++ b/cesar/mac/common/interval.h @@ -0,0 +1,52 @@ +#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" + +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. + * This function swap the pointers of intervals and intervals_temp. + */ +void +mac_interval_commit_changes (tonemaps_t *tms); + +#endif /* mac_common_interval_h */ -- cgit v1.2.3