#!/bin/sh
set -e

CPU="x86_64"
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")     # path where this script is located in

#SNAP7_PATH=${SCRIPTPATH}/../../../git/snap7/snap7-full/build/bin/${CPU}-linux #local
SNAP7_PATH=${SCRIPTPATH}/../../../snap7/2.0.0/bin/${CPU}-linux

#BINARY="${SCRIPTPATH}/../build/bin/${CPU}/silecs-cli-client" #local
BINARY="${SCRIPTPATH}/../bin/${CPU}/silecs-cli-client"

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP7_PATH
echo "##### LD_LIBRARY_PATH: ###################################################################################"
echo "$LD_LIBRARY_PATH"
echo "##########################################################################################################"
echo ""

PARAM_FILE=/common/home/bel/schwinn/lnx/workspace-silecs-neon/SiemensTestDU/generated/client/tsts7001.silecsparam
DEVICE=MyDevice1

# config for SiemensTestDU
ARGUMENTS="-f $PARAM_FILE -d $DEVICE -m GET_DEVICE"
COMMAND="$BINARY $ARGUMENTS"
$COMMAND

