APUE Learning Example Source Code
guowenxue
2023-11-06 14bbb45d375b611d19494874996e94aad64cf912
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
 
progname=mosquitto_pub
 
hostname="master.iot-yun.com"
port=10883
uid="lingyun"
pwd="lingyun-emb"
dltopic="\$Sys/Studio/Downlink"
uptopic="\$Sys/Studio/Uplink"
 
pub_downlink_cmd="$progname -h $hostname -p $port -u $uid -P $pwd -t "$dltopic" -m "
pub_uplink_cmd="$progname -h $hostname -p $port -u $uid -P $pwd -t "$uptopic" -m "
 
set -x
 
$pub_downlink_cmd '{"id":"x86host02","camera" :  "on" }'
#sleep 5
 
#$pub_downlink_cmd '{"id":"x86host02","camera" :  "off" }'