altob.rd 8 anni fa
parent
commit
1a346a5ae8
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. +4
    -3
      coworker/mqtt_service.php

+ 4
- 3
coworker/mqtt_service.php Vedi File

@@ -72,6 +72,8 @@ $mqtt->close();

function procmsg($topic, $msg)
{
trigger_error("..{$topic}|{$msg}..");

$data = array('topic' => $topic, 'msg' => $msg, 'ck' => md5($topic.'altob'.$msg));
if(in_array($topic, array('altob.888.mqtt')))
@@ -82,8 +84,7 @@ function procmsg($topic, $msg)
curl_setopt($ch, CURLOPT_POST, true); // 啟用POST
curl_setopt($ch, CURLOPT_URL, 'http://localhost/carpark.html/mqtt_service/');
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$result = curl_exec($ch);
$result = curl_exec($ch);
trigger_error("..curl|{$result}..");
}
trigger_error("..{$topic}|{$msg}..curl:{$result}..");
}

Loading…
Annulla
Salva