wuwei
2025-06-13 e8c9c0ca7e6c307243c158fd529c59c5a3717f2f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# 查询-所有设备列表 包括串口设备、扩展设备、网口设备
echo -en "Content-type: text/html; charset=utf-8\n\n"
#*****************************************************
source ../bin/env.sh
 
jsoner="../bin/jsoner"
 
 
read json
 
echo $json > log
 
arg=`echo "$json" |tr -d ' '`
 
#echo $arg >> log
 
debug=`$jsoner $arg debug`
 
type=`$jsoner $arg type`
ip=`$jsoner $arg ip`
port=`$jsoner $arg port`
ver=`$jsoner $arg ver`
addr=`$jsoner $arg addr`
funCode=`$jsoner $arg funCode`
starReg=`$jsoner $arg starReg`
regCnt=`$jsoner $arg regCnt`
cid1=`$jsoner $arg cid1`
cid2=`$jsoner $arg cid2`
data=`$jsoner $arg data`
oid=`$jsoner $arg oid`
community=`$jsoner $arg community`
 
 
case "$debug" in 
modbus)
content=`msg modbus $type $ip $port $addr $funCode $starReg $regCnt`;;
powerbus)
content=`msg powerbus $type $ip $port $ver $addr $cid1 $cid2 $data`;;
string)
content=`msg string $type $ip $port $data`;;
snmp)
content=`msg snmp $ver $ip $oid $port $community`;;
esac
 
#echo $content
 
tmp=${content##*'{'}
 
echo "{$tmp" |tr -d '\n'