/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.github.pires.obd.reader.net;

import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

/**
 * DTO for OBD readings.
 */
public class ObdReading {
  private double latitude, longitude;
  private long timestamp;
  private String vin; // vehicle id
  private Map<String, String> readings;

  public ObdReading(){
    readings = new HashMap<>();
  }

  public ObdReading(double latitude, double longitude, long timestamp,
                    String vin, Map<String, String> readings) {
    this.latitude = latitude;
    this.longitude = longitude;
    this.timestamp = timestamp;
    this.vin = vin;
    this.readings = readings;
  }

  public double getLatitude() {
    return latitude;
  }

  public void setLatitude(double latitude) {
    this.latitude = latitude;
  }

  public double getLongitude() {
    return longitude;
  }

  public void setLongitude(double longitude) {
    this.longitude = longitude;
  }

  public long getTimestamp() {
    return timestamp;
  }

  public void setTimestamp(long timestamp) {
    this.timestamp = timestamp;
  }

  public String getVin() {
    return vin;
  }

  public void setVin(String vin) {
    this.vin = vin;
  }

  public Map<String, String> getReadings() {
    return readings;
  }

  public void setReadings(Map<String, String> readings) {
    this.readings = readings;
  }
  
  public String toString(){

    return "lat:" + latitude + ";" +
            "long:" + longitude + ";" +
            "vin:" + vin + ";" +
            "readings:" + readings.toString().substring(10).replace("}","").replace(",",";");
  }

}
@@ -767,24 +767,34 @@
 e, longitude
+, altitude
 ;%0A  private 
@@ -827,18 +827,24 @@
 String v
-in
+ehicleid
 ; // veh
@@ -1002,24 +1002,41 @@
 e longitude,
+ double altitude,
  long timest
@@ -1068,18 +1068,24 @@
 String v
-in
+ehicleid
 , Map%3CSt
@@ -1168,24 +1168,54 @@
  longitude;%0A
+    this.altitude = altitude;%0A
     this.tim
@@ -1240,32 +1240,44 @@
 ;%0A    this.v
-in = vin
+ehicleid = vehicleid
 ;%0A    this.r
@@ -1431,32 +1431,170 @@
  latitude;%0A  %7D%0A%0A
+  public double getAltitude() %7B%0A    return altitude;%0A  %7D%0A%0A  public void setAltitude(double altitude) %7B%0A    this.altitude = altitude;%0A  %7D%0A%0A
   public double 
@@ -1900,18 +1900,24 @@
 return v
-in
+ehicleid
 ;%0A  %7D%0A%0A 
@@ -1944,18 +1944,24 @@
 String v
-in
+ehicleid
 ) %7B%0A    
@@ -1970,16 +1970,28 @@
 is.v
-in = vin
+ehicleid = vehicleid
 ;%0A  
@@ -2282,19 +2282,69 @@
    %22
-vin:%22 + vin
+alt:%22 + altitude + %22;%22 +%0A            %22vehicleid:%22 + vehicleid
  + %22
@@ -2448,8 +2448,9 @@
 ;%0A  %7D%0A%0A%7D
+%0A

Update ObdReading.java