Skip to content

Commit

Permalink
Merge pull request #43 from RADAR-CNS/v0.2-alpha.1_release
Browse files Browse the repository at this point in the history
V0.2 alpha.1 release
  • Loading branch information
blootsvoets committed Jul 19, 2017
2 parents 47338b3 + f058f25 commit 207932e
Show file tree
Hide file tree
Showing 47 changed files with 439 additions and 147 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ deploy:
provider: releases
api_key: ${GH_TOKEN}
file_glob: true
file: "${TRAVIS_BUILD_DIR}/java-sdk/build/libs/*.jar"
file: "*/build/libs/*.jar"
skip_cleanup: true
on:
tags: true

before_install:
- cd java-sdk

before_deploy:
- pwd

after_deploy:
- ./gradlew bintrayUpload
4 changes: 2 additions & 2 deletions commons/biovotion/biovotion_vsm_battery_state.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "batteryLevel", "type": "float", "doc": "battery level (0-1)"},
{"name": "batteryChargeRate", "type": "float", "doc": "battery charge rate (0-1)"},
{"name": "batteryChargeRate", "type": "float", "doc": "battery charge rate, level change per hour (0-1)"},
{"name": "batteryVoltage", "type": "float", "doc": "battery voltage (V)"},
{"name": "batteryStatus", "type": "float", "doc": "battery status"}
{"name": "batteryStatus", "type": "float", "doc": "battery status; 0:not charging, not on charger; 2:not charging, on charger; 3:charging, on charger"}
]
}
14 changes: 14 additions & 0 deletions commons/biovotion/biovotion_vsm_led_current.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"namespace": "org.radarcns.biovotion",
"type": "record",
"name": "BiovotionVSMLedCurrent",
"doc": "Applied current for red, green and ir leds.",
"fields": [
{"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "red", "type": "float", "doc": "current for red LED (mA)"},
{"name": "green", "type": "float", "doc": "current for green LED (mA)"},
{"name": "ir", "type": "float", "doc": "current for IR LED (mA)"},
{"name": "offset", "type": "float", "doc": "current offset (mA)"}
]
}
14 changes: 14 additions & 0 deletions commons/biovotion/biovotion_vsm_ppg_raw.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"namespace": "org.radarcns.biovotion",
"type": "record",
"name": "BiovotionVSMPhotoRaw",
"doc": "Raw 14bit Photodiode ADC data for red, green, IR and dark portions (PPG raw data).",
"fields": [
{"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "red", "type": "float", "doc": "raw red light ADC response (normalized)"},
{"name": "green", "type": "float", "doc": "raw green light ADC response (normalized)"},
{"name": "ir", "type": "float", "doc": "raw IR light ADC response (normalized)"},
{"name": "dark", "type": "float", "doc": "raw dark light ADC response (normalized)"}
]
}
6 changes: 3 additions & 3 deletions commons/biovotion/biovotion_vsm_temperature.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"namespace": "org.radarcns.biovotion",
"type": "record",
"name": "BiovotionVSMTemperature",
"doc": "Data from temperature sensor expressed degrees on the Celsius (°C) scale.",
"doc": "Data from temperature sensor expressed in degrees on the Celsius (°C) scale.",
"fields": [
{"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "temperature", "type": "float", "doc": "local temperature (°C)"},
{"name": "temperatureObject", "type": "float", "doc": "object temperature (°C)"},
{"name": "temperature", "type": "float", "doc": "skin temperature (°C)"},
{"name": "temperatureLocal", "type": "float", "doc": "device (board) temperature (°C)"},
{"name": "temperatureBarometer", "type": "float", "doc": "barometer temperature (°C)"}
]
}
4 changes: 2 additions & 2 deletions commons/key/windowed_key.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"name": "WindowedKey",
"doc": "Windowed key in the RADAR-CNS project",
"fields": [
{"name": "userID", "type": "string"},
{"name": "sourceID", "type": "string"},
{"name": "userId", "type": "string"},
{"name": "sourceId", "type": "string"},
{"name": "start", "type": "long"},
{"name": "end", "type": "long"}
]
Expand Down
7 changes: 5 additions & 2 deletions commons/phone/phone_call.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "duration", "type": "float", "doc": "duration of the call (s)", "default": "NaN"},
{"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the call. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null},
{"name": "type", "type": {"name": "PhoneCallType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "MISSED", "VOICEMAIL", "UNKNOWN"]}, "doc": "direction of phone call", "default": "UNKNOWN"}
{"name": "type", "type": {"name": "PhoneCallType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "MISSED", "VOICEMAIL", "UNKNOWN"]}, "doc": "direction of phone call", "default": "UNKNOWN"},
{"name": "targetIsContact", "type": ["null","boolean"], "doc": "call to/from a known contact, null if unknown", "default": null},
{"name": "targetIsNonNumeric", "type": "boolean", "doc": "sms sender ID is replaced by text, e.g. a company name", "default": false},
{"name": "targetLength", "type": "int", "doc": "length of the target phone number, -1 if not collected.", "default": -1}
]
}
}
13 changes: 13 additions & 0 deletions commons/phone/phone_gyroscope.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"namespace": "org.radarcns.phone",
"type": "record",
"name": "PhoneGyroscope",
"doc": "Data from the 3-axis gyroscope.",
"fields": [
{"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "x", "type": "float", "doc": "gyration in the x-axis (rad/s)"},
{"name": "y", "type": "float", "doc": "gyration in the y-axis (rad/s)"},
{"name": "z", "type": "float", "doc": "gyration in the z-axis (rad/s)"}
]
}
13 changes: 13 additions & 0 deletions commons/phone/phone_magnetic_field.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"namespace": "org.radarcns.phone",
"type": "record",
"name": "PhoneMagneticField",
"doc": "Data from the 3-axis magnetometer.",
"fields": [
{"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "x", "type": "float", "doc": "magnetic field in the x-axis (μT)"},
{"name": "y", "type": "float", "doc": "magnetic field in the y-axis (μT)"},
{"name": "z", "type": "float", "doc": "magnetic field in the z-axis (μT)"}
]
}
7 changes: 5 additions & 2 deletions commons/phone/phone_sms.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the SMS. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null},
{"name": "type", "type": {"name": "PhoneSmsType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "OTHER", "UNKNOWN"]}, "doc": "direction of the SMS", "default": "UNKNOWN"},
{"name": "length", "type": "int", "doc": "number of characters in the message (-1 if unknown)", "default": -1}
{"name": "length", "type": ["null","int"], "doc": "number of characters in the message (null if unknown)", "default": null},
{"name": "targetIsContact", "type": ["null","boolean"], "doc": "sms sender is a known contact, null if unknown", "default": null},
{"name": "targetIsNonNumeric", "type": "boolean", "doc": "sms sender ID is replaced by text, e.g. a company name", "default": false},
{"name": "targetLength", "type": "int", "doc": "length of the target phone number, -1 if not collected.", "default": -1}
]
}
}
11 changes: 11 additions & 0 deletions commons/phone/phone_sms_unread.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"namespace": "org.radarcns.phone",
"type": "record",
"name": "PhoneSmsUnread",
"doc": "Number of SMS messages in the inbox that have an unread status.",
"fields": [
{"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "unreadSMS", "type": "int", "doc": "number of unread SMS messages currently in the inbox"}
]
}
11 changes: 11 additions & 0 deletions commons/phone/phone_step_count.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"namespace": "org.radarcns.phone",
"type": "record",
"name": "PhoneStepCount",
"doc": "Data from the step counter.",
"fields": [
{"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "steps", "type": "int", "doc": "number of steps taken between this and the previous record"}
]
}
16 changes: 16 additions & 0 deletions commons/phone/phone_usage_event.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"namespace": "org.radarcns.phone",
"type": "record",
"name": "PhoneUsageEvent",
"doc": "Event for closing or opening an app",
"fields": [
{"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "packageName", "type": "string", "doc": "package name of the launched app"},
{"name": "categoryName", "type": ["null", "string"], "doc": "app category as given by the play store, null if a category is not listed or unable to be fetched", "default": null},
{"name": "categoryNameFetchTime", "type": ["null", "double"], "doc": "timestamp in UTC when the category was attempted to fetch from the play store (s), null if not fetched", "default": null},
{"name": "eventType", "type":
{"name": "UsageEventType", "type": "enum", "symbols": ["FOREGROUND", "BACKGROUND", "CONFIG", "SHORTCUT", "INTERACTION", "NONE"]},
"doc": "whether the event brought app to foreground or background or neither", "default": "NONE"}
]
}
4 changes: 2 additions & 2 deletions commons/phone/phone_user_interaction.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"fields": [
{"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},
{"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"},
{"name": "lockState", "type": {"name": "PhoneLockState", "type": "enum", "symbols": ["STANDBY", "UNLOCKED"]}, "doc": "what lock state the phone has"}
{"name": "interactionState", "type": {"name": "PhoneInteractionState", "type": "enum", "symbols": ["STANDBY", "UNLOCKED","SHUTDOWN","BOOTED"]}, "doc": "what interaction state the phone has"}
]
}
}
28 changes: 28 additions & 0 deletions commons/questionnaire/questionnaire.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"namespace": "org.radarcns.questionnaire",
"type": "record",
"name": "Questionnaire",
"doc": "General schema for questionnaire. Check the specification folder to see how the questionnaire has been defined. For each QuestionnaireType there is a JSON file reporting the questions set and possible answers if available",
"fields": [
{ "name": "time", "type": "double", "doc": "timestamp in UTC (s) when the questionnaire is submitted to the subject" },
{ "name": "timeCompleted", "type": "double", "doc": "timestamp in UTC (s) when subject marks the questionnaire as" },
{ "name": "name", "type": {"name": "QuestionnaireType", "type": "enum", "symbols": ["PHQ8", "ESM", "UNKNOWN"]}, "doc": "Questionnaire names", "default": "UNKNOWN" },
{ "name": "version", "type": "string", "doc": "It reports the questionnaire version stated in the JSON specification" },
{ "name": "answers",
"type": {
"type": "array",
"items": {
"name": "Answer",
"type": "record",
"doc": "Questionnaire answer",
"fields": [
{ "name": "value", "type": ["int", "string", "double"], "doc": "Subject answer" },
{ "name": "startTime", "type": "double", "doc": "timestamp in UTC (s) when the question is shown" },
{ "name": "endTime", "type": "double", "doc": "timestamp in UTC (s) when the question is answered" }
]
}
},
"doc": "Answers list. The answers order must follow the questions order"
}
]
}
2 changes: 1 addition & 1 deletion java-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subprojects {
apply plugin: 'maven-publish'

// Configuration
version = '0.1'
version = '0.2-alpha.1'
group = 'org.radarcns'
ext.githubRepoName = 'RADAR-CNS/RADAR-Schemas'

Expand Down
5 changes: 4 additions & 1 deletion java-sdk/radar-schemas-restapi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ ext.description = 'RADAR Schemas REST API SDK'
// AVRO file manipulation //
//---------------------------------------------------------------------------//
task generateAvro(type: com.commercehub.gradle.plugin.avro.GenerateAvroJavaTask) {
source rootProject.fileTree('../commons') {
include 'questionnaire/questionnaire.avsc'
include 'application/application_server_status.avsc'
}
source rootProject.fileTree('../restapi') {
include '**/*.avsc'
}
outputDir avroOutputDir
}

compileJava.dependsOn generateAvro

//---------------------------------------------------------------------------//
Expand Down
42 changes: 42 additions & 0 deletions questionnaire/specification/DEMO_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name" : "DEMO",
"version": 1,
"estimatedCompletionTime" : 2,
"startText" : "Here you can test some all available input types.",
"endText" : "Thanks for giving it a try.",
"protocol" : {
"reminders" : {
"amount" : 15,
"repeat" : 1,
"unit" : "min"
},
"repeatProtocol" : {
"amount" : 2,
"unit" : "week"
},
"repeatQuestionnaire" : {
"unit" : "min",
"unitsFromZero" : [ 450, 600, 1890, 2004 ]
}
},
"questions" : [ {
"content" : "The slider as fine-grained input.",
"id" : "Test-0",
"lead" : "Some other input types.",
"range" : {
"max" : 100,
"min" : 0,
"step" : 5
},
"type" : "slider"
}, {
"content" : "The multiple values for a smaller range.",
"id" : "Test-2",
"lead" : "Some other input types.",
"range" : {
"max" : 7,
"min" : 1
},
"type" : "range"
} ]
}
Loading

0 comments on commit 207932e

Please sign in to comment.