Skip to content

Commit 76a3213

Browse files
authored
Merge pull request #5 from openDAQ/demo
Removing previous MQTT streaming server approach Brief: - Removing: ref-dev-mqtt-pub/ref-dev-mqtt-sub examples, mqtt_streaming_server_module; - Renaming: mqtt_streaming_client_module -> mqtt_streaming_module; - Renaming: ref-dev-mqtt-raw-sub -> raw-mqtt-sub; - Renaming: ref-dev-mqtt-fb-pub -> ref-dev-mqtt-pub; - README.md updating;
2 parents 1fe7e97 + 359d719 commit 76a3213

69 files changed

Lines changed: 295 additions & 1465 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ endif()
6262

6363
add_subdirectory(external)
6464
add_subdirectory(mqtt_streaming_protocol)
65-
add_subdirectory(mqtt_streaming_server_module)
66-
add_subdirectory(mqtt_streaming_client_module)
65+
add_subdirectory(mqtt_streaming_module)
6766

6867
if(OPENDAQ_DEVICE_EXAMPLE_ENABLE_EXAMPLE_APPS)
6968
message(STATUS "Example applications have been enabled")

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ There are 3 example C++ application:
168168
```bash
169169
./custom-mqtt-sub --address broker.emqx.io examples/custom-mqtt-sub/public-example0.json
170170
```
171-
- **ref-dev-mqtt-raw-sub** - demonstrates how to work with the raw MQTT FB. The application creates an MQTT device and a raw MQTT FB to receive MQTT messages and create openDAQ signals to send the data as binary packets. The application also creates packet readers for all FB signals and prints the binary packets as strings to standard output. The SignalList property of the raw MQTT FB is filled from the application arguments. Usage:
171+
- **raw-mqtt-sub** - demonstrates how to work with the raw MQTT FB. The application creates an MQTT device and a raw MQTT FB to receive MQTT messages and create openDAQ signals to send the data as binary packets. The application also creates packet readers for all FB signals and prints the binary packets as strings to standard output. The SignalList property of the raw MQTT FB is filled from the application arguments. Usage:
172172
```bash
173-
./ref-dev-mqtt-raw-sub --address broker.emqx.io /agvstate /mirip/UNet3AC2/sensor/data
173+
./raw-mqtt-sub --address broker.emqx.io /agvstate /mirip/UNet3AC2/sensor/data
174174
```
175-
- **ref-dev-mqtt-fb-pub** - demonstrates how to work with the *publisher MQTT FB*. The application creates an *openDAQ ref-device* with four channels, an *MQTT device*, and a *publisher MQTT FB* to publish JSON MQTT messages with the channels’ data. The properties of the *publisher MQTT FB* are set according to the selected mode, which can be specified via the *--mode* option. Posible values are:
175+
- **ref-dev-mqtt-pub** - demonstrates how to work with the *publisher MQTT FB*. The application creates an *openDAQ ref-device* with four channels, an *MQTT device*, and a *publisher MQTT FB* to publish JSON MQTT messages with the channels’ data. The properties of the *publisher MQTT FB* are set according to the selected mode, which can be specified via the *--mode* option. Posible values are:
176176
- 0 - One MQTT message per signal / one message per sample / one topic per signal / one timestamp for each sample;
177177
- 1 - One MQTT message per signal / one message containing several samples / one topic per signal / one timestamp per sample (array of samples);
178178
- 2 - One MQTT message for several signals (from 1 to N) / one message per sample for each signal / one topic for all signals / separate timestamps for each signal;
179179
- 3 - One MQTT message for all signals / one message per sample containing all signals / one topic for all signals / one shared timestamp for all signals.
180180
```bash
181-
./ref-dev-mqtt-fb-pub --address broker.emqx.io --mode 1
181+
./ref-dev-mqtt-pub --address broker.emqx.io --mode 1
182182
```
183183
Published messages can be observed using third-party tools (see the **External MQTT tools** section).
184184
For all applications, by default, the IP address *127.0.0.1* is used for the broker connection. It can be set via the *--address* option, for example:
@@ -189,7 +189,7 @@ For all applications, by default, the IP address *127.0.0.1* is used for the bro
189189
They are located in the **examples/** directory.
190190
> ***Note:*** *Using the applications involves using a third-party broker. It must be started before example applications. See a **External MQTT tools** section for more details*
191191
192-
> ***Note:*** *The **ref-dev-mqtt-fb-pub** application depends on [**RefDeviceModule**](https://github.com/openDAQ/openDAQ/tree/main/examples/modules/ref_device_module).*
192+
> ***Note:*** *The **ref-dev-mqtt-pub** application depends on [**RefDeviceModule**](https://github.com/openDAQ/openDAQ/tree/main/examples/modules/ref_device_module).*
193193
194194

195195
## External MQTT tools
@@ -215,4 +215,4 @@ This command publishes a message and exits. From the subscriber's side you can s
215215
```shell
216216
mosquitto_sub -h 127.0.0.1 -t "openDAQ/publisher" -v
217217
openDAQ/publisher {"Input0":2, "Input1":1.2, "Input3":3.3}
218-
```
218+
```

examples/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
cmake_minimum_required(VERSION 3.16)
22

33
if (OPENDAQ_MQTT_ENABLE_EXAMPLE_APPS)
4-
add_subdirectory(ref-dev-mqtt-pub)
5-
add_subdirectory(ref-dev-mqtt-sub)
6-
add_subdirectory(ref-dev-mqtt-raw-sub)
4+
add_subdirectory(raw-mqtt-sub)
75
add_subdirectory(custom-mqtt-sub)
8-
add_subdirectory(ref-dev-mqtt-fb-pub)
6+
add_subdirectory(ref-dev-mqtt-pub)
97
endif()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.16)
22

3-
set(EXAMPLE_PROJECT_NAME "ref-dev-mqtt-sub")
3+
set(EXAMPLE_PROJECT_NAME "raw-mqtt-sub")
44

55
project(${EXAMPLE_PROJECT_NAME} LANGUAGES CXX)
66

examples/ref-dev-mqtt-raw-sub/src/CMakeLists.txt renamed to examples/raw-mqtt-sub/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.16)
33
add_compile_definitions(MODULE_PATH="${OPENDAQ_MODULES_DIR}")
44
add_compile_definitions(APP_NAME="${EXAMPLE_PROJECT_NAME}")
55

6-
add_executable(${EXAMPLE_PROJECT_NAME} ref-dev-mqtt-raw-sub.cpp)
6+
add_executable(${EXAMPLE_PROJECT_NAME} raw-mqtt-sub.cpp)
77

88
target_link_libraries(${EXAMPLE_PROJECT_NAME} PRIVATE daq::opendaq
99
rapidjson
File renamed without changes.

examples/ref-dev-mqtt-fb-pub/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/ref-dev-mqtt-fb-pub/src/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/ref-dev-mqtt-fb-pub/src/ref-dev-mqtt-fb-pub.cpp

Lines changed: 0 additions & 147 deletions
This file was deleted.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22

33
add_compile_definitions(MODULE_PATH="${OPENDAQ_MODULES_DIR}")
4+
add_compile_definitions(APP_NAME="${EXAMPLE_PROJECT_NAME}")
45

56
add_executable(${EXAMPLE_PROJECT_NAME} ref-dev-mqtt-pub.cpp)
67
add_dependencies(${EXAMPLE_PROJECT_NAME} daq::ref_device_module)
78
target_link_libraries(${EXAMPLE_PROJECT_NAME} PRIVATE daq::opendaq)
8-
target_include_directories(${EXAMPLE_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../)
9+
target_include_directories(${EXAMPLE_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../)

0 commit comments

Comments
 (0)