|
@@ -87,7 +87,7 @@ function sendConfig($topic,$config)
|
|
|
$res=$mqtt->publish(
|
|
|
$topic,
|
|
|
$config,
|
|
|
- 0
|
|
|
+ 1
|
|
|
);
|
|
|
echo 'publish end'.PHP_EOL;
|
|
|
$mqtt->loop(true,true);
|
|
@@ -125,6 +125,10 @@ while (1) {
|
|
|
$config=[
|
|
|
$data['type']=>$data['config']
|
|
|
];
|
|
|
+ }elseif($data['type']=='get'){
|
|
|
+ $config=[
|
|
|
+ $data['type']=>$data['config']
|
|
|
+ ];
|
|
|
}else{
|
|
|
$config=[
|
|
|
$data['type']=>[
|
|
@@ -136,7 +140,10 @@ while (1) {
|
|
|
$config_json=json_encode($config);
|
|
|
// var_dump($config_json);
|
|
|
$res=sendConfig($topic,$config_json);
|
|
|
- updateSendResult($data['msgid']);
|
|
|
+ if(isset($data['msgid'])){
|
|
|
+ updateSendResult($data['msgid']);
|
|
|
+ }
|
|
|
+
|
|
|
// if($res){
|
|
|
// Db::table('send_config_log')->where('id',$data['msgid'])->update(['result'=>'1']);
|
|
|
// }
|