本文整理汇总了PHP中Device::deviceInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Device::deviceInfo方法的具体用法?PHP Device::deviceInfo怎么用?PHP Device::deviceInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Device
的用法示例。
在下文中一共展示了Device::deviceInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
$row = mysqli_fetch_array($res);
$result=$result."\"".$row[1]."\", \"name\": \"".$row[2]."\", \"mode\": [";
$query1="select name, template_alt from modes where template=".$row[3];
$res = mysqli_query($con,$query1) or die("Bad SQL");
$first=true;
while($row = mysqli_fetch_array($res)) {
if(!$first) $result=$result.", ";
$result=$result." { \"name\": \"".$row[0]."\", \"id\": \"".$row[1]."\"}";
$first=false;
}
$result = $result."]}"; */
$result = $device->deviceInfo($jsonObj->id, $jsonString->user);
} elseif ($cmd == 'list') {
$result = $device->listDevice($jsonString->user);
$jsonObject = json_decode($result);
$list = $jsonObject->devicelist;
$result = "{\"devicelist\": [";
$first = true;
foreach ($list as $item) {
if (!$first) {
$result = $result . ", ";
} else {
$first = false;
}
$result = $result . "" . $device->deviceInfo($item->id, $jsonString->user);
}
$result = $result . "]}";
示例2: elseif
} elseif ($cmd == 'read') {
if (isset($jsonString->date)) {
$d = $jsonString->date;
} else {
$d = shell_exec("date \"+%Y%m%d %H:%M:%S\"");
}
$result = $device->read($jsonString->user, $jsonString->device, $d);
} elseif ($cmd == 'getload') {
$result = $device->getload($jsonString->template, $jsonString->unit);
} elseif ($cmd == 'getprofile') {
$result = $device->getprofile($jsonString->deviceid, $jsonString->mode);
} elseif ($cmd == 'getprediction') {
$result = $device->getprediction($jsonString->template, $jsonString->unit);
} elseif ($cmd == 'readinterval') {
$result = $device->readInterval($jsonString->user, $jsonString->device, $jsonString->date1, $jsonString->date2);
} elseif ($cmd == 'info') {
$result = $device->deviceBehaviour($jsonString->device, $jsonString->user);
} elseif ($cmd == 'deviceinfo') {
$result = $device->deviceInfo($jsonString->device, $jsonString->user);
} elseif ($cmd == 'samples') {
$result = $device->samples($jsonString->device, $jsonString->date, $jsonString->template);
} elseif ($cmd == 'set') {
$result = $device->set($jsonString->device, $jsonString->parameters);
} else {
$result = "{'error': 'unsupported command'}";
}
if (isset($_GET['standard'])) {
$result = strtr($result, array("'" => '"'));
}
echo $result;
}