summaryrefslogtreecommitdiff
path: root/cesar/mac/common/interval.h
diff options
context:
space:
mode:
authordufour2009-09-17 12:54:24 +0000
committerdufour2009-09-17 12:54:24 +0000
commit721c8d7ed0d5ec3922aa2393a3cbbd05fd3fb690 (patch)
tree5aae790f98aac36ee4e972613a646793e9854c3e /cesar/mac/common/interval.h
parent35487e616a9ca59fa4b777aa3eb27397611e60f8 (diff)
* 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
Diffstat (limited to 'cesar/mac/common/interval.h')
-rw-r--r--cesar/mac/common/interval.h52
1 files changed, 52 insertions, 0 deletions
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
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \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 */