コード例 #1
0
ファイル: LbsSampleApp.php プロジェクト: akriot/iot
 }
 $con->mysqlclose();
 $data3 = array();
 foreach ($data2 as $key => $value) {
     $log = new KLogger("lbs_debug.log", KLogger::DEBUG);
     $subscriberId = "tel:" . $value;
     $log->LogDebug("Received msisdn = " . $subscriberId);
     $LBS_QUERY_SERVER_URL = 'http://127.0.0.1:7000/lbs/locate';
     $APP_ID = "APP_001768";
     $PASSWORD = "******";
     $SERVICE_TYPE = "IMMEDIATE";
     $FRESHNESS = "HIGH";
     $HORIZONTAL_ACCURACY = "1500";
     $RESPONSE_TIME = "NO_DELAY";
     $request = new LbsRequest($LBS_QUERY_SERVER_URL);
     $request->setAppId($APP_ID);
     $request->setAppPassword($PASSWORD);
     $request->setSubscriberId($subscriberId);
     $request->setServiceType($SERVICE_TYPE);
     $request->setFreshness($FRESHNESS);
     $request->setHorizontalAccuracy($HORIZONTAL_ACCURACY);
     $request->setResponseTime($RESPONSE_TIME);
     function getModifiedTimeStamp($timeStamp)
     {
         try {
             $date = new DateTime($timeStamp, new DateTimeZone('Asia/Colombo'));
         } catch (Exception $e) {
             echo $e->getMessage();
             exit(1);
         }
         return $date->format('Y-m-d H:i:s');
コード例 #2
0
ファイル: main.php プロジェクト: sjohnkennedy/Friendstr
function getLoc($url, $info, $subId)
{
    $locationReq = new LbsRequest($url);
    $locationReq->setAppId($info["appId"]);
    $locationReq->setAppPassword($info["password"]);
    $locationReq->setSubscriberId($subId);
    $locationReq->setServiceType($info["serviceType"]);
    $locationReq->setFreshness($info["freshness"]);
    $locationReq->setHorizontalAccuracy($info["hAccuracy"]);
    $locationReq->setResponseTime($info["responseTime"]);
    $lbsClient = new LbsClient();
    $lbsResponse = new LbsResponse($lbsClient->getResponse($locationReq));
    $lbsResponse->setTimeStamp(getModifiedTimeStamp($lbsResponse->getTimeStamp()));
    return $lbsResponse;
}