From e12552c7d47919d030f72f6ca30a10eb44e688e8 Mon Sep 17 00:00:00 2001 From: Sune Jakobsson Date: Fri, 7 Mar 2014 16:46:17 +0100 Subject: [PATCH 1/7] Updated a couple of the libraries for their last official versions --- README.md | 22 ++++++++++++++-------- nbproject/project.properties | 4 ++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5839085..5d203f8 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Use these programs at your own risk. The authors do not guaranteed the proper fu #Contributors [Joe Pasqua](https://github.com/jpasqua) +[Sune Jakobsson](https://github.com/sunejak) #Preparing your build environment @@ -30,14 +31,14 @@ This project assumes a directory structure that looks like this: src ThirdParty -- A repository for third party library dependencies apache - commons-codec-1.8 - commons-lang3-3.1 + commons-codec-1.9 + commons-lang3-3.3 commons-logging-1.1.3 geocoder google-gson-2.2.4 resty -The Tesla/Tesla directory corrsponds to this github project (TeslaClient.git). +The Tesla/TeslaClient directory corresponds to this github project (TeslaClient.git). The following commands will create and populate the hierarchy. It assumes that: @@ -56,13 +57,13 @@ Be sure to either set these variables or adapt the commands below: # Download the apache libraries cd ThirdParty/apache - curl -s -O http://www.eng.lsu.edu/mirrors/apache//commons/codec/binaries/commons-codec-1.8-bin.zip - unzip commons-codec-1.8-bin.zip + wget http://www.us.apache.org/dist//commons/codec/binaries/commons-codec-1.9-bin.zip + unzip commons-codec-1.9-bin.zip - curl -s -O http://mirror.cc.columbia.edu/pub/software/apache//commons/lang/binaries/commons-lang3-3.1-bin.zip - unzip commons-lang3-3.1-bin.zip + wget http://www.us.apache.org/dist//commons/lang/binaries/commons-lang3-3.3-bin.zip + unzip commons-lang3-3.3-bin.zip - curl -s -O http://apache.mirrors.hoobly.com//commons/logging/binaries/commons-logging-1.1.3-bin.zip + wget http://www.us.apache.org/dist//commons/logging/binaries/commons-logging-1.1.3-bin.zip unzip commons-logging-1.1.3-bin.zip rm *.zip @@ -79,6 +80,11 @@ Be sure to either set these variables or adapt the commands below: # Download the resty library cd resty curl -s -O http://repo2.maven.org/maven2/us/monoid/web/resty/0.3.2/resty-0.3.2.jar + cd .. + + # Create the library + cd Tesla/TeslaClient + ant #Tests and Samples There are two test programs included in the project: BasicTest and Interactive. The former simply runs through a sequence of functions in the client library to demonstrate that it is connecting and working. The second presents an interactive shell that allows the user to issue the various commands that are available through the client library. diff --git a/nbproject/project.properties b/nbproject/project.properties index 81355e4..3bb7e10 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -27,8 +27,8 @@ dist.jar=${dist.dir}/TeslaClient.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= -file.reference.commons-codec-1.8.jar=../../ThirdParty/apache/commons-codec-1.8/commons-codec-1.8.jar -file.reference.commons-lang3-3.1.jar=../../ThirdParty/apache/commons-lang3-3.1/commons-lang3-3.1.jar +file.reference.commons-codec-1.8.jar=../../ThirdParty/apache/commons-codec-1.9/commons-codec-1.9.jar +file.reference.commons-lang3-3.1.jar=../../ThirdParty/apache/commons-lang3-3.3/commons-lang3-3.3.jar file.reference.commons-logging-1.1.3.jar=../../ThirdParty/apache/commons-logging-1.1.3/commons-logging-1.1.3.jar file.reference.commons-logging-api-1.1.3.jar=../../ThirdParty/apache/commons-logging-1.1.3/commons-logging-api-1.1.3.jar file.reference.geocoder-java-0.15.jar=../../ThirdParty/geocoder-java/geocoder-java-0.15.jar From 7efcf67dcf9c4ab8241a7d07335736b875022ed4 Mon Sep 17 00:00:00 2001 From: Sune Jakobsson Date: Fri, 7 Mar 2014 19:09:52 +0100 Subject: [PATCH 2/7] Formatting --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5d203f8..7cfe1cf 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ This software and documentation do not come from Tesla Motors Inc. Use these programs at your own risk. The authors do not guaranteed the proper functioning of these applications. This code attempts to use the same interfaces used by the official Tesla phone apps. However, it is possible that use of this code may cause unexpected damage for which nobody but you are responsible. Use of these functions can change the settings on your car and may have negative consequences such as (but not limited to) unlocking the doors, opening the sun roof, or reducing the available charge in the battery. #Contributors -[Joe Pasqua](https://github.com/jpasqua) -[Sune Jakobsson](https://github.com/sunejak) +Joe Pasqua (https://github.com/jpasqua ): Author +Sune Jakobsson (https://github.com/sunejak ): Bug Fixes #Preparing your build environment From 41b8efb04085f9ef8c21c9d571d22199761ff80a Mon Sep 17 00:00:00 2001 From: Sune Jakobsson Date: Fri, 7 Mar 2014 20:44:15 +0100 Subject: [PATCH 3/7] Fixed ant script, updated documentation and improved test results --- README.md | 8 ++++++-- nbproject/build-impl.xml | 4 +++- src/org/noroomattheinn/tesla/SnapshotState.java | 10 +++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7cfe1cf..a5e31f6 100644 --- a/README.md +++ b/README.md @@ -82,9 +82,13 @@ Be sure to either set these variables or adapt the commands below: curl -s -O http://repo2.maven.org/maven2/us/monoid/web/resty/0.3.2/resty-0.3.2.jar cd .. - # Create the library + # Create the library and test your car cd Tesla/TeslaClient - ant + ant run -Darg0=username -Darg1=password + + # Consequent runs ( with the credential stored in cookies.txt ) + + ant run #Tests and Samples There are two test programs included in the project: BasicTest and Interactive. The former simply runs through a sequence of functions in the client library to demonstrate that it is connecting and working. The second presents an interactive shell that allows the user to issue the various commands that are available through the client library. diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 0250cb6..563a4bd 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -1166,6 +1166,8 @@ is divided into following sections: + + Must select one file in the IDE or set run.class @@ -1181,7 +1183,7 @@ is divided into following sections: Must select one file in the IDE or set run.class - + Must select one file in the IDE or set applet.url diff --git a/src/org/noroomattheinn/tesla/SnapshotState.java b/src/org/noroomattheinn/tesla/SnapshotState.java index b87ed7e..f0bd111 100644 --- a/src/org/noroomattheinn/tesla/SnapshotState.java +++ b/src/org/noroomattheinn/tesla/SnapshotState.java @@ -118,11 +118,11 @@ public boolean refreshFromStream() { if (state == null) return "[ ]"; return String.format( "Time Stamp: %s (%s)\n" + - "Speed: %3.1f\n" + + "Speed: %3.1f miles\n" + "Location: [(Lat: %f, Lng: %3f), Heading: %d, Elevation: %d]\n" + - "Charge Info: [SoC: %d, Power: %d]\n" + - "Odometer: %7.1f\n" + - "Range: %d\n", + "Charge Info: [SoC: %d KW, Power: %d KW]\n" + + "Odometer: %7.1f miles\n" + + "Range: %d miles\n", state.vehicleTimestamp, new Date(state.vehicleTimestamp), state.speed, state.estLat, state.estLng, state.estHeading, state.elevation, @@ -314,4 +314,4 @@ public State(SnapshotState ss) { estRange = ss.getInteger(Keys.est_range); } } -} \ No newline at end of file +} From 827d9d3189331ca553aff75fc959e84f09f5e575 Mon Sep 17 00:00:00 2001 From: Sune Jakobsson Date: Wed, 24 Jun 2015 09:03:12 +0200 Subject: [PATCH 4/7] version cleanup --- README.md | 8 +++++--- nbproject/project.properties | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c0415ce..d02bb63 100644 --- a/README.md +++ b/README.md @@ -71,15 +71,15 @@ Be sure to either set these variables or adapt the commands below: # Download the apache libraries cd $ROOT/ThirdParty/apache - curl -s -O http://www.eng.lsu.edu/mirrors/apache/commons/codec/binaries/commons-codec-1.10-bin.zip + wget http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.10-bin.zip unzip commons-codec-1.10-bin.zip rm commons-codec-1.10-bin.zip - curl -s -O http://mirror.cc.columbia.edu/pub/software/apache//commons/lang/binaries/commons-lang3-3.3.2-bin.zip + wget http://archive.apache.org/dist/commons/lang/binaries/commons-lang3-3.3.2-bin.zip unzip commons-lang3-3.3.2-bin.zip rm commons-lang3-3.3.2-bin.zip - curl -s -O http://apache.mirrors.hoobly.com//commons/logging/binaries/commons-logging-1.1.3-bin.zip + wget http://archive.apache.org/dist/commons/logging/binaries/commons-logging-1.1.3-bin.zip unzip commons-logging-1.1.3-bin.zip rm commons-logging-1.1.3-bin.zip @@ -102,3 +102,5 @@ Be sure to either set these variables or adapt the commands below: There are two test programs included in the project: BasicTest and Interactive. The former simply runs through a sequence of functions in the client library to demonstrate that it is connecting and working. The second presents an interactive shell that allows the user to issue the various commands that are available through the client library. To use either of these programs you must have active credentials for a Tesla vehicle that has remote access enabled. If you have more than one vehicle, you may select which vehicle to use in the Interactive program. BasicTest will always use the first vehicle returned by the Tesla portal. + +To compile and run directly use: ant -Dapplication.args="userName passWord" run \ No newline at end of file diff --git a/nbproject/project.properties b/nbproject/project.properties index 426c518..69fa14c 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -27,9 +27,9 @@ dist.jar=${dist.dir}/TeslaClient.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= -file.reference.commons-codec-1.8.jar=../../ThirdParty/apache/commons-codec-1.8/commons-codec-1.8.jar +file.reference.commons-codec-1.10.jar=../../ThirdParty/apache/commons-codec-1.10/commons-codec-1.10.jar file.reference.commons-io-2.4.jar=../../ThirdParty/apache/commons-io-2.4/commons-io-2.4.jar -file.reference.commons-lang3-3.1.jar=../../ThirdParty/apache/commons-lang3-3.1/commons-lang3-3.1.jar +file.reference.commons-lang3-3.3.2.jar=../../ThirdParty/apache/commons-lang3-3.3.2/commons-lang3-3.3.2.jar file.reference.commons-logging-1.1.3.jar=../../ThirdParty/apache/commons-logging-1.1.3/commons-logging-1.1.3.jar file.reference.commons-logging-api-1.1.3.jar=../../ThirdParty/apache/commons-logging-1.1.3/commons-logging-api-1.1.3.jar file.reference.geocoder-java-0.15.jar=../../ThirdParty/geocoder-java/geocoder-java-0.15.jar @@ -38,8 +38,8 @@ file.reference.resty-0.3.2.jar=../../ThirdParty/resty/resty-0.3.2.jar includes=** jar.compress=false javac.classpath=\ - ${file.reference.commons-codec-1.8.jar}:\ - ${file.reference.commons-lang3-3.1.jar}:\ + ${file.reference.commons-codec-1.10.jar}:\ + ${file.reference.commons-lang3-3.3.2.jar}:\ ${file.reference.commons-logging-1.1.3.jar}:\ ${file.reference.commons-logging-api-1.1.3.jar}:\ ${file.reference.geocoder-java-0.15.jar}:\ From 73425c027c90c492190ae661c0a5f6d2f4ee1b62 Mon Sep 17 00:00:00 2001 From: Sune Jakobsson Date: Wed, 24 Jun 2015 09:13:24 +0200 Subject: [PATCH 5/7] formatting --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d02bb63..93c163c 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Use these programs at your own risk. The authors do not guaranteed the proper fu [Greyson Fischer](https://github.com/greyson) +[Sune Jakobsson](https://github.com/greyson) + # Preparing your build environment (gradle) The following command will resolve and download all dependencies, set @@ -103,4 +105,4 @@ There are two test programs included in the project: BasicTest and To use either of these programs you must have active credentials for a Tesla vehicle that has remote access enabled. If you have more than one vehicle, you may select which vehicle to use in the Interactive program. BasicTest will always use the first vehicle returned by the Tesla portal. -To compile and run directly use: ant -Dapplication.args="userName passWord" run \ No newline at end of file + To compile and run directly use: ant -Dapplication.args="userName passWord" run \ No newline at end of file From 4489502cd6dd68d19061c3f6e80abc30386908ff Mon Sep 17 00:00:00 2001 From: Sune Jakobsson Date: Wed, 24 Jun 2015 09:14:56 +0200 Subject: [PATCH 6/7] and some more formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 93c163c..5fdcfda 100644 --- a/README.md +++ b/README.md @@ -105,4 +105,4 @@ There are two test programs included in the project: BasicTest and To use either of these programs you must have active credentials for a Tesla vehicle that has remote access enabled. If you have more than one vehicle, you may select which vehicle to use in the Interactive program. BasicTest will always use the first vehicle returned by the Tesla portal. - To compile and run directly use: ant -Dapplication.args="userName passWord" run \ No newline at end of file + To compile and run BasicTest directly use: ant -Dapplication.args="userName passWord" run \ No newline at end of file From 60af0a012ad01539e8b0c8279e2c76ad39b63b8c Mon Sep 17 00:00:00 2001 From: Sune Jakobsson Date: Wed, 24 Jun 2015 09:15:42 +0200 Subject: [PATCH 7/7] and some more formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5fdcfda..042830d 100644 --- a/README.md +++ b/README.md @@ -105,4 +105,4 @@ There are two test programs included in the project: BasicTest and To use either of these programs you must have active credentials for a Tesla vehicle that has remote access enabled. If you have more than one vehicle, you may select which vehicle to use in the Interactive program. BasicTest will always use the first vehicle returned by the Tesla portal. - To compile and run BasicTest directly use: ant -Dapplication.args="userName passWord" run \ No newline at end of file + To compile and run "BasicTest" directly use: ant -Dapplication.args="userName passWord" run \ No newline at end of file