BDADDR="xx:xx:xx:xx:xx:xx"
CMD=lscall #수정
PROTOCOL=
URI="$(cd ${0%/*}; pwd)/${0##*/}"
URI="${URI#/ls/}"
OPTF="-f"
OPTN="-n 1"
PRINTONLY=no
PARAM=
param_add()
{
local NEW="\"$1\":$2"
[ -z "$PARAM" ] && PARAM="$NEW" || PARAM="$PARAM,$NEW"
}
param_add_string()
{
local FIRST=$1
shift
param_add $FIRST "\"$*\""
}
lscall()
{
echo "$CMD $OPTF $OPTN $PROTOCOL$URI '{$PARAM}'"
[ $PRINTONLY = yes ] || $CMD $OPTF $OPTN $PROTOCOL$URI '{'$PARAM'}'
}
while [ $# -gt 0 ]; do
case "$1" in
-s) OPTN="-i"
param_add subscribe true ;;
-n) OPTN="-n $2"
shift ;;
-F) OPTF= ;;
-p) PRINTONLY=yes ;;
*) break ;;
esac
shift
done
while [ $# -gt 0 ]; do
case "$1" in
*) break ;;
esac
shift
done