Skip to content

Commit

Permalink
chore(build): upgrade a library
Browse files Browse the repository at this point in the history
Upgrade the PowerSpy.scala library + update the code in PowerSpyPMeter.scala

chore(README): update README

Update the list of dependencies
  • Loading branch information
mcolmant committed Dec 30, 2014
1 parent 57fc51e commit 8219228
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ We all stand on the shoulders of giants and get by with a little help from our f
* [Akka](http://akka.io) (version 2.3.6 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for asynchronous processing
* [Typesage Config](https://github.com/typesafehub/config) (version 1.2.1 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for reading configuration files.
* [Apache log4j2](http://logging.apache.org/log4j/2.x/) (version 2.1 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for logging outside actors.
* [Bluecove](http://bluecove.org/) (version 2.1.0 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for interfacing the Bluetooth stack in Java (PowerSpy).
* [Bluecove-gpl](http://bluecove.org/bluecove-gpl/) (version 2.1.0 under [GPL licence](http://www.gnu.org/licenses/gpl.html)), for supporting Bluecove on Linux (PowerSpy).
* [powerspy.scala](https://github.com/Spirals-Team/powerspy.scala) (version 1.0.1 under [AGPL license](http://www.gnu.org/licenses/agpl-3.0.html)), for using the [PowerSpy powermeter](http://www.alciom.com/en/products/powerspy2-en-gb-2.html).

# Licence
This software is licensed under the *GNU Affero General Public License*, quoted below.
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ scalaVersion := "2.11.4"
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.3.6",
"com.typesafe" % "config" % "1.2.1",
"fr.inria.powerspy" %% "powerspy-scala" % "1.0.0"
"fr.inria.powerspy" %% "powerspy-scala" % "1.0.1"
)

// Logging
Expand Down
12 changes: 6 additions & 6 deletions src/main/scala/org/powerapi/module/powerspy/PowerSpyPMeter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class PowerSpyPMeter(eventBus: MessageBus) extends ExternalPMeter with Configura

@volatile private var running = true
@volatile private var thread: Option[java.lang.Thread] = None
@volatile private var pSpyOption: Option[PowerSpy] = None
@volatile private var powerspy: Option[PowerSpy] = None

private val log = LogManager.getLogger
lazy val mac = load { _.getString("powerspy.mac") } match {
Expand All @@ -49,11 +49,11 @@ class PowerSpyPMeter(eventBus: MessageBus) extends ExternalPMeter with Configura
}

def init(): Unit = {
pSpyOption = PowerSpy(mac, 3.seconds)
powerspy = PowerSpy.init(mac)
}

def start(): Unit = {
pSpyOption match {
powerspy match {
case Some(pSpy) => {
pSpy.start()

Expand Down Expand Up @@ -83,7 +83,7 @@ class PowerSpyPMeter(eventBus: MessageBus) extends ExternalPMeter with Configura
}

def stop(): Unit = {
pSpyOption match {
powerspy match {
case Some(pSpy) => {
running = false

Expand All @@ -94,11 +94,11 @@ class PowerSpyPMeter(eventBus: MessageBus) extends ExternalPMeter with Configura

pSpy.stopRealTime()
pSpy.stop()
pSpy.connexion.close()
PowerSpy.deinit()

running = true
thread = None
pSpyOption = None
powerspy = None
}
case _ => log.error("Connexion with PowerSpy is not established.")
}
Expand Down

0 comments on commit 8219228

Please sign in to comment.