summaryrefslogtreecommitdiff
path: root/cesar/maximus/channel/inc/ChannelSettings.h
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/maximus/channel/inc/ChannelSettings.h')
-rw-r--r--cesar/maximus/channel/inc/ChannelSettings.h204
1 files changed, 204 insertions, 0 deletions
diff --git a/cesar/maximus/channel/inc/ChannelSettings.h b/cesar/maximus/channel/inc/ChannelSettings.h
new file mode 100644
index 0000000000..1ec40409dc
--- /dev/null
+++ b/cesar/maximus/channel/inc/ChannelSettings.h
@@ -0,0 +1,204 @@
+/************************************************************************
+ ChannelSettings.h - Copyright buret
+
+Here you can write a license for your code, some comments or any other
+information you want to have in your generated code. To to this simply
+configure the "headings" directory in uml to point to a directory
+where you have your heading files.
+
+or you can just replace the contents of this file with your own.
+If you want to do this, this file is located at
+
+/usr/share/apps/umbrello/headings/heading.h
+
+-->Code Generators searches for heading files based on the file extension
+ i.e. it will look for a file name ending in ".h" to include in C++ header
+ files, and for a file name ending in ".java" to include in all generated
+ java code.
+ If you name the file "heading.<extension>", Code Generator will always
+ choose this file even if there are other files with the same extension in the
+ directory. If you name the file something else, it must be the only one with that
+ extension in the directory to guarantee that Code Generator will choose it.
+
+you can use variables in your heading files which are replaced at generation
+time. possible variables are : author, date, time, filename and filepath.
+just write %variable_name%
+
+This file was generated on %date% at %time%
+The original location of this file is /home/buret/eclipse/maximus/channel/inc/ChannelSettings.h
+**************************************************************************/
+
+#ifndef CHANNELSETTINGS_H
+#define CHANNELSETTINGS_H
+
+#include "networkclock_types.h" // for 'Network_Clock_Tick'
+#include "channel_types.h" // for 'Channel_Mod' and 'MAXIMUS_CHANNEL_INTERVAL_MAX_NB'
+
+#include "hal/phy/defs.h" // for 'PHY_CARRIER_NB'
+
+
+/**
+ * class ChannelSettings
+ */
+
+class ChannelSettings
+{
+
+public:
+
+ // public attributes
+ //
+
+private:
+
+ // private attributes
+ //
+
+ bool mIsConfigured;
+ float mSnrArray[MAXIMUS_CHANNEL_INTERVAL_MAX_NB][PHY_CARRIER_NB + 1];
+ Channel_Mod mTonemapArray[PHY_CARRIER_NB];
+ Network_Clock_Tick mPreDetectionDate;
+ Network_Clock_Tick mFcReceptionDate;
+
+protected:
+
+ // protected attributes
+ //
+
+public:
+
+ // Constructors/Destructors
+ //
+
+ /**
+ * Empty Constructor
+ */
+ ChannelSettings ( );
+
+ /**
+ * Empty Destructor
+ */
+ virtual ~ChannelSettings ( );
+
+ // public methods
+ //
+
+ /**
+ * Gets the first symbol start date (in ticks).
+ * @return tick at which the first symbol has started
+ */
+ const Network_Clock_Tick getFirstSymbolStartDate ( ) const;
+
+ /**
+ * Gets the tonemap modulation.
+ * @param carrier the current carrier number
+ * @return the tonemap modulation
+ */
+ const Channel_Mod getModulation ( const unsigned int carrier ) const;
+
+ /**
+ * Gets the SNR in dB.
+ * @param interval the current interval number
+ * @param carrier the current carrier number
+ * @return the SNR in dB
+ */
+ const float getSnr ( const Network_Clock_Tick beacon_period,
+ const Network_Clock_Tick symbol_start_date,
+ const unsigned int carrier ) const;
+
+ // public attribute accessor methods
+ //
+
+ // private attribute accessor methods
+ //
+
+ /**
+ * Gets if the channel has been configured.
+ * @return mIsConfigured
+ */
+ const bool isConfigured ( ) const;
+
+ /**
+ * Sets the SNR.
+ * @param snr_value SNR value in dB
+ * @return bool
+ */
+ bool setSnr ( const float snr_value );
+
+ /**
+ * Sets the SNR.
+ * @param snr array of SNR values in dB
+ * @return bool
+ */
+ bool setSnr ( const float snr_values[MAXIMUS_CHANNEL_INTERVAL_MAX_NB][PHY_CARRIER_NB + 1] );
+
+ /**
+ * Sets the tonemap of the current transmission.
+ * @return bool
+ * @param tonemap_array the new value of mTonemapArray
+ */
+ bool setTonemap ( const Channel_Mod tonemap_array[PHY_CARRIER_NB + 1] );
+
+ /**
+ * Sets the PRE detection date.
+ * @param date tick at which the preamble has been received
+ * @return bool
+ */
+ bool setPreDetectionDate ( const Network_Clock_Tick date );
+
+ /**
+ * Sets the FC reception date.
+ * @param date tick at which the frame control has been received
+ * @return bool
+ */
+ bool setFcReceptionDate ( const Network_Clock_Tick date );
+
+ // protected attribute accessor methods
+ //
+
+private:
+
+ // private methods
+ //
+
+ /**
+ * Initializes the Channel Settings class attributes.
+ */
+ void initAttributes ( );
+
+ /**
+ * Sets if the channel is configured.
+ * @param is_configured the new value of mIsConfigured
+ * @return bool
+ */
+ bool setIsConfigured ( const bool is_configured = true );
+
+ /**
+ * Gets the PRE detection date.
+ * @return mPreDetectionDate tick at which the preamble has been received
+ */
+ const Network_Clock_Tick getPreDetectionDate ( ) const;
+
+ /**
+ * Gets the FC reception date.
+ * @return mFcReceptionDate tick at which the frame control has been received
+ */
+ const Network_Clock_Tick getFcReceptionDate ( ) const;
+
+ /**
+ * Gets the time interval.
+ * @param symbol_start_date the current symbol start date in ticks
+ * @return the interval number
+ */
+ const unsigned int getInterval ( const Network_Clock_Tick beacon_period,
+ const Network_Clock_Tick symbol_start_date ) const;
+
+protected:
+
+ // protected methods
+ //
+
+};
+
+
+#endif /* CHANNELSETTINGS_H */