diff --git a/usp-js/Makefile b/usp-js/Makefile index feb5440f6..f2064b681 100644 --- a/usp-js/Makefile +++ b/usp-js/Makefile @@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=usp-js -PKG_VERSION:=1.2.1 +PKG_VERSION:=1.2.2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/usp-js.git -PKG_SOURCE_VERSION:=d3fe500133074ac2a2475c4a1b31a28effbc6431 +PKG_SOURCE_VERSION:=80712f48da527a1e524e2d04d40ce5734030483e PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_MIRROR_HASH:=skip @@ -24,6 +24,7 @@ define Package/usp-js CATEGORY:=Libraries TITLE:=A JS library for USP(TR369) protocol DEPENDS:=+quickjs +quickjs-websocket + EXTRA_DEPENDS:=obuspa mosquitto-ssl endef define Package/usp-js/description diff --git a/usp-js/files/etc/uci-defaults/10-add-mosquitto-usptest-config b/usp-js/files/etc/uci-defaults/10-add-mosquitto-usptest-config deleted file mode 100755 index 620b63b6f..000000000 --- a/usp-js/files/etc/uci-defaults/10-add-mosquitto-usptest-config +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh - -if [ ! -f "/etc/config/mosquitto" ]; then - echo "Local mosquitto broker not available" - return 0 -fi - -add_obuspa_config() -{ - if ! uci_get mosquitto obuspa >/dev/null 2>&1; then - uci_add mosquitto listener obuspa - uci_set mosquitto obuspa enabled 1 - uci_set mosquitto obuspa port '1883' - uci_set mosquitto obuspa no_remote_access '1' - uci_set mosquitto obuspa allow_anonymous '1' - fi -} - -uci_load mosquitto -add_obuspa_config diff --git a/usp-js/files/etc/uci-defaults/10-add-obuspa-test-config b/usp-js/files/etc/uci-defaults/10-add-obuspa-test-config index 6a073cc46..0f8d4bf41 100755 --- a/usp-js/files/etc/uci-defaults/10-add-obuspa-test-config +++ b/usp-js/files/etc/uci-defaults/10-add-obuspa-test-config @@ -7,40 +7,52 @@ if [ ! -f "/etc/config/obuspa" ]; then return 0 fi +if [ ! -f "/etc/config/mosquitto" ]; then + echo "Local mosquitto broker not available" + return 0 +fi + add_obuspa_test_mtp() { - if ! uci_get obuspa test_mtp >/dev/null 2>&1; then - uci_add obuspa mtp test_mtp - uci_set obuspa test_mtp Protocol 'MQTT' - uci_set obuspa test_mtp ResponseTopicConfigured '/usp/endpoint' - uci_set obuspa test_mtp mqtt 'testmqtt' - fi + uci_add obuspa mtp test_mtp + uci_set obuspa test_mtp Protocol 'MQTT' + uci_set obuspa test_mtp ResponseTopicConfigured '/usp/endpoint' + uci_set obuspa test_mtp mqtt 'testmqtt' } add_obuspa_test_mqtt() { # Adds Device.MQTT.Client. - if ! uci_get obuspa testmqtt >/dev/null 2>&1; then - uci_add obuspa mqtt testmqtt - uci_set obuspa testmqtt BrokerAddress '127.0.0.1' - uci_set obuspa testmqtt BrokerPort '1883' - uci_set obuspa testmqtt TransportProtocol 'TCP/IP' - fi + uci_add obuspa mqtt testmqtt + uci_set obuspa testmqtt BrokerAddress '127.0.0.1' + uci_set obuspa testmqtt BrokerPort '1883' + uci_set obuspa testmqtt TransportProtocol 'TCP/IP' } add_obuspa_test_controller() { # Adds Device.LocalAgent.Controller. - if ! uci_get obuspa testcontroller >/dev/null 2>&1; then - uci_add obuspa controller testcontroller - uci_set obuspa testcontroller EndpointID 'proto::interop-usp-controller' - uci_set obuspa testcontroller Protocol 'MQTT' - uci_set obuspa testcontroller Topic '/usp/controller' - uci_set obuspa testcontroller mqtt 'testmqtt' - uci_set obuspa testcontroller assigned_role_name 'full_access' - fi + uci_add obuspa controller testcontroller + uci_set obuspa testcontroller EndpointID 'proto::interop-usp-controller' + uci_set obuspa testcontroller Protocol 'MQTT' + uci_set obuspa testcontroller Topic '/usp/controller' + uci_set obuspa testcontroller mqtt 'testmqtt' + uci_set obuspa testcontroller assigned_role_name 'full_access' } +add_obuspa_config() +{ + uci_add mosquitto listener obuspa + uci_set mosquitto obuspa enabled 1 + uci_set mosquitto obuspa port '1883' + uci_set mosquitto obuspa no_remote_access '1' + uci_set mosquitto obuspa allow_anonymous '1' +} + +# Add local controller for usp-js +uci_load mosquitto +add_obuspa_config + uci_load obuspa add_obuspa_test_mtp add_obuspa_test_mqtt