Browse Source

add statuscodes to the documentation

Julius Pfrommer 8 years ago
parent
commit
443feaf93f
5 changed files with 39 additions and 10 deletions
  1. 3 0
      doc/CMakeLists.txt
  2. 2 2
      doc/in_a_nutshell.rst
  3. 1 8
      doc/index.rst
  4. 31 0
      include/ua_statuscodes.h
  5. 2 0
      include/ua_types.h

+ 3 - 0
doc/CMakeLists.txt

@@ -12,11 +12,13 @@ function(generate_rst in out)
 endfunction()
 
 generate_rst(${PROJECT_SOURCE_DIR}/include/ua_types.h ${PROJECT_BINARY_DIR}/doc_src/types.rst)
+generate_rst(${PROJECT_SOURCE_DIR}/include/ua_statuscodes.h ${PROJECT_BINARY_DIR}/doc_src/statuscodes.rst)
 generate_rst(${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.h ${PROJECT_BINARY_DIR}/doc_src/types_generated.rst)
 
 add_custom_target(doc_latex ${SPHINX_EXECUTABLE}
   -b latex -c "${PROJECT_BINARY_DIR}/doc_src" "${PROJECT_BINARY_DIR}/doc_src" "${PROJECT_BINARY_DIR}/doc_latex"
   DEPENDS ${PROJECT_BINARY_DIR}/doc_src/types.rst
+  DEPENDS ${PROJECT_BINARY_DIR}/doc_src/statuscodes.rst
   DEPENDS ${PROJECT_BINARY_DIR}/doc_src/types_generated.rst
   COMMENT "Building LaTeX sources for documentation with Sphinx")
 add_dependencies(doc_latex open62541)
@@ -25,6 +27,7 @@ add_custom_target(doc ${SPHINX_EXECUTABLE}
   -b html -c "${PROJECT_BINARY_DIR}/doc_src" "${PROJECT_BINARY_DIR}/doc_src" "${PROJECT_BINARY_DIR}/doc"
   COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_BINARY_DIR}/doc_src/open62541_html.png" "${PROJECT_BINARY_DIR}/doc/_static/"
   DEPENDS ${PROJECT_BINARY_DIR}/doc_src/types.rst
+  DEPENDS ${PROJECT_BINARY_DIR}/doc_src/statuscodes.rst
   DEPENDS ${PROJECT_BINARY_DIR}/doc_src/types_generated.rst
   COMMENT "Building HTML documentation with Sphinx")
 add_dependencies(doc open62541)

+ 2 - 2
doc/in_a_nutshell.rst

@@ -1,5 +1,5 @@
-OPC UA in a nutshell
-====================
+Introduction to OPC UA
+======================
 
 OPC UA, a collection of services
 --------------------------------

+ 1 - 8
doc/index.rst

@@ -24,13 +24,6 @@ standard.
    building
    tutorials
    types
+   statuscodes
    types_generated
 
-   
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-

+ 31 - 0
include/ua_statuscodes.h

@@ -1,6 +1,33 @@
+/*
+ * Copyright (C) 2013-2015 the contributors as stated in the AUTHORS file
+ *
+ * This file is part of open62541. open62541 is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU Lesser General
+ * Public License, version 3 (as published by the Free Software Foundation) with
+ * a static linking exception as stated in the LICENSE file provided with
+ * open62541.
+ *
+ * open62541 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.
+ */
+
 #ifndef OPCUA_STATUSCODES_H_
 #define OPCUA_STATUSCODES_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * StatusCodes
+ * ===========
+ * StatusCodes are extensively used in the OPC UA protocol and in the open62541
+ * API. They are represented by the :ref:`statuscode` data type. The following
+ * definitions are autogenerated from the ``Opc.Ua.StatusCodes.csv`` file provided
+ * with the OPC UA standard.
+ */
 #define UA_STATUSCODE_GOOD 0x00
 #define UA_STATUSCODE_BADUNEXPECTEDERROR 0x80010000 // An unexpected error occurred.
 #define UA_STATUSCODE_BADINTERNALERROR 0x80020000 // An internal error occurred as a result of a programming or configuration error.
@@ -219,4 +246,8 @@
 #define UA_STATUSCODE_BADSYNTAXERROR 0x80b60000 // A value had an invalid syntax.
 #define UA_STATUSCODE_BADMAXCONNECTIONSREACHED 0x80b70000 // The operation could not be finished because all available connections are in use.
 
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
 #endif /* UA_STATUSCODES_H_ */

+ 2 - 0
include/ua_types.h

@@ -142,6 +142,8 @@ typedef float UA_Float;
 typedef double UA_Double;
 
 /**
+ * .. _statuscode:
+ *
  * StatusCode
  * ^^^^^^^^^^
  * A numeric identifier for a error or condition that is associated with a value