From 8290d53a83a0f02142753870be1b38bf740ff204 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Fri, 15 Apr 2016 02:11:19 -0700 Subject: Fix endianness issue and update build --- README.md | 2 +- .../src/main/twirl/org/mavlink/messages/messages.scala.txt | 5 ++++- project/Build.scala | 4 ++-- project/build.properties | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 48afaf8..88aea9c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ can be guaranteed when generating messages.* Add the following to your plugins: ```scala - addSbtPlugin("com.github.jodersky" % "sbt-mavlink" % "0.5.2")` + addSbtPlugin("com.github.jodersky" % "sbt-mavlink" % "0.6.0")` ``` Enable the plugin diff --git a/mavlink-library/src/main/twirl/org/mavlink/messages/messages.scala.txt b/mavlink-library/src/main/twirl/org/mavlink/messages/messages.scala.txt index 7a60c0a..7290d4c 100644 --- a/mavlink-library/src/main/twirl/org/mavlink/messages/messages.scala.txt +++ b/mavlink-library/src/main/twirl/org/mavlink/messages/messages.scala.txt @@ -2,6 +2,7 @@ package org.mavlink.messages import java.nio.ByteBuffer +import java.nio.ByteOrder import java.nio.charset.Charset @__scalaMessageType(message: Message) = {@StringUtils.Camelify(message.name)} @@ -89,6 +90,7 @@ object Message { */ def unpack(id: Byte, payload: Array[Byte]): Message = { val buffer = ByteBuffer.wrap(payload) + buffer.order(ByteOrder.LITTLE_ENDIAN) id match { @for(__msg <- __messages) { case @__msg.id => @@ -110,6 +112,7 @@ object Message { case m: @__scalaMessageType(__msg) => val arr = new Array[Byte](@__msg.length) val buffer = ByteBuffer.wrap(arr) + buffer.order(ByteOrder.LITTLE_ENDIAN) @for(__field <- __msg.orderedFields) {@__bufferWriteMethod("buffer", "m." + __scalaFieldName(__field), __field.tpe) } @@ -118,4 +121,4 @@ object Message { case u: Unknown => (u.id, u.payload) } -} \ No newline at end of file +} diff --git a/project/Build.scala b/project/Build.scala index 66be73d..e522654 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -8,10 +8,10 @@ import bintray.BintrayPlugin.autoImport._ object ApplicationBuild extends Build { val common = Seq( - scalaVersion := "2.10.5", + scalaVersion := "2.10.6", scalacOptions ++= Seq("-feature", "-deprecation"), organization := "com.github.jodersky", - version := "0.5.2", + version := "0.6.0", licenses := Seq(("LGPL", url("http://opensource.org/licenses/LGPL-3.0"))) ) diff --git a/project/build.properties b/project/build.properties index 176a863..59e7c05 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.9 \ No newline at end of file +sbt.version=0.13.11 \ No newline at end of file -- cgit v1.2.3