/** * Get the measure for the given sensor. Returns false if device not connected. * * @param Sensor $sensor * * @return float */ public function getDeviceMeasure(Sensor $sensor) { $rom = $this->encodeRom($sensor->getRom()); $json_url = $this->arduinoAddress . self::IS_SENSOR_CONNECTED_COMMAND . '/' . $rom; $json = file_get_contents($json_url); $data = json_decode($json); return $data->measure; }