From efd1ed5e1e7524b7f79306f6c44111a203b4bba7 Mon Sep 17 00:00:00 2001 From: Jojo-1000 <33495614+Jojo-1000@users.noreply.github.com> Date: Sat, 20 Mar 2021 23:03:48 +0100 Subject: [PATCH] Update documentation pages. --- .travis.yml | 5 +++-- CMakeLists.txt | 4 ++-- Doxyfile | 426 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------- doc/markdown/Build.md | 8 +++++--- doc/markdown/Getting_Started.md | 50 +++++++++++++++----------------------------------- doc/markdown/Mainpage.md | 78 ++++++++++++++++++++++++++++++------------------------------------------------ doc/markdown/Sensors.md | 49 +++++++++---------------------------------------- doc/markdown/Shared_State.md | 20 ++++++-------------- doc/markdown/Transactions.md | 26 +++++++------------------- examples/BridgeSetup.cpp | 5 +++-- examples/CMakeLists.txt | 8 +++++++- examples/LightsOff.cpp | 10 +++++----- examples/Snippets.cpp | 199 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ examples/UsernameConfig.cpp | 37 +++++++++++++++++++------------------ 14 files changed, 589 insertions(+), 336 deletions(-) create mode 100644 examples/Snippets.cpp diff --git a/.travis.yml b/.travis.yml index f627833..b738632 100755 --- a/.travis.yml +++ b/.travis.yml @@ -49,11 +49,12 @@ install: script: ############################################################################ - # Build main and tests + # Build main, tests and examples ############################################################################ - mkdir -p build - cd build - - cmake .. -Dhueplusplus_TESTS=ON -DCMAKE_BUILD_TYPE=Debug + - cmake .. -Dhueplusplus_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -Dhueplusplus_EXAMPLES=ON + - make hueplusplus_examples hueplusplus_snippets - make coveragetest - cd .. - doxygen Doxyfile diff --git a/CMakeLists.txt b/CMakeLists.txt index 890f2cf..cd2d28d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ endif() # options to set option(hueplusplus_TESTS "Build tests" OFF) -option(hueplusplus_SAMPLES "Build examples" OFF) +option(hueplusplus_EXAMPLES "Build examples" OFF) option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF) find_program(CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable") @@ -100,6 +100,6 @@ if(hueplusplus_TESTS) add_subdirectory("test") endif() -if(hueplusplus_SAMPLES) +if(hueplusplus_EXAMPLES) add_subdirectory("examples") endif() diff --git a/Doxyfile b/Doxyfile index 6c0dfa3..832e95a 100755 --- a/Doxyfile +++ b/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.11 +# Doxyfile 1.8.20 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -17,11 +17,11 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -38,20 +38,20 @@ PROJECT_NAME = hueplusplus # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = 1.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -93,6 +93,14 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. @@ -162,7 +170,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -189,6 +197,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -209,6 +227,14 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. @@ -236,15 +262,14 @@ TAB_SIZE = 4 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) -TCL_SUBST = +ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -274,28 +299,37 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -303,6 +337,15 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = YES +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or @@ -328,7 +371,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -414,6 +457,19 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which efficively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -434,6 +490,12 @@ EXTRACT_ALL = YES EXTRACT_PRIVATE = NO +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. @@ -488,8 +550,8 @@ HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO @@ -512,7 +574,7 @@ INTERNAL_DOCS = NO # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. +# (including Cygwin) and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = NO @@ -639,7 +701,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -681,7 +743,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -694,17 +756,17 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -744,7 +806,8 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. # The default value is: NO. WARN_NO_PARAMDOC = NO @@ -769,7 +832,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -783,12 +846,13 @@ WARN_LOGFILE = INPUT = include/hueplusplus \ src \ - doc/markdown + doc/markdown \ + examples # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. @@ -805,8 +869,10 @@ INPUT_ENCODING = UTF-8 # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, -# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen +# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.c \ *.cc \ @@ -866,7 +932,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -882,7 +948,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -899,14 +965,14 @@ EXCLUDE_SYMBOLS = *::detail # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = +EXAMPLE_PATH = examples # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. -EXAMPLE_PATTERNS = * +EXAMPLE_PATTERNS = *.cpp # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands @@ -919,7 +985,7 @@ EXAMPLE_RECURSIVE = NO # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -940,7 +1006,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -953,7 +1019,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -968,7 +1034,7 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page @@ -1004,7 +1070,7 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -1036,12 +1102,12 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -1069,7 +1135,7 @@ VERBATIM_HEADERS = YES # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. +# generated with the -Duse_libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO @@ -1080,7 +1146,20 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the directory containing a file called compile_commands.json. This +# file is the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the +# options used when the source files were built. This is equivalent to +# specifying the "-p" option to a clang tool, such as clang-check. These options +# will then be passed to the parser. Any options specified with CLANG_OPTIONS +# will be added as well. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1106,7 +1185,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1150,7 +1229,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1160,7 +1239,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1172,7 +1251,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1185,7 +1264,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1195,12 +1274,12 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1236,13 +1315,24 @@ HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = NO +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_DYNAMIC_SECTIONS = NO +HTML_DYNAMIC_SECTIONS = YES # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand @@ -1259,13 +1349,13 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# environment (see: https://developer.apple.com/xcode/), introduced with OSX +# 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1304,7 +1394,7 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output @@ -1324,7 +1414,7 @@ GENERATE_HTMLHELP = NO # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1332,10 +1422,10 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1345,7 +1435,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1376,11 +1466,11 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1388,7 +1478,7 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1397,33 +1487,33 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1497,6 +1587,17 @@ TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1506,7 +1607,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1517,8 +1618,14 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1545,8 +1652,8 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest @@ -1556,7 +1663,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1564,7 +1671,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1588,7 +1695,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1607,7 +1714,7 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1620,11 +1727,11 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1640,7 +1747,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1650,7 +1757,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1672,21 +1779,35 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. @@ -1714,7 +1835,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1730,7 +1851,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1741,7 +1862,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1752,7 +1873,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1760,7 +1881,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1771,9 +1892,11 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1807,7 +1930,7 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1821,6 +1944,14 @@ LATEX_BIB_STYLE = plain LATEX_TIMESTAMP = NO +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1860,22 +1991,22 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1920,7 +2051,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -1958,6 +2089,13 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- @@ -1990,14 +2128,18 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- +# Configuration options related to Sqlite3 output +#--------------------------------------------------------------------------- + +#--------------------------------------------------------------------------- # Configuration options related to the Perl module output #--------------------------------------------------------------------------- @@ -2033,7 +2175,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2074,7 +2216,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2082,7 +2224,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2092,7 +2234,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2101,7 +2243,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2130,13 +2272,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2159,12 +2301,6 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- @@ -2178,21 +2314,12 @@ PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = NO -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2241,7 +2368,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2392,19 +2519,19 @@ DOT_PATH = /usr/local/bin # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2412,12 +2539,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = + +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/doc/markdown/Build.md b/doc/markdown/Build.md index 85bc006..60c0ea4 100644 --- a/doc/markdown/Build.md +++ b/doc/markdown/Build.md @@ -1,5 +1,7 @@ # Build and install {#build} +[TOC] + # Basic installation {#basic-install} ## Clone from github {#clone} @@ -74,11 +76,11 @@ make coveragetest ``` ## Building examples {#build-examples} -There are some small example programs using this library in the examples folder. To build them, -set `hueplusplus_SAMPLES=ON`. The target `hueplusplus_examples` builds all examples into build/examples. +There are some small [example programs](@ref examples) using this library in the examples folder. To build them, +set `hueplusplus_EXAMPLES=ON`. The target `hueplusplus_examples` builds all examples into build/examples. ```{.sh} mkdir build cd build -cmake .. -Dhueplusplus_SAMPLES=ON +cmake .. -Dhueplusplus_EXAMPLES=ON make hueplusplus_examples ``` diff --git a/doc/markdown/Getting_Started.md b/doc/markdown/Getting_Started.md index 765b002..9e3fa7d 100644 --- a/doc/markdown/Getting_Started.md +++ b/doc/markdown/Getting_Started.md @@ -6,54 +6,34 @@ The options are a [WinHttpHandler](@ref hueplusplus::WinHttpHandler) (for window Then create a [BridgeFinder](@ref hueplusplus::BridgeFinder) object with the handler. The handler is needed, because it tells the finder which functions to use to communicate with a bridge or your local network. -After that you can call [findBridges()](@ref hueplusplus::HueFinder::findBridges), which will return a vector containing the ip and mac address of all found Bridges. -```{.cpp} -// For windows use std::make_shared(); -auto handler = std::make_shared(); -hueplusplus::BridgeFinder finder(handler); -std::vector bridges = finder.findBridges(); -if (bridges.empty()) -{ - std::cerr << "No bridges found\n"; - return; -} -``` +After that you can call [findBridges()](@ref hueplusplus::BridgeFinder::findBridges), which will return a vector containing the ip and mac address of all found Bridges. +\snippet Snippets.cpp search-bridge ## Authenticate Bridges If you have found the Bridge you were looking for, you can then move on with the authentication process. To get a new username from the Bridge (for now) you simply call [getBridge(bridges[\])](@ref hueplusplus::BridgeFinder::getBridge), where index is your preferred Bridge from the part [Searching for Bridges](#searchingBridges). This requires the user to press the link button. -```{.cpp} -hueplusplus::Bridge bridge = finder.getBridge(bridges[0]); -``` +\snippet Snippets.cpp get-bridge-1 + If you on the other hand already have a username you can add your bridge like so -```{.cpp} -finder.addUsername(bridges[0].mac, ""); -hueplusplus::Bridge bridge = finder.getBridge(bridges[0]); -``` -If you do not want to use the HueFinder or you already know the ip and username of your bridge you have the option to create your own Hue object. +\snippet Snippets.cpp get-bridge-2 + +If you do not want to use the BridgeFinder or you already know the ip and username of your bridge you have the option to create your own Hue object. Here you will need to provide the ip address, the port number, a username and an HttpHandler -```{.cpp} -// For windows use std::make_shared(); -auto handler = std::make_shared(); -hueplusplus::Bridge bridge("192.168.2.102", 80, "", handler); -``` +\snippet Snippets.cpp get-bridge-3 + At this point you may want to decide whether to use a [shared state](@ref shared-state) cache model or keep the default settings. ### Controlling lights -```{.cpp} -hueplusplus::Light light = bridge.getLight(1); -light1.On(); -light1.Off(); -``` +\snippet Snippets.cpp control-lights + +Use [transactions](@ref transactions) to change multiple properties at once. ### Controlling groups -```{.cpp} -hueplusplus::Group group = bridge.getGroup(1); -group.setOn(true); -``` +\snippet Snippets.cpp control-groups ## More information -- [Transactions](@ref transactions) \ No newline at end of file +- [Transactions](@ref transactions) +- [Shared state cache](@ref shared-state) diff --git a/doc/markdown/Mainpage.md b/doc/markdown/Mainpage.md index eb6898d..4ff7de3 100644 --- a/doc/markdown/Mainpage.md +++ b/doc/markdown/Mainpage.md @@ -1,6 +1,8 @@ # Documentation for the hueplusplus library A simple and easy to use library for Philips Hue Lights. +[TOC] + ## Features * find bridges with SSDP or set an ip manually * all common light functions (brightness, color, temperature) @@ -17,85 +19,57 @@ A simple and easy to use library for Philips Hue Lights. * Espressif ESP32 SDK & Arduino ## How to use -- [Getting Started](@ref getting-started) +[Getting started](@ref getting-started) ### Searching for Bridges To start searching for a Hue Bridge you will need to choose an IHttpHandler and create one. The options are a [WinHttpHandler](@ref hueplusplus::WinHttpHandler) (for windows) or a [LinHttpHandler](@ref hueplusplus::LinHttpHandler) (for linux or linux-like). Then create a [BridgeFinder](@ref hueplusplus::BridgeFinder) object with the handler. The handler is needed, because it tells the finder which functions to use to communicate with a bridge or your local network. After that you can call [findBridges()](@ref hueplusplus::BridgeFinder::findBridges), which will return a vector containing the ip and mac address of all found Bridges. -```{.cpp} -// For windows use std::make_shared(); -handler = std::make_shared(); -hueplusplus::BridgeFinder finder(handler); -std::vector bridges = finder.findBridges(); -if (bridges.empty()) -{ - std::cerr << "No bridges found\n"; - return; -} +\snippet Snippets.cpp search-bridge -``` +At this point you may want to decide whether to use a [shared state](@ref shared-state) cache model or keep the default settings. ### Authenticate Bridges If you have found the Bridge you were looking for, you can then move on with the authentication process. To get a new username from the Bridge (for now) you simply call [getBridge(bridges[\])](@ref hueplusplus::BridgeFinder::getBridge), where index is your preferred Bridge from the part [Searching for Bridges](#searchingBridges). This requires the user to press the link button. -```{.cpp} -hueplusplus::Bridge bridge = finder.getBridge(bridges[0]); -``` +\snippet Snippets.cpp get-bridge-1 + If you on the other hand already have a username you can add your bridge like so -```{.cpp} -finder.addUsername(bridges[0].mac, ""); -hueplusplus::Bridge bridge = finder.getBridge(bridges[0]); -``` +\snippet Snippets.cpp get-bridge-2 + If you do not want to use the BridgeFinder or you already know the ip and username of your bridge you have the option to create your own Bridge object. Here you will need to provide the ip address, the port number, a username and an HttpHandler -```{.cpp} -// For windows use std::make_shared(); -handler = std::make_shared(); -hueplusplus::Bridge bridge("192.168.2.102", 80, "", handler); -``` +\snippet Snippets.cpp get-bridge-3 + ### Controlling lights If you have your Bridge all set up, you can now control its lights. For that create a new Light object and call [lights().get(\)](@ref hueplusplus::ResourceList::get) on your bridge object to get a reference to a specific light, where id is the id of the light set internally by the Hue Bridge. -```{.cpp} -hueplusplus::Light light1 = bridge.lights().get(1); -``` +\snippet Snippets.cpp light-1 + If you don't know the id of a specific light or want to get an overview over all lights that are controlled by your bridge, you can get a vector containing them by calling [getAll()](@ref hueplusplus::ResourceList::getAll) on your bridge object. If no lights are found the vector will be empty. -```{.cpp} -std::vector lights = bridge.lights().getAll(); -``` +\snippet Snippets.cpp light-2 + If you now want to control a light, call a specific function of it. -```{.cpp} -light1.on(); -light1.setBrightness(120); -light1.alertHueSaturation(25500, 255); -light1.setColorLoop(true); -light1.setColorRGB(255, 128, 0); -lights[1].off(); -lights.at(1).setColorHue(4562); -``` +\snippet Snippets.cpp light-3 + But keep in mind that some light types do not have all functions available. So you might call a specific function, but nothing will happen. For that you might want to check what type of a light you are controlling. For that you can call the function [getColorType()](@ref hueplusplus::Light::getColorType()), which will return a ColorType. -```{.cpp} -hueplusplus::ColorType type1 = light1.getColorType(); -``` +\snippet Snippets.cpp light-4 + There's also a new way to check whether specific functions of a light are available: -```{.cpp} -light1.hasBrightnessControl(); -light1.hasTemperatureControl(); -light1.hasColorControl(); -``` +\snippet Snippets.cpp light-5 + These will either return true(light has specified function) or false(light lacks specified function). ## Build and install -- [Build and install guide](@ref build) +[Build and install guide](@ref build) ### Basic installation If you want to build the library you can use cmake (at least version 3.8). First create a build folder and then execute cmake. @@ -155,3 +129,11 @@ If you also want to execute coverage tests you will need to install gcov and lco ```bash make coveragetest ``` + + +## Other pages +- [Getting started](@ref getting-started) +- [Build and install](@ref build) +- [Shared state cache](@ref shared-state) +- [Transactions](@ref transactions) +- [Sensors](@ref sensors) diff --git a/doc/markdown/Sensors.md b/doc/markdown/Sensors.md index 13b4d6f..2f926d3 100644 --- a/doc/markdown/Sensors.md +++ b/doc/markdown/Sensors.md @@ -1,7 +1,10 @@ # Sensors {#sensors} +[TOC] + ## Sensor support The library supports the sensor types listed on the Hue developer documentation. +Include `hueplusplus/ZLLSensors.h` for ZigBee sensors and `hueplusplus/CLIPSensors.h` for CLIP sensors. Other sensors can be used with the generic [Sensor](@ref hueplusplus::Sensor) class. ### Working with a known sensor @@ -9,41 +12,19 @@ In most cases, the type of the sensors is known in advance, such as a switch. The classes in the [sensors](@ref hueplusplus::sensors) namespace provide the documented functionality. The type can be specified when accessing the sensor. When it does not match, an exception is thrown. -```{.cpp} -hueplusplus::sensors::ZLLSwitch switchSensor = bridge.sensors().getAsType(2); -``` +\snippet Snippets.cpp known-sensor-1 You can also get all sensors of a specified type by using [getAllByType()](@ref hueplusplus::SensorList::getAllByType). -```{.cpp} -std::vector allSwitches = bridge.sensors().getAllByType(); -``` +\snippet Snippets.cpp known-sensor-2 ### Working with an unknown sensor When the sensor type is not known, use the generic sensor class. In this case, some attributes might not exist, so they have to be checked first. This applies to all attributes that have a `hasXXX` method. - -```{.cpp} -hueplusplus::Sensor genericSensor = bridge.sensors().get(1); -if(genericSensor.hasOn()) -{ - // Now can check whether it is on - if(genericSensor.isOn()) - { - // ... - } -} -``` +\snippet Snippets.cpp generic-sensor-1 It is easiest to compare the sensor type to the existing ones (`typeStr` on the specific sensor classes) and then convert the sensor to that type. -```{.cpp} -hueplusplus::Sensor genericSensor = bridge.sensors().get(1); -if(genericSensor.getType() == hueplusplus::sensors::ZLLSwitch::typeStr) -{ - hueplusplus::sensors::ZLLSwitch switchSensor = genericSensor.asSensorType(); - // ... -} -``` +\snippet Snippets.cpp generic-sensor-2 ## ZLL sensors vs. CLIP sensors ZLL sensors (defined in `ZLLSensors.h`) are physical device sensors which send their data @@ -60,19 +41,7 @@ Conditions can be created from the specific sensor types using `makeCondition()` These functions return a helper class with methods for the [possible operators](@ref hueplusplus::Condition::Operator) valid for the state. For some sensors, which have multiple possible states, there exist multiple variations of makeCondition. - -```{.cpp} -hueplusplus::sensors::ZLLSwitch switchSensor = ...; -// ZLLSwitch conditions operate on `buttonEvent`, use makeConditionLastUpdate() -// to trigger on the last update time. - -// Some examples: -hueplusplus::Condition upPressed = makeCondition(switchSensor).eq(hueplusplus::sensors::ZLLSwitch::c_UP_INITIAL_PRESS); -hueplusplus::Condition buttonChanged = makeCondition(switchSensor).dx(); - -hueplusplus::time::TimeInterval interval(std::chrono::hours(12), std::chrono::hours(13)); -hueplusplus::Condition updatedAtNoon = makeConditionLastUpdate(switchSensor).in(interval); -``` +\snippet Snippets.cpp sensor-conditions For generic sensors, the conditions must be created manually using the [Condition](@ref hueplusplus::Condition::Condition) -constructor with a proper address to the sensor state. \ No newline at end of file +constructor with a proper address to the sensor state. diff --git a/doc/markdown/Shared_State.md b/doc/markdown/Shared_State.md index fa12018..402923a 100644 --- a/doc/markdown/Shared_State.md +++ b/doc/markdown/Shared_State.md @@ -1,9 +1,11 @@ # Shared state cache {#shared-state} +[TOC] + ## What shared state means There are two ways in which the API state (internally JSON) can be handled: 1. Every resource instance holds its own cache of the state (default). -2. All instances share the cache for the entire bridge. +2. All instances share the cache of the entire bridge. ### Advantages of shared state * Different resources are always consistent on the library level. @@ -23,12 +25,8 @@ Because of these considerations, shared state is disabled by default. Shared state can be configured when the bridge is first constructed, either in [getBridge()](@ref hueplusplus::BridgeFinder::getBridge) or in the [constructor](@ref hueplusplus::Bridge::Bridge). Set `sharedState` to `true` to keep all resources connected to the bridge cache. -```{.cpp} -hueplusplus::Bridge bridge = finder.getBridge(bridges[0], true); -``` -```{.cpp} -hueplusplus::Bridge bridge("192.168.2.102", 80, "", handler, std::chrono::seconds(10), true); -``` +\snippet Snippets.cpp shared-bridge-1 +\snippet Snippets.cpp shared-bridge-2 ## Shared state and refreshing When shared cache is used, refreshes use a hierarchichal structure to determine how much should be requested from the bridge. @@ -38,13 +36,7 @@ Otherwise, only the lowest necessary level is requested from the bridge to be mo ### Example: -```{.cpp} -bridge.setRefreshDuration(std::chrono::minutes(1)); -bridge.lights().setRefreshDuration(std::chrono::seconds(30)); -hueplusplus::Light light = bridge.lights().get(1); -// ... wait some time -bool on = light.isOn(); -``` +\snippet Snippets.cpp refresh-example [isOn()](@ref hueplusplus::Light::isOn) is a non-const method (in this case). That means it will refresh the state if it is outdated. The default refresh time is inherited from `bridge.lights()`, so it is 30 seconds. After 30 seconds, the state of `light` *and* `bridge.lights()` is outdated. Therefore, the entire list of lights is diff --git a/doc/markdown/Transactions.md b/doc/markdown/Transactions.md index c96bd4d..7157763 100644 --- a/doc/markdown/Transactions.md +++ b/doc/markdown/Transactions.md @@ -1,12 +1,12 @@ # Transactions {#transactions} +[TOC] + ## Using a transaction for lights -Often, you want to change more than one variable on a light at the same time, +Often, you want to change more than one property on a light at the same time, for example brightness and color. This is done using transactions ([StateTransaction](@ref hueplusplus::StateTransaction)). +\snippet Snippets.cpp transaction-lights -```{.cpp} -light.transaction().setOn(true).setBrightness(29).setColorHue(3000).setColorSaturation(128).commit(); -``` The request is reduced to only the variables that need to be changed based on the current state. For example, if the light is already on, that part of the transaction is ignored. @@ -16,13 +16,7 @@ because that invalidates the reference. ### Advanced usage Another way to use the transaction is by storing it and building up the calls separately. - -```{.cpp} -hueplusplus::StateTransaction t = light.transaction(); -if(shouldTurnOn) - t.setOn(true); -t.commit(); -``` +\snippet Snippets.cpp transaction-advanced In this case, it is especially important that the light and the state of the light __MUST NOT__ invalidate. That means * the light variable has to live longer than the transaction @@ -34,17 +28,11 @@ In general, this method is easier to screw up and should only be used when reall The same principles of transactions for lights also apply for groups. The main difference is that for groups, there are no checks of the current state. Even if all lights in the group are already on, the request to turn on all lights on the group is still sent. - -```{.cpp} -group.transaction().setOn(true).setBrightness(64).commit(); -``` +\snippet Snippets.cpp transaction-groups ## Creating Actions In a [Schedule](@ref hueplusplus::Schedule) or [Rule](@ref hueplusplus::Rule), the bridge can set the state of lights and groups. To configure this, a transaction can be saved for later instead of committing it directly. -```{.cpp} -hueplusplus::Action action = light.transaction().setOn(true).setBrightness(255).toAction(); -schedule.setCommand(action); -``` +\snippet Snippets.cpp transaction-action diff --git a/examples/BridgeSetup.cpp b/examples/BridgeSetup.cpp index ebc950a..2cd7c10 100644 --- a/examples/BridgeSetup.cpp +++ b/examples/BridgeSetup.cpp @@ -18,7 +18,8 @@ You should have received a copy of the GNU Lesser General Public License along with hueplusplus. If not, see . - \brief This example connects to a bridge with hardcoded mac and username. + \example{lineno} BridgeSetup.cpp + This example connects to a bridge with hardcoded mac and username. **/ @@ -45,7 +46,7 @@ namespace hue = hueplusplus; const std::string macAddress = ""; const std::string username = ""; -//! \brief Connects to a bridge and returns it. +// Connects to a bridge and returns it. hue::Bridge connectToBridge() { hue::BridgeFinder finder(std::make_shared()); diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index c0ed8b1..c040257 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -15,4 +15,10 @@ set_property(TARGET lights_off PROPERTY CXX_EXTENSIONS OFF) target_link_libraries(username_config hueplusplusstatic) add_custom_target(hueplusplus_examples) -add_dependencies(hueplusplus_examples bridge_setup lights_off) \ No newline at end of file +add_dependencies(hueplusplus_examples bridge_setup lights_off username_config) + +# Snippets for documentation, not included with the examples target +add_executable(hueplusplus_snippets Snippets.cpp) +set_property(TARGET hueplusplus_snippets PROPERTY CXX_STANDARD 14) +set_property(TARGET hueplusplus_snippets PROPERTY CXX_EXTENSIONS OFF) +target_link_libraries(hueplusplus_snippets hueplusplusstatic) diff --git a/examples/LightsOff.cpp b/examples/LightsOff.cpp index 3396ce8..6b1b626 100644 --- a/examples/LightsOff.cpp +++ b/examples/LightsOff.cpp @@ -18,7 +18,8 @@ You should have received a copy of the GNU Lesser General Public License along with hueplusplus. If not, see . - \brief This example turns off all lights for 20 seconds, then turns them on again. + \example{lineno} LightsOff.cpp + This example turns off all lights for 20 seconds, then turns them on again. **/ #include @@ -43,7 +44,7 @@ namespace hue = hueplusplus; const std::string macAddress = ""; const std::string username = ""; -//! \brief Connects to a bridge and returns it. +// Connects to a bridge and returns it. hue::Bridge connectToBridge() { hue::BridgeFinder finder(std::make_shared()); @@ -79,9 +80,8 @@ hue::Bridge connectToBridge() return finder.getBridge(*it); } -//! \brief Turns off the lights on the bridge for 20 seconds. -//! -//! Only turns the lights back on that were on before. +// Turns off the lights on the bridge for 20 seconds. +// Only turns the lights back on that were on before. void lightsOff(hue::Bridge& hue) { std::vector lights = hue.lights().getAll(); diff --git a/examples/Snippets.cpp b/examples/Snippets.cpp new file mode 100644 index 0000000..a3429d1 --- /dev/null +++ b/examples/Snippets.cpp @@ -0,0 +1,199 @@ +/** + \file Snippets.cpp + Copyright Notice\n + Copyright (C) 2021 Jan Rogall - developer\n + + This file is part of hueplusplus. + + hueplusplus is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + hueplusplus is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with hueplusplus. If not, see . + + \brief Contains code snippets used in the documentation, performs no useful functions. +**/ + +#include +#include +#include + +#ifdef _MSC_VER +#include + +namespace hueplusplus +{ +// Dirty hack to make the snippets compile under windows. Dont do this, +// instead use your own alias which is set to either type like in BridgeSetup.cpp! +using LinHttpHandler = WinHttpHandler; +} // namespace hueplusplus + +#else +#include + +#endif + +void snippet1() +{ + // Main page + //! [search-bridge] + // For windows use std::make_shared(); + auto handler = std::make_shared(); + hueplusplus::BridgeFinder finder(handler); + std::vector bridges = finder.findBridges(); + if (bridges.empty()) + { + std::cerr << "No bridges found\n"; + return; + } + //! [search-bridge] + //! [get-bridge-2] + finder.addUsername(bridges[0].mac, ""); + //! [get-bridge-1] + hueplusplus::Bridge bridge = finder.getBridge(bridges[0]); + //! [get-bridge-1] + //! [get-bridge-2] + //! [light-1] + hueplusplus::Light light1 = bridge.lights().get(1); + //! [light-1] + //! [light-2] + std::vector lights = bridge.lights().getAll(); + //! [light-2] + //! [light-3] + light1.on(); + light1.setBrightness(120); + light1.alertHueSaturation({25500, 254}); + light1.setColorLoop(true); + light1.setColorRGB({255, 128, 0}); + lights[1].off(); + lights.at(1).setColorHue(4562); + //! [light-3] + //! [light-4] + hueplusplus::ColorType type1 = light1.getColorType(); + //! [light-4] + //! [light-5] + light1.hasBrightnessControl(); + light1.hasTemperatureControl(); + light1.hasColorControl(); + //! [light-5] + + // Getting started + //! [control-lights] + hueplusplus::Light light = bridge.lights().get(1); + light.on(); + light.off(); + //! [control-lights] + //! [control-groups] + hueplusplus::Group group = bridge.groups().get(1); + group.setOn(true); + //! [control-groups] + + // Sensors + //! [sensor-conditions] + //! [known-sensor-1] + hueplusplus::sensors::ZLLSwitch switchSensor = bridge.sensors().getAsType(2); + //! [known-sensor-1] + // ZLLSwitch conditions operate on `buttonEvent`, use makeConditionLastUpdate() + // to trigger on the last update time. + + // Some examples: + hueplusplus::Condition upPressed + = makeCondition(switchSensor).eq(hueplusplus::sensors::ZLLSwitch::c_UP_INITIAL_PRESS); + hueplusplus::Condition buttonChanged = makeCondition(switchSensor).dx(); + + hueplusplus::time::TimeInterval interval(std::chrono::hours(12), std::chrono::hours(13)); + hueplusplus::Condition updatedAtNoon = makeConditionLastUpdate(switchSensor).in(interval); + //! [sensor-conditions] + //! [known-sensor-2] + std::vector allSwitches + = bridge.sensors().getAllByType(); + //! [known-sensor-2] + //! [generic-sensor-1] + hueplusplus::Sensor genericSensor = bridge.sensors().get(1); + if (genericSensor.hasOn()) + { + // Now can check whether it is on + if (genericSensor.isOn()) + { + // ... + } + } + //! [generic-sensor-1] + + // Transactions + //! [transaction-lights] + light.transaction().setOn(true).setBrightness(29).setColorHue(3000).setColorSaturation(128).commit(); + //! [transaction-lights] + bool shouldTurnOn = true; + //! [transaction-advanced] + hueplusplus::StateTransaction t = light.transaction(); + if (shouldTurnOn) + t.setOn(true); + t.commit(); + //! [transaction-advanced] + //! [transaction-groups] + group.transaction().setOn(true).setBrightness(64).commit(); + //! [transaction-groups] + hueplusplus::Schedule schedule = bridge.schedules().get(1); + //! [transaction-action] + hueplusplus::Action action = light.transaction().setOn(true).setBrightness(254).toAction(); + schedule.setCommand(action); + //! [transaction-action] +} +void snippet2() +{ + // Main page + //! [get-bridge-3] + // For windows use std::make_shared(); + auto handler = std::make_shared(); + hueplusplus::Bridge bridge("192.168.2.102", 80, "", handler); + //! [get-bridge-3] + + // Sensors + //! [generic-sensor-2] + hueplusplus::Sensor genericSensor = bridge.sensors().get(1); + if (genericSensor.getType() == hueplusplus::sensors::ZLLSwitch::typeStr) + { + hueplusplus::sensors::ZLLSwitch switchSensor = genericSensor.asSensorType(); + // ... + } + //! [generic-sensor-2] +} + +void snippet3() +{ + // Shared state + auto handler = std::make_shared(); + hueplusplus::BridgeFinder finder(handler); + std::vector bridges = finder.findBridges(); + //! [shared-bridge-1] + hueplusplus::Bridge bridge = finder.getBridge(bridges[0], true); + //! [shared-bridge-1] + //! [refresh-example] + bridge.setRefreshDuration(std::chrono::minutes(1)); + bridge.lights().setRefreshDuration(std::chrono::seconds(30)); + hueplusplus::Light light = bridge.lights().get(1); + // ... wait some time + bool on = light.isOn(); + //! [refresh-example] +} +void snippet4() +{ + // Shared state + auto handler = std::make_shared(); + //! [shared-bridge-2] + hueplusplus::Bridge bridge("192.168.2.102", 80, "", handler, "", std::chrono::seconds(10), true); + //! [shared-bridge-2] +} + +int main(int argc, char** argv) +{ + return 0; +} \ No newline at end of file diff --git a/examples/UsernameConfig.cpp b/examples/UsernameConfig.cpp index 2643404..fc2720e 100644 --- a/examples/UsernameConfig.cpp +++ b/examples/UsernameConfig.cpp @@ -18,7 +18,8 @@ You should have received a copy of the GNU Lesser General Public License along with hueplusplus. If not, see . - \brief This example reads the username and mac address from a config file. + \example{lineno} UsernameConfig.cpp + This example reads the username and mac address from a config file. **/ #include @@ -42,9 +43,9 @@ using SystemHttpHandler = hueplusplus::LinHttpHandler; namespace hue = hueplusplus; -//! \brief Reads a json config file. -//! \param filename Path to the config file -//! \returns Parsed json or an empty object if not successful. +// Reads a json config file. +// filename: Path to the config file +// returns parsed json or an empty object if not successful. nlohmann::json readConfigFile(const std::string& filename) { std::ifstream stream(filename); @@ -64,20 +65,20 @@ nlohmann::json readConfigFile(const std::string& filename) } } -//! \brief Saves a json file. -//! \param filename Path to the config file -//! \param config Json value to save +// Saves a json file. +// filename: Path to the config file +// config: Json value to save void saveConfigFile(const std::string& filename, const nlohmann::json& config) { std::ofstream stream(filename); stream << std::setw(4) << config; } -//! \brief Connects to a bridge and returns it -//! \param username Already existing username, can be left empty. -//! \param macAddress MAC address of the bridge, can be left empty. -//! \throws std::runtime_error When the bridge was not found. -//! \returns A connected bridge. +// Connects to a bridge and returns it +// username: Already existing username, can be left empty. +// macAddress: MAC address of the bridge, can be left empty. +// throws std::runtime_error when the bridge was not found. +// returns a connected bridge. hue::Bridge connectToBridge(const std::string& username, const std::string& macAddress) { hue::BridgeFinder finder(std::make_shared()); @@ -113,12 +114,12 @@ hue::Bridge connectToBridge(const std::string& username, const std::string& macA return finder.getBridge(*it); } -//! Connects to a bridge. The steps are: -//! - read "config.json" for an existing config -//! - connect to the bridge -//! - save the username to the config file for the next run -//! -//! Also prints out the IP and username. +// Connects to a bridge. The steps are: +// - read "config.json" for an existing config +// - connect to the bridge +// - save the username to the config file for the next run +// +// Also prints out the IP and username. int main(int argc, char** argv) { -- libgit2 0.21.4