当前位置: 首页>>代码示例>>PHP>>正文


PHP Device::deviceInfo方法代码示例

本文整理汇总了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 . "]}";
开发者ID:UbiCollab,项目名称:PersuasiveCommunities,代码行数:31,代码来源:prototype.php

示例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;
}
开发者ID:UbiCollab,项目名称:PersuasiveCommunities,代码行数:31,代码来源:device.php


注:本文中的Device::deviceInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。