From b5c95cf683a396f1b8dbd0f3edd093f2f1edf838 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Thu, 16 Nov 2017 17:38:26 +0100 Subject: [PATCH] afm-util/install: use of web socket connection MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I8bda689a377d676c4b190e1b54cdc115006c9829 Signed-off-by: José Bollo --- scripts/CMakeLists.txt | 1 + scripts/afm-debug | 0 scripts/afm-install | 1 + scripts/afm-util | 30 ++---------------------------- 4 files changed, 4 insertions(+), 28 deletions(-) mode change 100644 => 100755 scripts/afm-debug create mode 120000 scripts/afm-install diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index bf0846c..e0f80ac 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -20,6 +20,7 @@ cmake_minimum_required(VERSION 2.8) if(NOT USE_SDK) install(PROGRAMS afm-util DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(PROGRAMS afm-install DESTINATION ${CMAKE_INSTALL_BINDIR}) if(AGL_DEVEL) install(PROGRAMS afm-debug DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/scripts/afm-debug b/scripts/afm-debug old mode 100644 new mode 100755 diff --git a/scripts/afm-install b/scripts/afm-install new file mode 120000 index 0000000..5bde063 --- /dev/null +++ b/scripts/afm-install @@ -0,0 +1 @@ +afm-util \ No newline at end of file diff --git a/scripts/afm-util b/scripts/afm-util index bbab51b..4d86218 100755 --- a/scripts/afm-util +++ b/scripts/afm-util @@ -1,34 +1,8 @@ #!/bin/bash -if [ "x" = "x${DBUS_SESSION_BUS_ADDRESS}" ]; then - DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus" -fi -export DBUS_SESSION_BUS_ADDRESS - -pretty() { - sed ' /^method return .*/d - s/^Error org.freedesktop.DBus.Error.Failed: "\?\(.*\)"\?$/ERROR: \1/ - s/^ string "\(.*\)"/\1/ - s:[[{,]:&\n:g - s: *[]}]:\n&:g - ' | - sed ' s:^ *:: - s: *$:: - /[]}],*$/ {x;s:...::;x} - G - /[[{]\n/ {x;s:$: :;x} - s:^\(.*[^\n]\)\n\( *\)$:\2\1: - ' -} - send() { - dbus-send --session --print-reply \ - --dest=org.AGL.afm.user \ - /org/AGL/afm/user \ - org.AGL.afm.user.$1 \ - "string:$2" | - pretty - return ${PIPESTATUS[0]} + afb-client-demo -H -d unix:/run/afm/apis/ws/afm-main "$1" "$2" | + awk '$1=="ON-REPLY-FAIL"{$1="ERROR:";$2="";print;exit 1;}NR>1' } case "$1" in -- 2.16.6