Skip to content

Commit dc9896c

Browse files
committed
v3.28
1 parent c06e8e9 commit dc9896c

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ or to show the help page
155155
If everything works properly, you will see something like this:
156156

157157
```
158-
rscp2mqtt [3.27]
158+
rscp2mqtt [3.28]
159159
E3DC system >192.168.178.111:5033< user: >your E3DC user<
160160
MQTT broker >localhost:1883< qos = >0< retain = >✗< tls >✗< client id >✗< prefix >e3dc<
161161
Requesting PVI ✓ | PM (0) | DCB ✓ (1 battery string) | Wallbox ✗ | Interval 2 | Autorefresh ✓ | Raw data ✗ | Logging OFF

RELEASE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Release Notes
22

3+
### Release v3.28 (27.07.2024)
4+
5+
Bug fixes:
6+
- Issue #83: Raw data mode: Problem assembling the topic names
7+
38
### Release v3.27 (24.07.2024)
49

510
Bug fixes:

RscpMqttMain.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <regex>
2222
#include <mutex>
2323

24-
#define RSCP2MQTT_VERSION "3.27"
24+
#define RSCP2MQTT_VERSION "3.28"
2525

2626
#define AES_KEY_SIZE 32
2727
#define AES_BLOCK_SIZE 32
@@ -881,8 +881,8 @@ bool updateRawData(char *topic, char *payload) {
881881
return(false);
882882
}
883883

884-
void mergeRawData(char *topic, char *payload) {
885-
if (topic && payload && !updateRawData(topic, payload)) {
884+
void insertRawData(char *topic, char *payload) {
885+
if (topic && payload) {
886886
RSCP_MQTT::mqtt_data_t v;
887887
v.topic = strdup(topic);
888888
v.payload = strdup(payload);
@@ -2108,7 +2108,7 @@ void publishRaw(RscpProtocol *protocol, SRscpValue *response, char *topic) {
21082108
updateRawData(topic, payload_new);
21092109
} else if (!payload_old && payload_new && strcmp(payload_new, "")) {
21102110
publishImmediately(topic, payload_new, false);
2111-
mergeRawData(topic, payload_new);
2111+
insertRawData(topic, payload_new);
21122112
}
21132113
if (payload_new) free(payload_new);
21142114
return;
@@ -2136,7 +2136,7 @@ void handleRaw(RscpProtocol *protocol, SRscpValue *response, uint32_t *cache, in
21362136
} else {
21372137
cache[l + 1] = data[i].tag;
21382138
strcpy(topic, "raw");
2139-
for (int i = 0; i < RECURSION_MAX_LEVEL; i++) {
2139+
for (int i = 0; i <= l + 1; i++) {
21402140
if (cache[i]) {
21412141
if (strlen(topic) + strlen(tagName(RSCP_TAGS::RscpTagsOverview, cache[i])) + 2 < TOPIC_SIZE) {
21422142
strcat(topic, "/");
@@ -2193,7 +2193,6 @@ int handleResponseValue(RscpProtocol *protocol, SRscpValue *response) {
21932193
}
21942194

21952195
if (cfg.raw_mode) {
2196-
for (int i = 0; i < RECURSION_MAX_LEVEL; i++) cache[i] = 0;
21972196
if (mosq) handleRaw(protocol, response, cache, -1);
21982197
}
21992198

@@ -2547,7 +2546,6 @@ int handleResponseValue(RscpProtocol *protocol, SRscpValue *response) {
25472546
}
25482547
default:
25492548
if (response->dataType == RSCP::eTypeContainer) {
2550-
for (int i = 0; i < RECURSION_MAX_LEVEL; i++) cache[i] = 0;
25512549
handleContainer(protocol, response, cache, -1);
25522550
} else storeResponseValue(RSCP_MQTT::RscpMqttCache, protocol, response, 0, 0);
25532551
break;

rscp2mqtt_mit_portainer.pdf

706 KB
Binary file not shown.

0 commit comments

Comments
 (0)