# clear logs, archive
rm logs/g* logs/s*
rm arch/*dat arch/*idx

#############
Starting
#############
# version
gwv

# (re)start Digi daemon
sudo xdigi

# show services
xsvc show

# start shared data server
xsvc start sds -p

# start service broker
xsvc start sbr

# start gateway
xsvc start gw -f qfoce.conf

#############
Logs
#############
# log info
linf -d arch/ -s 2001

# log show
lshow -d arch/ -s 2001
lshow -d arch/ -s 200
lshow -d arch/ -s 3001
# NOTE: output formats 
# may be file driven
lshow -h

#############
Clients 
#############

#### subc ####
# PUB/SUB
# clients subscribe to one 
# or more topics, receive all
# that match requested topic
subc -t /sdata/sbe5
subc -t /data/sbe5
subc -t /data/sbe
subc -t /data/sbe5 -t /data/d

#### sdc ####
# REQ/RES
# clients request a specific topic
# Used by SBE18S to receive
# Tref data provided by SBE52MP
sdc -t /sdata/dcy
sdc -t /sdata/tref

#### gq ####

# general gateway client
# GET, SET, DO
# configuration property indexing, get/set
# manual device actuation
# status info
# dynamic debug output

# indexing
gq -t topics
gq -t topics,/service/id

# service status
gq -q svstat
gq -q svprop

# actuation
gq -d act.dcraft.0.cspeed=100
gq -d act.dcraft.0.cspeed=-100
gq -d act.dcraft.0.cspeed=0

gq -q debug
gq -s debug_level.SBE52MP=INFO
gq -q debug
tail -f logs/gw.out
gq -s debug_level.SBE18S=INFO
gq -s debug_level.SBE18S=DEBUG

xsvc show
xsvc stop gw
less logs/gateway_0000.log 
less logs/gw.out 

#############
Config walk through 
#############

#############
Other utils 
#############

#### moco ####
# src/gateway/apps
# motor control
# [gateway not running]
# uses driver protocol layer

#### gwlog ####
# src/gateway/apps
# stdout, stderr log manager

#### xdigi ####
# src/scripts