Skip to content

Commit

Permalink
Merge pull request #11 from ruuvi/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
andreevdenis authored Mar 9, 2022
2 parents 2c920a3 + 76316fd commit 9c03c56
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 161 deletions.
9 changes: 4 additions & 5 deletions bluetooth_library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 30
buildToolsVersion '28.0.3'
buildToolsVersion '30.0.3'

defaultConfig {
minSdkVersion 21
minSdkVersion 23
targetSdkVersion 30
versionCode 10200
versionName "1.2.0"
versionCode 10403
versionName "1.4.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package com.ruuvi.station.bluetooth

class FoundRuuviTag {
var id: String? = null
var url: String? = null
var rssi: Int? = null
var temperature: Double? = null
var humidity: Double? = null
var pressure: Double? = null
var accelX: Double? = null
var accelY: Double? = null
var accelZ: Double? = null
var voltage: Double? = null
var dataFormat: Int? = null
var txPower: Double? = null
var movementCounter: Int? = null
var measurementSequenceNumber: Int? = null
var connectable: Boolean? = null
}
data class FoundRuuviTag (
var id: String? = null,
var url: String? = null,
var rssi: Int? = null,
var temperature: Double? = null,
var humidity: Double? = null,
var pressure: Double? = null,
var accelX: Double? = null,
var accelY: Double? = null,
var accelZ: Double? = null,
var voltage: Double? = null,
var dataFormat: Int? = null,
var txPower: Double? = null,
var movementCounter: Int? = null,
var measurementSequenceNumber: Int? = null,
var connectable: Boolean? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ interface IRuuviGattListener {
fun deviceInfo(model: String, fw: String, canReadLogs: Boolean)
fun dataReady(data: List<LogReading>)
fun heartbeat(raw: String)
}
fun syncProgress(syncedDataPoints: Int)
fun error(errorMessage: String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ interface IRuuviTagScanner {
*/
fun connect(macAddress: String, readLogsFrom: Date?, listener: IRuuviGattListener): Boolean

fun getFwVersion(macAddress: String, listener: IRuuviGattListener): Boolean

/**
* Disconnect from GATT device
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package com.ruuvi.station.bluetooth

import java.util.*

data class LogReading (
var date: Date = Date(),
var id: String = "",
var type: GattReadingType = GattReadingType.ALL,
var humidity: Double? = null,
var temperature: Double = 0.0,
var pressure: Double? = null
)

enum class GattReadingType {
TEMPERATURE, HUMIDITY, PRESSURE, ALL
}

class LogReading {
var date = Date()
var id: String = ""
var type: GattReadingType = GattReadingType.ALL
var humidity = 0.0
var temperature = 0.0
var pressure = 0.0
}
}
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.20'
ext.kotlin_version = '1.5.10'
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:4.2.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -17,7 +17,7 @@ buildscript {

allprojects {
repositories {
jcenter()
mavenCentral()
maven { url "https://www.jitpack.io" }
maven { url "https://maven.google.com" }
google()
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Fri Nov 19 01:22:33 MSK 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading

0 comments on commit 9c03c56

Please sign in to comment.