mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-09 10:47:34 +01:00
obuspa: Fix miss-configs caused by uci update
This commit is contained in:
parent
4673347125
commit
b3bdcea137
2 changed files with 36 additions and 2 deletions
|
|
@ -5,7 +5,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=9.0.0.9
|
||||
PKG_VERSION:=9.0.0.10
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ db_set_reset_file()
|
|||
shift
|
||||
value="$*"
|
||||
|
||||
if [ -n "${param}" ] && [ -n "${value}" ]; then
|
||||
if [ -n "${param}" ]; then
|
||||
echo "${param} \"${value}\"">>${RESET_FILE}
|
||||
else
|
||||
echo >>${RESET_FILE}
|
||||
|
|
@ -368,9 +368,21 @@ configure_controller()
|
|||
db_set "${BASEPATH}.MTP.1.Protocol" "${Protocol}"
|
||||
# only support configuration of one mtp path per controller using uci
|
||||
if [ "${Protocol}" = "MQTT" ]; then
|
||||
# Cleanup
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Host" ""
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Path" ""
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Reference" ""
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Destination" ""
|
||||
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Reference" "${dm_ref}"
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Topic" "${Topic}"
|
||||
elif [ "${Protocol}" = "STOMP" ]; then
|
||||
# Cleanup
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Host" ""
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Path" ""
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Reference" ""
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Topic" ""
|
||||
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Reference" "${dm_ref}"
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Destination" "${Destination}"
|
||||
elif [ "${Protocol}" = "CoAP" ]; then
|
||||
|
|
@ -379,6 +391,12 @@ configure_controller()
|
|||
db_set "${BASEPATH}.MTP.1.CoAP.Port" "${Port}"
|
||||
db_set "${BASEPATH}.MTP.1.CoAP.EnableEncryption" "${EnableEncryption}"
|
||||
elif [ "${Protocol}" = "WebSocket" ]; then
|
||||
# Cleanup
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Reference" ""
|
||||
db_set "${BASEPATH}.MTP.1.STOMP.Destination" ""
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Reference" ""
|
||||
db_set "${BASEPATH}.MTP.1.MQTT.Topic" ""
|
||||
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Host" "${Host}"
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Port" "${Port}"
|
||||
db_set "${BASEPATH}.MTP.1.WebSocket.Path" "${Path}"
|
||||
|
|
@ -509,18 +527,34 @@ configure_mtp() {
|
|||
db_set "${BASEPATH}.Enable" "${Enable}"
|
||||
db_set "${BASEPATH}.Protocol" "${Protocol}"
|
||||
if [ "${Protocol}" = "MQTT" ]; then
|
||||
# cleanup
|
||||
db_set "${BASEPATH}.WebSocket.Path" ""
|
||||
db_set "${BASEPATH}.STOMP.Reference" ""
|
||||
db_set "${BASEPATH}.STOMP.Destination" ""
|
||||
|
||||
db_set "${BASEPATH}.MQTT.Reference" "${dm_ref}"
|
||||
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" "${ResponseTopicConfigured}"
|
||||
if [ -n "${PublishQoS}" ]; then
|
||||
db_set "${BASEPATH}.MQTT.PublishQoS" "${PublishQoS}"
|
||||
fi
|
||||
elif [ "${Protocol}" = "STOMP" ]; then
|
||||
# cleanup
|
||||
db_set "${BASEPATH}.WebSocket.Path" ""
|
||||
db_set "${BASEPATH}.MQTT.Reference" ""
|
||||
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" ""
|
||||
|
||||
db_set "${BASEPATH}.STOMP.Reference" "${dm_ref}"
|
||||
db_set "${BASEPATH}.STOMP.Destination" "${Destination}"
|
||||
elif [ "${Protocol}" = "CoAP" ]; then
|
||||
db_set "${BASEPATH}.CoAP.Path" "${Path}"
|
||||
db_set "${BASEPATH}.CoAP.Port" "${Port}"
|
||||
elif [ "${Protocol}" = "WebSocket" ]; then
|
||||
# cleanup
|
||||
db_set "${BASEPATH}.MQTT.Reference" ""
|
||||
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" ""
|
||||
db_set "${BASEPATH}.STOMP.Reference" ""
|
||||
db_set "${BASEPATH}.STOMP.Destination" ""
|
||||
|
||||
db_set "${BASEPATH}.WebSocket.Path" "${Path}"
|
||||
db_set "${BASEPATH}.WebSocket.Port" "${Port}"
|
||||
db_set "${BASEPATH}.WebSocket.EnableEncryption" "${EnableEncryption}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue