Example #1
0
 /**
  * parse one line and create Wifi object
  * @param string $line
  * @return Wifi
  */
 private function parseLine($line)
 {
     $wifi = new Wifi();
     $array = explode("\t", $line);
     $wifi->setMac($array[0]);
     $wifi->setSsid($array[1]);
     $wifi->setSec(intval($array[2]));
     $wifi->setLatitude(doubleval($array[3]));
     $wifi->setLongitude(doubleval($array[4]));
     $wifi->setAltitude(doubleval($array[5]));
     $wifi->setSource(self::ID_SOURCE);
     return $wifi;
 }
Example #2
0
 /**
  * @param array $line
  * @return Wifi
  */
 public function parseLine($line)
 {
     $wifi = new Wifi();
     $wifi->setMac(MyUtils::macSeparator2Colon($line['netid']));
     $wifi->setSsid($line['ssid'] ? $line['ssid'] : "");
     $wifi->setComment(trim($line['comment']));
     $wifi->setName(trim($line['name']));
     $wifi->setType($line['type']);
     $wifi->setFreenet($line['freenet']);
     $wifi->setPaynet($line['paynet']);
     $wifi->setFirsttime(new DateTime($line['firsttime']));
     $wifi->setLasttime(new DateTime($line['lasttime']));
     $wifi->setFlags($line['flags']);
     $wifi->setWep($line['wep']);
     $wifi->setLatitude((double) $line['trilat']);
     $wifi->setLongitude((double) $line['trilong']);
     $wifi->setLastupdt($line['lastupdt']);
     $wifi->setChannel((int) $line['channel']);
     $wifi->setBcninterval($line['bcninterval']);
     $wifi->setQos((int) $line['qos']);
     $wifi->setSource(self::ID_SOURCE);
     return $wifi;
 }