Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions plugins/mqtt/mqtt.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"description_zh": "接收点位写入请求的 MQTT 主题。",
"attribute": "required",
"type": "string",
"default": "/neuron/${random_str}/write/req",
"default": "neuron/${random_str}/write/req",
"valid": {
"length": 255
}
Expand All @@ -138,7 +138,7 @@
"description_zh": "发送点位写入响应的 MQTT 主题。",
"attribute": "required",
"type": "string",
"default": "/neuron/${random_str}/write/resp",
"default": "neuron/${random_str}/write/resp",
"valid": {
"length": 255
}
Expand All @@ -149,7 +149,7 @@
"description": "MQTT topic prefix for driver function.",
"attribute": "required",
"type": "string",
"default": "/neuron/${random_str}",
"default": "neuron/${random_str}",
"valid": {
"length": 128
}
Expand All @@ -173,7 +173,7 @@
"field": "upload_drv_state",
"value": true
},
"default": "/neuron/${random_str}/state/update",
"default": "neuron/${random_str}/state/update",
"valid": {
"length": 255
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/mqtt/mqtt_plugin_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,13 @@ static int create_topic(neu_plugin_t *plugin)
return 0;
}

neu_asprintf(&plugin->read_req_topic, "/neuron/%s/read/req",
neu_asprintf(&plugin->read_req_topic, "neuron/%s/read/req",
plugin->common.name);
if (NULL == plugin->read_req_topic) {
return -1;
}

neu_asprintf(&plugin->read_resp_topic, "/neuron/%s/read/resp",
neu_asprintf(&plugin->read_resp_topic, "neuron/%s/read/resp",
plugin->common.name);
if (NULL == plugin->read_resp_topic) {
free(plugin->read_req_topic);
Expand Down
14 changes: 7 additions & 7 deletions tests/ft/app/test_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
]
FORMAT_VALUES = 0
FORMAT_TAGS = 1
UPLOAD_TOPIC = f"/neuron/{NODE}/upload"
WRITE_REQ_TOPIC = f"/neuron/{NODE}/write/req"
WRITE_RESP_TOPIC = f"/neuron/{NODE}/write/resp"
READ_REQ_TOPIC = f"/neuron/{NODE}/read/req"
READ_RESP_TOPIC = f"/neuron/{NODE}/read/resp"
UPLOAD_DRV_STATE_TOPIC = f"/neuron/{NODE}/state/update"
UPLOAD_TOPIC = f"neuron/{NODE}/upload"
WRITE_REQ_TOPIC = f"neuron/{NODE}/write/req"
WRITE_RESP_TOPIC = f"neuron/{NODE}/write/resp"
READ_REQ_TOPIC = f"neuron/{NODE}/read/req"
READ_RESP_TOPIC = f"neuron/{NODE}/read/resp"
UPLOAD_DRV_STATE_TOPIC = f"neuron/{NODE}/state/update"


@pytest.fixture(autouse=True, scope="class")
Expand Down Expand Up @@ -204,7 +204,7 @@ def conf_upload_driver_state(conf_base):
return {
**conf_base,
"upload_drv_state": True,
"upload_drv_state_topic": f"/neuron/{NODE}/state/update",
"upload_drv_state_topic": f"neuron/{NODE}/state/update",
"upload_drv_state_interval": 1,
}

Expand Down