Bladeren bron

upd

station_14109
altob.rd 8 jaren geleden
bovenliggende
commit
5c2a681e13
2 gewijzigde bestanden met toevoegingen van 14 en 10 verwijderingen
  1. +3
    -3
      controllers/Carpark.php
  2. +11
    -7
      coworker/mqtt_service.php

+ 3
- 3
controllers/Carpark.php Bestand weergeven

@@ -152,12 +152,12 @@ class Carpark extends CI_Controller
{
echo 'ck_error';
exit;
}
}
trigger_error(__FUNCTION__ . "|{$topic}|{$msg}");
if($topic == 'altob.888.mqtt')
{
trigger_error(__FUNCTION__ . "|{$topic}|{$msg}");
// 第一個場站編號 先不管場站
$station_setting = $this->sync_data_model->station_setting_query();
$station_no_arr = explode(SYNC_DELIMITER_ST_NO, $station_setting['station_no']);


+ 11
- 7
coworker/mqtt_service.php Bestand weergeven

@@ -74,12 +74,16 @@ function procmsg($topic, $msg)
{
$data = array('topic' => $topic, 'msg' => $msg, 'ck' => md5($topic.'altob'.$msg));
// dispatch
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
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);
if($topic == 'altob.888.mqtt')
{
// dispatch
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
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);
}
trigger_error("..{$topic}|{$msg}..curl:{$result}..");
}

Laden…
Annuleren
Opslaan