mirror of
https://github.com/thelsing/knx.git
synced 2025-01-30 00:19:01 +01:00
move main.cpp, document SaveRestore
This commit is contained in:
parent
7b6a62bbc1
commit
3a58ca8534
24
doc/Doxyfile
24
doc/Doxyfile
@ -791,7 +791,8 @@ WARN_LOGFILE =
|
|||||||
# Note: If this tag is empty the current directory is searched.
|
# Note: If this tag is empty the current directory is searched.
|
||||||
|
|
||||||
INPUT = ../src \
|
INPUT = ../src \
|
||||||
../README.md
|
../README.md \
|
||||||
|
example_list.h
|
||||||
|
|
||||||
# This tag can be used to specify the character encoding of the source files
|
# 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
|
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||||
@ -874,7 +875,7 @@ RECURSIVE = YES
|
|||||||
# Note that relative paths are relative to the directory from which doxygen is
|
# Note that relative paths are relative to the directory from which doxygen is
|
||||||
# run.
|
# run.
|
||||||
|
|
||||||
EXCLUDE = .
|
EXCLUDE =
|
||||||
|
|
||||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
# 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
|
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||||
@ -890,15 +891,7 @@ EXCLUDE_SYMLINKS = NO
|
|||||||
# Note that the wildcards are matched against the file with absolute path, so to
|
# 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 all test directories for example use the pattern */test/*
|
||||||
|
|
||||||
EXCLUDE_PATTERNS = VisualGDB \
|
EXCLUDE_PATTERNS =
|
||||||
VisualGDBCache \
|
|
||||||
pybind11 \
|
|
||||||
visualstudio \
|
|
||||||
main.cpp \
|
|
||||||
*.py \
|
|
||||||
Debug \
|
|
||||||
gcc_Debug.h \
|
|
||||||
gcc_Release.h
|
|
||||||
|
|
||||||
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
||||||
# (namespaces, classes, functions, etc.) that should be excluded from the
|
# (namespaces, classes, functions, etc.) that should be excluded from the
|
||||||
@ -915,7 +908,8 @@ EXCLUDE_SYMBOLS =
|
|||||||
# that contain example code fragments that are included (see the \include
|
# that contain example code fragments that are included (see the \include
|
||||||
# command).
|
# command).
|
||||||
|
|
||||||
EXAMPLE_PATH =
|
EXAMPLE_PATH = ../examples \
|
||||||
|
../knx-linux
|
||||||
|
|
||||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
# 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
|
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
|
||||||
@ -929,7 +923,7 @@ EXAMPLE_PATTERNS = *
|
|||||||
# irrespective of the value of the RECURSIVE tag.
|
# irrespective of the value of the RECURSIVE tag.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
EXAMPLE_RECURSIVE = NO
|
EXAMPLE_RECURSIVE = YES
|
||||||
|
|
||||||
# The IMAGE_PATH tag can be used to specify one or more files or directories
|
# The IMAGE_PATH tag can be used to specify one or more files or directories
|
||||||
# that contain images that are to be included in the documentation (see the
|
# that contain images that are to be included in the documentation (see the
|
||||||
@ -991,7 +985,7 @@ FILTER_SOURCE_PATTERNS =
|
|||||||
# (index.html). This can be useful if you have a project on for instance GitHub
|
# (index.html). This can be useful if you have a project on for instance GitHub
|
||||||
# and want to reuse the introduction page also for the doxygen output.
|
# and want to reuse the introduction page also for the doxygen output.
|
||||||
|
|
||||||
USE_MDFILE_AS_MAINPAGE =
|
USE_MDFILE_AS_MAINPAGE = ../README.md
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Configuration options related to source browsing
|
# Configuration options related to source browsing
|
||||||
@ -2244,7 +2238,7 @@ HIDE_UNDOC_RELATIONS = YES
|
|||||||
# set to NO
|
# set to NO
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
HAVE_DOT = YES
|
HAVE_DOT = NO
|
||||||
|
|
||||||
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
|
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
|
||||||
# to run in parallel. When set to 0 doxygen will base this on the number of
|
# to run in parallel. When set to 0 doxygen will base this on the number of
|
||||||
|
7
doc/example_list.h
Normal file
7
doc/example_list.h
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* @example main.cpp
|
||||||
|
* @example knx-demo.ino
|
||||||
|
* @example knx-hdc1008.ino
|
||||||
|
* @example knx-bme680.ino
|
||||||
|
*
|
||||||
|
**/
|
@ -6,16 +6,9 @@
|
|||||||
|
|
||||||
HDC100X HDC1(0x43);
|
HDC100X HDC1(0x43);
|
||||||
|
|
||||||
// declare array of all groupobjects with their sizes in byte
|
// create macros easy access to group objects
|
||||||
GroupObject groupObjects[]
|
#define goTemperature knx.getGroupObject(1)
|
||||||
{
|
#define goHumidity knx.getGroupObject(2)
|
||||||
GroupObject(2),
|
|
||||||
GroupObject(2)
|
|
||||||
};
|
|
||||||
|
|
||||||
// create named references for easy access to group objects
|
|
||||||
GroupObject& goTemperature = groupObjects[0];
|
|
||||||
GroupObject& goHumidity = groupObjects[1];
|
|
||||||
|
|
||||||
long lastsend = 0;
|
long lastsend = 0;
|
||||||
|
|
||||||
@ -39,8 +32,6 @@ void setup(void)
|
|||||||
knx.ledPin(5);
|
knx.ledPin(5);
|
||||||
// Programming button on digital pin D7
|
// Programming button on digital pin D7
|
||||||
knx.buttonPin(7);
|
knx.buttonPin(7);
|
||||||
// register group objects
|
|
||||||
knx.registerGroupObjects(groupObjects, 2);
|
|
||||||
|
|
||||||
// read adress table, association table, groupobject table and parameters from eeprom
|
// read adress table, association table, groupobject table and parameters from eeprom
|
||||||
knx.readMemory();
|
knx.readMemory();
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
cmake_minimum_required(VERSION 2.7)
|
cmake_minimum_required(VERSION 2.7)
|
||||||
project(knx-linux)
|
project(knx-linux)
|
||||||
set(LIBRARIES_FROM_REFERENCES "")
|
set(LIBRARIES_FROM_REFERENCES "")
|
||||||
add_executable(knx-linux ../src/knx/address_table_object.cpp ../src/knx/apdu.cpp ../src/knx/application_layer.cpp ../src/knx/application_program_object.cpp ../src/knx/association_table_object.cpp ../src/knx/bau.cpp ../src/knx/bau07B0.cpp ../src/knx/bau57B0.cpp ../src/knx/bau_systemB.cpp ../src/knx/bits.cpp ../src/knx/cemi_frame.cpp ../src/knx/data_link_layer.cpp ../src/knx/datapoint_types.cpp ../src/knx/device_object.cpp ../src/knx/group_object.cpp ../src/knx/group_object_table_object.cpp ../src/knx/interface_object.cpp ../src/knx/ip_data_link_layer.cpp ../src/knx/ip_parameter_object.cpp ../src/knx/memory.cpp ../src/knx/network_layer.cpp ../src/knx/npdu.cpp ../src/knx/table_object.cpp ../src/knx/tpdu.cpp ../src/knx/tpuart_data_link_layer.cpp ../src/knx/transport_layer.cpp ../src/knx/platform.cpp ../src/main.cpp ../src/linux_platform.cpp)
|
add_executable(knx-linux ../src/knx/address_table_object.cpp ../src/knx/apdu.cpp ../src/knx/application_layer.cpp ../src/knx/application_program_object.cpp ../src/knx/association_table_object.cpp ../src/knx/bau.cpp ../src/knx/bau07B0.cpp ../src/knx/bau57B0.cpp ../src/knx/bau_systemB.cpp ../src/knx/bits.cpp ../src/knx/cemi_frame.cpp ../src/knx/data_link_layer.cpp ../src/knx/datapoint_types.cpp ../src/knx/device_object.cpp ../src/knx/group_object.cpp ../src/knx/group_object_table_object.cpp ../src/knx/interface_object.cpp ../src/knx/ip_data_link_layer.cpp ../src/knx/ip_parameter_object.cpp ../src/knx/memory.cpp ../src/knx/network_layer.cpp ../src/knx/npdu.cpp ../src/knx/table_object.cpp ../src/knx/tpdu.cpp ../src/knx/tpuart_data_link_layer.cpp ../src/knx/transport_layer.cpp ../src/knx/platform.cpp main.cpp ../src/linux_platform.cpp)
|
||||||
target_link_libraries(knx-linux "${LIBRARIES_FROM_REFERENCES}")
|
target_link_libraries(knx-linux "${LIBRARIES_FROM_REFERENCES}")
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wno-unknown-pragmas -Wno-switch -g -O0")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wno-unknown-pragmas -Wno-switch -g -O0")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-unknown-pragmas -Wno-switch -g -O0")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-unknown-pragmas -Wno-switch -g -O0")
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
||||||
<Class Name="AddressTableObject" Collapsed="true">
|
|
||||||
<Position X="2.25" Y="4.25" Width="1.5" />
|
|
||||||
<TypeIdentifier>
|
|
||||||
<HashCode>IBAAAAEAQACAEAIAABAAAAgAAAAAAAgAAAAAAABAAEA=</HashCode>
|
|
||||||
<FileName>C:\Users\tkunze\Source\knx\src\knx\address_table_object.h</FileName>
|
|
||||||
</TypeIdentifier>
|
|
||||||
</Class>
|
|
||||||
<Class Name="ApplicationProgramObject" Collapsed="true">
|
<Class Name="ApplicationProgramObject" Collapsed="true">
|
||||||
<Position X="4" Y="4.25" Width="1.5" />
|
<Position X="4" Y="4.25" Width="1.5" />
|
||||||
<TypeIdentifier>
|
<TypeIdentifier>
|
||||||
@ -77,13 +70,6 @@
|
|||||||
<FileName>C:\Users\tkunze\Source\knx\src\linux_platform.h</FileName>
|
<FileName>C:\Users\tkunze\Source\knx\src\linux_platform.h</FileName>
|
||||||
</TypeIdentifier>
|
</TypeIdentifier>
|
||||||
</Class>
|
</Class>
|
||||||
<Class Name="SaveRestore" Collapsed="true">
|
|
||||||
<Position X="0.5" Y="0.5" Width="1.5" />
|
|
||||||
<TypeIdentifier>
|
|
||||||
<HashCode>AAAAAAAAAACAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
|
||||||
<FileName>C:\Users\tkunze\Source\knx\src\knx\save_restore.h</FileName>
|
|
||||||
</TypeIdentifier>
|
|
||||||
</Class>
|
|
||||||
<Class Name="Platform" Collapsed="true">
|
<Class Name="Platform" Collapsed="true">
|
||||||
<Position X="9.75" Y="0.5" Width="1.5" />
|
<Position X="9.75" Y="0.5" Width="1.5" />
|
||||||
<TypeIdentifier>
|
<TypeIdentifier>
|
||||||
|
@ -140,6 +140,6 @@
|
|||||||
<ClCompile Include="..\src\knx\tpuart_data_link_layer.cpp" />
|
<ClCompile Include="..\src\knx\tpuart_data_link_layer.cpp" />
|
||||||
<ClCompile Include="..\src\knx\transport_layer.cpp" />
|
<ClCompile Include="..\src\knx\transport_layer.cpp" />
|
||||||
<ClCompile Include="..\src\linux_platform.cpp" />
|
<ClCompile Include="..\src\linux_platform.cpp" />
|
||||||
<ClCompile Include="..\src\main.cpp" />
|
<ClCompile Include="main.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -212,10 +212,10 @@
|
|||||||
<ClCompile Include="..\src\knx\transport_layer.cpp">
|
<ClCompile Include="..\src\knx\transport_layer.cpp">
|
||||||
<Filter>Source files\knx</Filter>
|
<Filter>Source files\knx</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\src\main.cpp">
|
<ClCompile Include="..\src\linux_platform.cpp">
|
||||||
<Filter>Source files</Filter>
|
<Filter>Source files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\src\linux_platform.cpp">
|
<ClCompile Include="main.cpp">
|
||||||
<Filter>Source files</Filter>
|
<Filter>Source files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#ifdef __linux__
|
|
||||||
|
|
||||||
#include "linux_platform.h"
|
#include "linux_platform.h"
|
||||||
#include "knx/bau57B0.h"
|
#include "knx/bau57B0.h"
|
||||||
#include "knx/group_object_table_object.h"
|
#include "knx/group_object_table_object.h"
|
||||||
@ -97,4 +95,3 @@ int main(int argc, char **argv)
|
|||||||
platfrom.mdelay(100);
|
platfrom.mdelay(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
@ -1,10 +1,28 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief Interface for classes that can save and restore data from a buffer.
|
||||||
|
*/
|
||||||
class SaveRestore
|
class SaveRestore
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief This method is called when the object should save its state to the buffer.
|
||||||
|
*
|
||||||
|
* @param buffer The buffer the object should save its state to.
|
||||||
|
*
|
||||||
|
* @return The buffer plus the size of the object state. The next object will use this value as
|
||||||
|
* the start of its buffer.
|
||||||
|
*/
|
||||||
virtual uint8_t* save(uint8_t* buffer) = 0;
|
virtual uint8_t* save(uint8_t* buffer) = 0;
|
||||||
|
/**
|
||||||
|
* @brief This method is called when the object should restore its state from the buffer.
|
||||||
|
*
|
||||||
|
* @param buffer The buffer the object should restore its state from.
|
||||||
|
*
|
||||||
|
* @return The buffer plus the size of the object state. The next object will use this value as
|
||||||
|
* the start of its buffer.
|
||||||
|
*/
|
||||||
virtual uint8_t* restore(uint8_t* buffer) = 0;
|
virtual uint8_t* restore(uint8_t* buffer) = 0;
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user