Skip to content

Commit

Permalink
Merge pull request #37 from KNX-IOT/build-test
Browse files Browse the repository at this point in the history
update with metadata
  • Loading branch information
WAvdBeek authored Sep 12, 2022
2 parents 1f54eaf + 05ec3fe commit 576cbeb
Show file tree
Hide file tree
Showing 10 changed files with 1,172 additions and 3,047 deletions.
22 changes: 12 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
cmake_minimum_required(VERSION 3.15)
project(knx-virtual)

include(FetchContent)


include(FetchContent)

FetchContent_Declare(
knx-iot-stack
GIT_REPOSITORY https://github.com/KNX-IOT/KNX-IOT-STACK.git
GIT_TAG master
)


FetchContent_Declare(
knx-iot-stack-gitlab
GIT_REPOSITORY https://gitlab.knx.org/shared-projects/knx-iot-point-api-public-stack.git
Expand All @@ -19,7 +21,7 @@ if(MSVC)
endif()

set(USE_GITLAB OFF CACHE BOOL "use gitlab as source for KNX IoT Stack")
set(USE_CONSOLE OFF CACHE BOOL "use console (for output logging)")
set(USE_CONSOLE ON CACHE BOOL "use console (for output logging)")

if(USE_GITLAB)
if(NOT knx-iot-stack_POPULATED)
Expand Down Expand Up @@ -48,10 +50,10 @@ add_executable(knx_iot_virtual_sa
target_link_libraries(knx_iot_virtual_sa kisClientServer)


add_executable(knx_iot_virtual_dimming_actuator
${PROJECT_SOURCE_DIR}/knx_iot_virtual_dimming_actuator.c
)
target_link_libraries(knx_iot_virtual_dimming_actuator kisClientServer)
#add_executable(knx_iot_virtual_dimming_actuator
# ${PROJECT_SOURCE_DIR}/knx_iot_virtual_dimming_actuator.c
#)
#target_link_libraries(knx_iot_virtual_dimming_actuator kisClientServer)

if(WIN32)
set(wxWidgets_ROOT_DIR ${wx_widgets_SOURCE_DIR})
Expand All @@ -62,11 +64,11 @@ if(WIN32)
${PROJECT_SOURCE_DIR}/knx_iot_virtual_pb.c)
target_link_libraries(knx_iot_virtual_gui_pb ${wxWidgets_LIBRARIES} kisClientServer)
target_compile_definitions(knx_iot_virtual_gui_pb PUBLIC KNX_GUI)
if(USE_CONSOLE)
#if(USE_CONSOLE)
set_target_properties(knx_iot_virtual_gui_pb PROPERTIES
LINK_FLAGS /SUBSYSTEM:CONSOLE
)
endif()
#endif()

add_executable(knx_iot_virtual_gui_sa WIN32
${PROJECT_SOURCE_DIR}/knx_iot_virtual_sa.cpp
Expand All @@ -79,7 +81,7 @@ if(WIN32)
)
endif()

endif()
endif()

if(UNIX)

Expand Down
74 changes: 74 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
- [1. KNX-IOT-Virtual](#1-knx-iot-virtual)
- [1.1. The Applications](#11-the-applications)
- [1.1.1. The knx_iot_virtual_pb Application](#111-the-knx_iot_virtual_pb-application)
- [1.1.1.1. MetaData push button](#1111-metadata-push-button)
- [1.1.2. knx_iot_virtual_sa Application](#112-knx_iot_virtual_sa-application)
- [1.1.2.1. MetaData switch actuator](#1121-metadata-switch-actuator)
- [1.2. Updating KNX-IOT-Virtual code base](#12-updating-knx-iot-virtual-code-base)
- [1.2.1. GitHub access](#121-github-access)
- [1.2.2. GitLab access](#122-gitlab-access)
Expand Down Expand Up @@ -89,6 +91,42 @@ Data points:
| "/p/o_7_7" | OnOff_4 | 4 |urn:knx:dpa.421.61 | if.s |bool |
| "/p/o_8_8" | InfoOnOff_4 | 4 |urn:knx:dpa.421.51 | if.a |bool |

#### 1.1.1.1. MetaData push button

The mandatory metadata parameters per data points implemented:

- id (9) - the unique url
- rt - the resource type
- if - the interface type
- dpt - the data point type
- ga - the array of group addresses (if initialized)

next to the mandatory metadata fields the following datapoint specific metadata fields are implemented

| url | name | metadata tag | metadata value |
|------| ----------------| ---------| --------- |
| "/p/o_1_1" | OnOff_1 | desc |On/Off push button 1 |
| "/p/o_2_2" | InfoOnOff_1 | desc |Feedback 1 |
| "/p/o_3_3" | OnOff_2 | desc |On/Off push button 2 |
| "/p/o_4_4" | InfoOnOff_2 | desc |Feedback 2 |
| "/p/o_5_5" | OnOff_3 | desc |On/Off push button 3 |
| "/p/o_6_6" | InfoOnOff_3 | desc |Feedback 3 |
| "/p/o_7_7" | OnOff_4 | desc |On/Off push button 4 |
| "/p/o_8_8" | InfoOnOff_4 | desc |Feedback 4 |

for querying the metadata items implemented one can use the following commands:

```
GET /p/o_1_1?m=*
GET /p/o_2_2?m=*
GET /p/o_3_3?m=*
GET /p/o_4_4?m=*
GET /p/o_5_5?m=*
GET /p/o_6_6?m=*
GET /p/o_7_7?m=*
GET /p/o_8_8?m=*
```

### 1.1.2. knx_iot_virtual_sa Application

Switch Actuator (SA)
Expand All @@ -108,6 +146,42 @@ Data points:
| "/p/o_7_7" | OnOff_4 | 4 |urn:knx:dpa.417.61 | if.a |bool |
| "/p/o_8_8" | InfoOnOff_4 | 4 |urn:knx:dpa.417.51 | if.s |bool |

#### 1.1.2.1. MetaData switch actuator

The mandatory metadata parameters per data points implemented:

- id (9) - the unique url
- rt - the resource type
- if - the interface type
- dpt - the data point type
- ga - the array of group addresses (if initialized)

next to the mandatory metadata fields the following datapoint specific metadata fields are implemented

| url | name | metadata tag | metadata value |
|------| ----------------| ---------| --------- |
| "/p/o_1_1" | OnOff_1 | desc |On/Off switch 1 |
| "/p/o_2_2" | InfoOnOff_1 | desc |Feedback 1 |
| "/p/o_3_3" | OnOff_2 | desc |On/Off switch 2 |
| "/p/o_4_4" | InfoOnOff_2 | desc |Feedback 2 |
| "/p/o_5_5" | OnOff_3 | desc |On/Off switch 3 |
| "/p/o_6_6" | InfoOnOff_3 | desc |Feedback 3 |
| "/p/o_7_7" | OnOff_4 | desc |On/Off switch 4 |
| "/p/o_8_8" | InfoOnOff_4 | desc |Feedback 4 |

for querying the metadata items implemented one can use the following commands:
```
GET /p/o_1_1?m=*
GET /p/o_2_2?m=*
GET /p/o_3_3?m=*
GET /p/o_4_4?m=*
GET /p/o_5_5?m=*
GET /p/o_6_6?m=*
GET /p/o_7_7?m=*
GET /p/o_8_8?m=*
```


## 1.2. Updating KNX-IOT-Virtual code base

Please "touch" the `CMakeLists.txt` file, then the visual studio solution will see
Expand Down
Loading

0 comments on commit 576cbeb

Please sign in to comment.