summaryrefslogtreecommitdiff
path: root/docs/doxygen
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-02-17 20:18:23 -0500
committerTom Rondeau <trondeau@vt.edu>2013-02-17 20:18:23 -0500
commitc53476e745c5f5cce564f253250a4963a275feb5 (patch)
tree88a47e7d4c4b0b271b0774df717320a9b94d1bff /docs/doxygen
parent25cd3358c8cdddb14fb529b52382672bd5d80696 (diff)
parent38447cf7eabfdc02d2b75b01bca57b3350d23709 (diff)
Merge branch 'master' into next
Conflicts: gnuradio-core/src/python/gnuradio/gr/__init__.py
Diffstat (limited to 'docs/doxygen')
-rw-r--r--docs/doxygen/other/main_page.dox73
1 files changed, 73 insertions, 0 deletions
diff --git a/docs/doxygen/other/main_page.dox b/docs/doxygen/other/main_page.dox
index 59ee96d7f9..41aeba7e04 100644
--- a/docs/doxygen/other/main_page.dox
+++ b/docs/doxygen/other/main_page.dox
@@ -330,4 +330,77 @@ they can also serve as examples. See the gr_complex_to_xxx.h file for
examples of various blocks that make use of Volk.
+\section prefs Configuration / Preference Files
+
+GNU Radio defines some of its basic behavior through a set of
+configuration files located in
+${prefix}/etc/gnuradio/conf.d. Different components have different
+files listed in here for the various properties. These will be read
+once when starting a GNU Radio application, so updates during runtime
+will not affect them.
+
+The configuration files use the following format:
+
+\code
+# Stuff from section 1
+[section1]
+var1 = value1
+var2 = value2 # value of 2
+
+# Stuff from section 2
+[section2]
+var3 = value3
+\endcode
+
+In this file, the hash mark ('#') indicates a comment and blank lines
+are ignored. Section labels are defined inside square brackets as a
+group distinguisher. All options must be associated with a section
+name. The options are listed one per line with the option name is
+given followed by an equals ('=') sign and then the value. All section
+and option names must not have white spaces (actually, all white
+spaces are ignored).
+
+The value of an option can be a string or number and retrieved through
+a few different interfaces. There is a single preference object
+created when GNU Radio is launched. In Python, you can get this by
+making a new variable:
+
+\code
+p = gr.prefs()
+\endcode
+
+Similarly, in C++, we get a reference to the object by explicitly
+calling for the singleton of the object:
+
+\code
+ gr_prefs *p = gr_prefs::singleton();
+\endcode
+
+The methods associated with this preferences object are (from class gr_prefs):
+
+\code
+ bool has_section(string section)
+ bool has_option(string section, string option)
+ string get_string(string section, string option, string default_val)
+ bool get_bool(string section, string option, bool default_val)
+ long get_long(string section, string option, long default_val)
+ double get_double(string section, string option, double default_val)
+\endcode
+
+When setting a Boolean value, we can use 0, 1, "True", "true",
+"False", "false", "On", "on", "Off", and "off".
+
+All configuration preferences in these files can also be overloaded by
+an environmental variable. The environmental variable is named based
+on the section and option name from the configuration file as:
+
+\code
+ GR_CONF_<SECTION>_<OPTION> = <value>
+\endcode
+
+The "GR_CONF_" is a prefix to identify this as a GNU Radio
+configuration variable and the section and option names are in
+uppercase. The value is the same format that would be used in the
+config file itself.
+
*/