PATH:
var
/
www
/
vhosts
/
sandbox.dos-group.com
/
httpdocs
/
apilora-swisscom
/
web
/
obd
/
controllers
<?php class TestController { public function loraTest($method,$jsonData){ $myfile = fopen("SwisscomData.txt", "a") or die(); $txt = "Arrivato da Swisscom in $method \n"; fwrite($myfile, $txt); try{ fwrite($myfile, json_decode($jsonData,true)['DevEUI_uplink']['payload_hex']); }catch(Exception $exc){ fwrite($myfile, "Errore nel decoding del JSON\n"); } /*try{ $payload = json_decode($jsonData,true)['DevEUI_uplink']['payload_hex']; $lat=substr($payload,20,8); $lon=substr($payload,28,8); $lat= join(array_reverse(str_split($lat,2))); $lon= join(array_reverse(str_split($lon,2))); fwrite($myfile, "LAT: ".hexdec($lat)." LON: ".hexdec($lon)); }catch(Exception $exc){ fwrite($myfile, "Errore nel decoding del JSON\n"); }*/ fwrite($myfile, "\n"); fclose($myfile); } public function obdMethod($method,$jsonData){ $myfile = fopen("ObdData.txt", "a") or die(); $txt = "Arrivato da OBD in $method \n"; $data = $jsonData; fwrite($myfile, $txt); fwrite($myfile, $data); fwrite($myfile, "\n"); fclose($myfile); } public function testMethod($method,Array $args=[]){ return "OBD - Sono il ".__FUNCTION__." del ".__CLASS__." arrivato in ".$method; } }
[+]
..
[-] TestController.php
[open]