Compare commits
No commits in common. "master" and "BUILD-197" have entirely different histories.
791 changed files with 352622 additions and 65917 deletions
15
.classpath
Executable file
15
.classpath
Executable file
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="src" path="test"/>
|
||||||
|
<classpathentry kind="src" path="plugins/tellstick/src"/>
|
||||||
|
<classpathentry kind="src" path="plugins/tellstick/test"/>
|
||||||
|
<classpathentry kind="src" path="plugins/zwave/src"/>
|
||||||
|
|
||||||
|
<classpathentry kind="lib" path="lib/*"/>
|
||||||
|
<classpathentry kind="src" path="plugins/zwave/lib/*"/>
|
||||||
|
|
||||||
|
|
||||||
|
<classpathentry combineaccessrules="false" kind="src" path="/zutil-java"/>
|
||||||
|
<classpathentry kind="output" path="build"/>
|
||||||
|
</classpath>
|
||||||
4
.gitattributes
vendored
Normal file → Executable file
4
.gitattributes
vendored
Normal file → Executable file
|
|
@ -1,5 +1,5 @@
|
||||||
# Github language stats file
|
# Github language stats file
|
||||||
external/* linguist-vendored
|
external/* linguist-vendored
|
||||||
lib/* linguist-vendored
|
lib/* linguist-vendored
|
||||||
*.css linguist-vendored
|
resource/web/css/* linguist-vendored
|
||||||
*.js linguist-vendored
|
resource/web/js/* linguist-vendored
|
||||||
16
.gitignore
vendored
Normal file → Executable file
16
.gitignore
vendored
Normal file → Executable file
|
|
@ -1,14 +1,8 @@
|
||||||
# Configuration and dependencies
|
/screenlog.0*
|
||||||
/hal.conf
|
/hal.conf
|
||||||
/hal.db*
|
/hal.db*
|
||||||
/lib/zutil-*
|
|
||||||
/recordings/
|
|
||||||
|
|
||||||
# Runtime files
|
|
||||||
/screenlog.0*
|
|
||||||
/OZW_Log.txt
|
|
||||||
|
|
||||||
# Build and Ide files
|
|
||||||
build
|
build
|
||||||
.gradle
|
/lib/zutil-*
|
||||||
.idea
|
/OZW_Log.txt
|
||||||
|
/zwscene.xml
|
||||||
|
/zwcfg*.xml
|
||||||
|
|
|
||||||
17
.project
Normal file
17
.project
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>hal</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
71
Hal.iml
Executable file
71
Hal.iml
Executable file
|
|
@ -0,0 +1,71 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/resource" type="java-resource" relativeOutputPath="resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/plugins/hal-zwave/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/plugins/hal-tellstick/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/plugins/hal-tellstick/test" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/plugins/hal-raspberry/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/plugins/hal-zigbee/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/plugins/hal-zwave/test" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/plugins/hal-raspberry/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/plugins/hal-tellstick/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/plugins/hal-zigbee/build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/plugins/hal-zwave/build" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="module" module-name="Zutil" exported="" />
|
||||||
|
<orderEntry type="module-library" exported="">
|
||||||
|
<library name="lib">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$MODULE_DIR$/lib" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<NATIVE>
|
||||||
|
<root url="file://$MODULE_DIR$/lib" />
|
||||||
|
</NATIVE>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$USER_HOME$/.ideaLibSources/wzwave-0.0.3-sources.jar!/" />
|
||||||
|
<root url="jar://$USER_HOME$/.ideaLibSources/netty-all-4.0.46.Final-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
<jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library" exported="">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$MODULE_DIR$/plugins/hal-raspberry/lib" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
<jarDirectory url="file://$MODULE_DIR$/plugins/hal-raspberry/lib" recursive="false" />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library" exported="">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$MODULE_DIR$/plugins/hal-zwave/lib" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
<jarDirectory url="file://$MODULE_DIR$/plugins/hal-zwave/lib" recursive="false" />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library" scope="TEST">
|
||||||
|
<library name="JUnit4">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$APPLICATION_HOME_DIR$/lib/junit-4.12.jar!/" />
|
||||||
|
<root url="jar://$APPLICATION_HOME_DIR$/lib/hamcrest-core-1.3.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
17
Jenkinsfile
vendored
Normal file → Executable file
17
Jenkinsfile
vendored
Normal file → Executable file
|
|
@ -1,29 +1,30 @@
|
||||||
// Jenkinsfile (Pipeline Script)
|
// Jenkinsfile (Pipeline Script)
|
||||||
node {
|
node {
|
||||||
// Configure environment
|
// Configure environment
|
||||||
env.JAVA_HOME = tool name: 'jdk-11'
|
env.JAVA_HOME = tool name: 'jdk8'
|
||||||
env.REPO_URL = "repo.koc.se/hal.git" //scm.getUserRemoteConfigs()[0].getUrl()
|
env.REPO_URL = "repo.koc.se/hal.git" //scm.getUserRemoteConfigs()[0].getUrl()
|
||||||
env.BUILD_NAME = "BUILD-${env.BUILD_ID}"
|
env.BUILD_NAME = "BUILD-" + env.BUILD_ID
|
||||||
|
|
||||||
|
|
||||||
checkout scm
|
checkout scm
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
sh './gradlew clean'
|
sh 'ant clean'
|
||||||
sh './gradlew build'
|
sh 'ant build-all'
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
try {
|
try {
|
||||||
sh './gradlew test'
|
sh 'ant test-all'
|
||||||
} finally {
|
} finally {
|
||||||
junit testResults: '**/build/test-results/test/*.xml'
|
step([$class: 'JUnitResultArchiver', testResults: 'build/reports/*.xml'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stage('Package') {
|
stage('Package') {
|
||||||
sh './gradlew distZip'
|
sh 'ant package-all'
|
||||||
archiveArtifacts artifacts: 'build/distributions/Hal.zip', fingerprint: true
|
archiveArtifacts artifacts: 'build/release/**', fingerprint: true
|
||||||
|
|
||||||
// Tag artifact
|
// Tag artifact
|
||||||
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'f8e5f6c6-4adb-4ab2-bb5d-1c8535dff491',
|
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'f8e5f6c6-4adb-4ab2-bb5d-1c8535dff491',
|
||||||
|
|
|
||||||
2
LICENSE.txt
Normal file → Executable file
2
LICENSE.txt
Normal file → Executable file
|
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016-2025 Daniel Collin, Ziver Koc
|
Copyright (c) 2016 Daniel Collin, Ziver Koc
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
67
README.md
Normal file → Executable file
67
README.md
Normal file → Executable file
|
|
@ -1,56 +1,44 @@
|
||||||
# Hal
|
# Hal
|
||||||
|
|
||||||
Hal is a home automation hub with sensor statistics with the functionality to
|
Hal is a home automation hub with sensor statistics with the functionality to
|
||||||
share that data between friends. It has been developed to be very extensible so future
|
share that data between friends. It is developed to be very extensible so future
|
||||||
Sensors and other input devices can be supported.
|
Sensors and other input devices can be supported.
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
- **Map**, Set up a house map with sensors and events mapped on a floorplan
|
- **Map**, Set up a house map with sensor and events mapped on a floorplan
|
||||||
- **Triggers and Actions**, IFTTT type functionality
|
- **Triggers and Actions**, IFTTT type functionality
|
||||||
- **Power;Challenge**, Sync power or sensor usage between friends to challenge each other to lower the power usage
|
- **Power;Challenge**, Sync power or sensor usage between friends to lower e.g Power usage
|
||||||
- **[Google Assistant Integration](plugins/hal-assistant-google/READNME.md)**
|
|
||||||
|
|
||||||
Currently supported devices:
|
Currently supported devices:
|
||||||
- **Network Scanner**, IP scanner to detect devices on local network
|
- **Network Scanner**, IP scanner to detect devices on local network
|
||||||
- **NUT**, Linux UPS daemon
|
- **NUT**, Linux UPS daemon
|
||||||
- **Tellstick**, Supported devices:
|
- **Tellstick**, Supported devices:
|
||||||
- NexaSelfLearning
|
- NexaSelfLearning
|
||||||
- Oregon0x1A2D
|
- Oregon0x1A2D
|
||||||
- **Raspberry Pi**, GPIO connected sensors
|
- **Raspberry Pi**, GPIO connected sensors
|
||||||
- **[Zigbee](plugins/hal-zigbee/README.md)**
|
|
||||||
- Temperature Sensors
|
|
||||||
- Humidity Sensors
|
|
||||||
- Pressure Sensors
|
|
||||||
- OnnOff Devices
|
|
||||||
- **Google Assistant**
|
|
||||||
- **MQTT Devices**
|
|
||||||
|
|
||||||
Under development (Not ready to be used yet)
|
|
||||||
- **Z-Wave**
|
|
||||||
|
|
||||||
|
|
||||||
The project is currently in alpha state, and as such things will change and break continuously.
|
The project is currently in alpha state, and as such things will change and break.
|
||||||
|
|
||||||
### Screenshots
|
### Screenshots
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
To run the Hal server you first need to clone the git repository and then run the
|
To run the Hal server you first need to clone the git repository and then run the
|
||||||
gradle command to build and run the server:
|
ant command to build and run:
|
||||||
|
|
||||||
```
|
```
|
||||||
./gradlew run
|
ant run
|
||||||
```
|
```
|
||||||
|
|
||||||
Check `hal.conf.example` for available configuration options.
|
Check `hal.conf.example` for available configuration options.
|
||||||
By default, HAL server will be listening to http://localhost:8080.
|
|
||||||
|
|
||||||
## Running the tests
|
## Running the tests
|
||||||
|
|
||||||
|
|
@ -58,34 +46,7 @@ The current test coverage is greatly lacking, but to run the available JUnit
|
||||||
test-cases run:
|
test-cases run:
|
||||||
|
|
||||||
```
|
```
|
||||||
./gradlew test
|
ant test
|
||||||
```
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
```
|
|
||||||
HalAbstractControlerManager
|
|
||||||
|
|
|
||||||
| HalAbstractController
|
|
||||||
| |
|
|
||||||
| | HalAbstractDevice
|
|
||||||
| | |
|
|
||||||
.-----------. .------------. .--------.
|
|
||||||
| | | | | |
|
|
||||||
| | | | ----> | Device |
|
|
||||||
| | | | | |
|
|
||||||
| | ----> | Controller | '--------'
|
|
||||||
| | | | .--------.
|
|
||||||
| | | | | |
|
|
||||||
| Manager | | | ----> | Device |
|
|
||||||
| | | | | |
|
|
||||||
| | '------------' '--------'
|
|
||||||
| | .------------. .--------.
|
|
||||||
| | | | | |
|
|
||||||
| | ----> | Controller | ----> | Device |
|
|
||||||
| | | | | |
|
|
||||||
'-----------' '------------' '--------'
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
|
|
|
||||||
|
|
@ -59,28 +59,28 @@ bool parseArctechSelfLearning(uint8_t* bufStartP, uint8_t* bufEndP) { //start
|
||||||
uint64_t data = 0;
|
uint64_t data = 0;
|
||||||
bool dimValuePresent;
|
bool dimValuePresent;
|
||||||
uint8_t b1,b2,b3,b4;
|
uint8_t b1,b2,b3,b4;
|
||||||
|
|
||||||
//parse preamp
|
//parse preamp
|
||||||
|
|
||||||
b1 = *bufStartP;
|
b1 = *bufStartP;
|
||||||
stepBufferPointer(&bufStartP);
|
stepBufferPointer(&bufStartP);
|
||||||
b2 = *bufStartP;
|
b2 = *bufStartP;
|
||||||
stepBufferPointer(&bufStartP);
|
stepBufferPointer(&bufStartP);
|
||||||
if (!IS_PREAMP(b1, b2)){
|
if(!IS_PREAMP(b1, b2)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//parse data
|
//parse data
|
||||||
|
|
||||||
uint16_t dataBitsInBuffer = (calculateBufferPointerDistance(bufStartP, bufEndP)-2) / 4; //each bit is representd by 4 high/low
|
uint16_t dataBitsInBuffer = (calculateBufferPointerDistance(bufStartP, bufEndP)-2) / 4; //each bit is representd by 4 high/low
|
||||||
if (dataBitsInBuffer == 32) {
|
if (dataBitsInBuffer == 32) {
|
||||||
dimValuePresent = false;
|
dimValuePresent = false;
|
||||||
} else if (dataBitsInBuffer == 36){
|
}else if(dataBitsInBuffer == 36){
|
||||||
dimValuePresent = true;
|
dimValuePresent = true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8_t i = 0; i < dataBitsInBuffer; ++i) {
|
for (uint8_t i = 0; i < dataBitsInBuffer; ++i) {
|
||||||
b1 = *bufStartP; //no of high
|
b1 = *bufStartP; //no of high
|
||||||
stepBufferPointer(&bufStartP);
|
stepBufferPointer(&bufStartP);
|
||||||
|
|
@ -103,7 +103,7 @@ bool parseArctechSelfLearning(uint8_t* bufStartP, uint8_t* bufEndP) { //start
|
||||||
}
|
}
|
||||||
|
|
||||||
//data parsed - send event over serial
|
//data parsed - send event over serial
|
||||||
|
|
||||||
Serial.print(F("+Wclass:command;protocol:arctech;model:selflearning;data:0x"));
|
Serial.print(F("+Wclass:command;protocol:arctech;model:selflearning;data:0x"));
|
||||||
uint8_t hexToSend = (dimValuePresent ? 9 : 8);
|
uint8_t hexToSend = (dimValuePresent ? 9 : 8);
|
||||||
for (int8_t i = hexToSend - 1; i >= 0; --i) {
|
for (int8_t i = hexToSend - 1; i >= 0; --i) {
|
||||||
|
|
|
||||||
|
|
@ -17,29 +17,29 @@ void parseRadioRXBuffer() {
|
||||||
bool parse = false;
|
bool parse = false;
|
||||||
while (bufferReadP != bufferWriteP) { //stop if the read pointer is pointing to where the writing is currently performed
|
while (bufferReadP != bufferWriteP) { //stop if the read pointer is pointing to where the writing is currently performed
|
||||||
uint8_t sampleCount = *bufferReadP;
|
uint8_t sampleCount = *bufferReadP;
|
||||||
|
|
||||||
if ( (((uintptr_t)bufferReadP) & 0x1) == 1 ) { //buffer pointer is odd (stores highs)
|
if ( (((uintptr_t)bufferReadP) & 0x1) == 1 ) { //buffer pointer is odd (stores highs)
|
||||||
//Serial.print("high:"); Serial.println(sampleCount);
|
//Serial.print("high:"); Serial.println(sampleCount);
|
||||||
if (prevValue >= SILENCE_LENGTH) {
|
if (prevValue >= SILENCE_LENGTH) {
|
||||||
startDataP = bufferReadP; //some new data must start here since this is the first "high" after a silent period
|
startDataP = bufferReadP; //some new data must start here since this is the first "high" after a silent period
|
||||||
}
|
}
|
||||||
|
|
||||||
//stream data to stream parsers
|
//stream data to stream parsers
|
||||||
parseOregonStream(HIGH, sampleCount);
|
parseOregonStream(HIGH, sampleCount);
|
||||||
|
|
||||||
} else { //buffer pointer is even (stores lows)
|
} else { //buffer pointer is even (stores lows)
|
||||||
//Serial.print("low:"); Serial.println(sampleCount);
|
//Serial.print("low:"); Serial.println(sampleCount);
|
||||||
if (sampleCount >= SILENCE_LENGTH) { //evaluate if it is time to parse the curernt data
|
if (sampleCount >= SILENCE_LENGTH) { //evaluate if it is time to parse the curernt data
|
||||||
endDataP = bufferReadP; //this is a silient period and must be the end of a data
|
endDataP = bufferReadP; //this is a silient period and must be the end of a data
|
||||||
if (startDataP != 0){
|
if(startDataP != 0){
|
||||||
parse = true;
|
parse = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//stream data to stream parsers
|
//stream data to stream parsers
|
||||||
parseOregonStream(LOW, sampleCount);
|
parseOregonStream(LOW, sampleCount);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//step the read pointer one step
|
//step the read pointer one step
|
||||||
|
|
@ -74,11 +74,11 @@ void parseRadioRXBuffer() {
|
||||||
//Let all available parsers parse the data set now.
|
//Let all available parsers parse the data set now.
|
||||||
parseArctechSelfLearning(startDataP, endDataP);
|
parseArctechSelfLearning(startDataP, endDataP);
|
||||||
//TODO: add more parsers here
|
//TODO: add more parsers here
|
||||||
|
|
||||||
//reset the data pointers since the data have been parsed at this point
|
//reset the data pointers since the data have been parsed at this point
|
||||||
startDataP = 0;
|
startDataP = 0;
|
||||||
endDataP = 0;
|
endDataP = 0;
|
||||||
|
|
||||||
}; //end radioTask
|
}; //end radioTask
|
||||||
|
|
||||||
void sendTCodedData(uint8_t* data, uint8_t T_long, uint8_t* timings, uint8_t repeat, uint8_t pause) {
|
void sendTCodedData(uint8_t* data, uint8_t T_long, uint8_t* timings, uint8_t repeat, uint8_t pause) {
|
||||||
|
|
@ -88,7 +88,7 @@ void sendTCodedData(uint8_t* data, uint8_t T_long, uint8_t* timings, uint8_t rep
|
||||||
for (int i = 0; i < T_long; ++i) {
|
for (int i = 0; i < T_long; ++i) {
|
||||||
uint8_t timeIndex = (data[i / 4] >> (6 - (2 * (i % 4)))) & 0x03;
|
uint8_t timeIndex = (data[i / 4] >> (6 - (2 * (i % 4)))) & 0x03;
|
||||||
if (timings[timeIndex] > 0 || i == T_long - 1) {
|
if (timings[timeIndex] > 0 || i == T_long - 1) {
|
||||||
if (nextPinState){
|
if(nextPinState){
|
||||||
TX_PIN_HIGH();
|
TX_PIN_HIGH();
|
||||||
}else{
|
}else{
|
||||||
TX_PIN_LOW();
|
TX_PIN_LOW();
|
||||||
|
|
@ -111,7 +111,7 @@ void sendSCodedData(uint8_t* data, uint8_t pulseCount, uint8_t repeat, uint8_t p
|
||||||
bool nextPinState = HIGH;
|
bool nextPinState = HIGH;
|
||||||
for (int i = 0; i < pulseCount; ++i) {
|
for (int i = 0; i < pulseCount; ++i) {
|
||||||
if (data[i] > 0 || i == pulseCount - 1) {
|
if (data[i] > 0 || i == pulseCount - 1) {
|
||||||
if (nextPinState){
|
if(nextPinState){
|
||||||
TX_PIN_HIGH();
|
TX_PIN_HIGH();
|
||||||
}else{
|
}else{
|
||||||
TX_PIN_LOW();
|
TX_PIN_LOW();
|
||||||
|
|
|
||||||
0
arduino/HalMultiSensor/HalConfiguration.h
Normal file → Executable file
0
arduino/HalMultiSensor/HalConfiguration.h
Normal file → Executable file
0
arduino/HalMultiSensor/HalInclude.h
Normal file → Executable file
0
arduino/HalMultiSensor/HalInclude.h
Normal file → Executable file
0
arduino/HalMultiSensor/HalInterfaces.h
Normal file → Executable file
0
arduino/HalMultiSensor/HalInterfaces.h
Normal file → Executable file
6
arduino/HalMultiSensor/HalMultiSensor.ino
Normal file → Executable file
6
arduino/HalMultiSensor/HalMultiSensor.ino
Normal file → Executable file
|
|
@ -92,7 +92,7 @@ void loop()
|
||||||
|
|
||||||
// Send power consumption
|
// Send power consumption
|
||||||
#ifdef POWERCON_ENABLED
|
#ifdef POWERCON_ENABLED
|
||||||
if (timerMultiplier % POWER_TIMER_MULTIPLIER == 0)
|
if(timerMultiplier % POWER_TIMER_MULTIPLIER == 0)
|
||||||
{
|
{
|
||||||
static PowerData powerData;
|
static PowerData powerData;
|
||||||
powerSensor->read(powerData); // not needed, only here for future use
|
powerSensor->read(powerData); // not needed, only here for future use
|
||||||
|
|
@ -103,7 +103,7 @@ void loop()
|
||||||
|
|
||||||
// Handle temperature sensor
|
// Handle temperature sensor
|
||||||
#ifdef TEMPERATURE_ENABLED
|
#ifdef TEMPERATURE_ENABLED
|
||||||
if (timerMultiplier % TEMPERATURE_TIMER_MULTIPLIER == 0)
|
if(timerMultiplier % TEMPERATURE_TIMER_MULTIPLIER == 0)
|
||||||
{
|
{
|
||||||
static TemperatureData tempData;
|
static TemperatureData tempData;
|
||||||
tempSensor->read(tempData);
|
tempSensor->read(tempData);
|
||||||
|
|
@ -114,7 +114,7 @@ void loop()
|
||||||
|
|
||||||
// Handle light sensor
|
// Handle light sensor
|
||||||
#ifdef LIGHT_ENABLED
|
#ifdef LIGHT_ENABLED
|
||||||
if (timerMultiplier % LIGHT_TIMER_MULTIPLIER == 0)
|
if(timerMultiplier % LIGHT_TIMER_MULTIPLIER == 0)
|
||||||
{
|
{
|
||||||
static LightData lightData;
|
static LightData lightData;
|
||||||
lightSensor->read(lightData);
|
lightSensor->read(lightData);
|
||||||
|
|
|
||||||
0
arduino/HalMultiSensor/HalMultiSensorEnclosure.FCStd
Normal file → Executable file
0
arduino/HalMultiSensor/HalMultiSensorEnclosure.FCStd
Normal file → Executable file
0
arduino/HalMultiSensor/HalMultiSensorEnclosure_bottom.stl
Normal file → Executable file
0
arduino/HalMultiSensor/HalMultiSensorEnclosure_bottom.stl
Normal file → Executable file
0
arduino/HalMultiSensor/HalMultiSensorEnclosure_top.stl
Normal file → Executable file
0
arduino/HalMultiSensor/HalMultiSensorEnclosure_top.stl
Normal file → Executable file
0
arduino/HalMultiSensor/Interrupt.cpp
Normal file → Executable file
0
arduino/HalMultiSensor/Interrupt.cpp
Normal file → Executable file
0
arduino/HalMultiSensor/Interrupt.h
Normal file → Executable file
0
arduino/HalMultiSensor/Interrupt.h
Normal file → Executable file
0
arduino/HalMultiSensor/ProtocolNexa.cpp
Normal file → Executable file
0
arduino/HalMultiSensor/ProtocolNexa.cpp
Normal file → Executable file
0
arduino/HalMultiSensor/ProtocolNexa.h
Normal file → Executable file
0
arduino/HalMultiSensor/ProtocolNexa.h
Normal file → Executable file
4
arduino/HalMultiSensor/ProtocolOregon.cpp
Normal file → Executable file
4
arduino/HalMultiSensor/ProtocolOregon.cpp
Normal file → Executable file
|
|
@ -83,14 +83,14 @@ inline void ProtocolOregon::setId(byte data[], byte id)
|
||||||
*/
|
*/
|
||||||
inline void ProtocolOregon::setBatteryLevel(byte data[], bool level)
|
inline void ProtocolOregon::setBatteryLevel(byte data[], bool level)
|
||||||
{
|
{
|
||||||
if (!level) data[4] = 0x0C;
|
if(!level) data[4] = 0x0C;
|
||||||
else data[4] = 0x00;
|
else data[4] = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void ProtocolOregon::setTemperature(byte data[], float temp)
|
inline void ProtocolOregon::setTemperature(byte data[], float temp)
|
||||||
{
|
{
|
||||||
// Set temperature sign
|
// Set temperature sign
|
||||||
if (temp < 0)
|
if(temp < 0)
|
||||||
{
|
{
|
||||||
data[6] = 0x08;
|
data[6] = 0x08;
|
||||||
temp *= -1;
|
temp *= -1;
|
||||||
|
|
|
||||||
0
arduino/HalMultiSensor/ProtocolOregon.h
Normal file → Executable file
0
arduino/HalMultiSensor/ProtocolOregon.h
Normal file → Executable file
0
arduino/HalMultiSensor/SensorBH1750.cpp
Normal file → Executable file
0
arduino/HalMultiSensor/SensorBH1750.cpp
Normal file → Executable file
0
arduino/HalMultiSensor/SensorBH1750.h
Normal file → Executable file
0
arduino/HalMultiSensor/SensorBH1750.h
Normal file → Executable file
0
arduino/HalMultiSensor/SensorDHT.cpp
Normal file → Executable file
0
arduino/HalMultiSensor/SensorDHT.cpp
Normal file → Executable file
0
arduino/HalMultiSensor/SensorDHT.h
Normal file → Executable file
0
arduino/HalMultiSensor/SensorDHT.h
Normal file → Executable file
0
arduino/HalMultiSensor/SensorPhotocell.cpp
Normal file → Executable file
0
arduino/HalMultiSensor/SensorPhotocell.cpp
Normal file → Executable file
0
arduino/HalMultiSensor/SensorPhotocell.h
Normal file → Executable file
0
arduino/HalMultiSensor/SensorPhotocell.h
Normal file → Executable file
126
build.gradle
126
build.gradle
|
|
@ -1,126 +0,0 @@
|
||||||
plugins {
|
|
||||||
id 'java'
|
|
||||||
id 'application'
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2025 Ziver Koc
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// ------------------------------------
|
|
||||||
// Hal common configuration
|
|
||||||
// ------------------------------------
|
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subprojects {
|
|
||||||
apply plugin: 'java-library'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
//implementation 'se.koc:zutil:1.0.314'
|
|
||||||
implementation 'se.koc:zutil:1.0.0-SNAPSHOT'
|
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.12'
|
|
||||||
testImplementation 'org.hamcrest:hamcrest-core:2.2'
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
java {
|
|
||||||
srcDirs 'src'
|
|
||||||
}
|
|
||||||
// We do not want the resource folder to be included in the jar file
|
|
||||||
//resources {
|
|
||||||
// srcDir 'resource'
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
test {
|
|
||||||
java {
|
|
||||||
srcDirs 'test'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
|
||||||
options.compilerArgs << "-Xlint:deprecation"
|
|
||||||
//options.compilerArgs << "-Xlint:unchecked"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------
|
|
||||||
// Hal general configuration
|
|
||||||
// ------------------------------------
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
project.subprojects.each { subProject ->
|
|
||||||
runtimeOnly subProject
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
distributions {
|
|
||||||
main {
|
|
||||||
contents {
|
|
||||||
// from root project
|
|
||||||
from 'hal.conf.example'
|
|
||||||
from 'logging.properties'
|
|
||||||
from 'run.sh'
|
|
||||||
|
|
||||||
// from subprojects
|
|
||||||
project.subprojects.each { subProject ->
|
|
||||||
into('bin') {
|
|
||||||
from "${subProject.projectDir}/resources/bin"
|
|
||||||
}
|
|
||||||
into('web') {
|
|
||||||
from "${subProject.projectDir}/resources/web"
|
|
||||||
}
|
|
||||||
into('resources') {
|
|
||||||
from ("${subProject.projectDir}/resources") {
|
|
||||||
exclude 'bin'
|
|
||||||
exclude 'web'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
distTar.enabled = false
|
|
||||||
distZip.enabled = false
|
|
||||||
assemble.dependsOn(installDist)
|
|
||||||
|
|
||||||
project.gradle.startParameter.taskNames.each { taskName ->
|
|
||||||
if (taskName == 'distZip') {
|
|
||||||
distZip.enabled = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
application {
|
|
||||||
mainClass = 'se.hal.HalServer'
|
|
||||||
}
|
|
||||||
|
|
||||||
startScripts.enabled = false
|
|
||||||
188
build.xml
Executable file
188
build.xml
Executable file
|
|
@ -0,0 +1,188 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project name="Hal" >
|
||||||
|
|
||||||
|
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
|
||||||
|
|
||||||
|
<!--common properties-->
|
||||||
|
<property name="root" value="." />
|
||||||
|
<property name="srcDir" value="${root}/src" />
|
||||||
|
<property name="testDir" value="${root}/test" />
|
||||||
|
<property name="libDir" value="${root}/lib" />
|
||||||
|
|
||||||
|
<property name="buildRoot" value="${root}/build" />
|
||||||
|
<property name="compileDir" value="${buildRoot}/production" />
|
||||||
|
<property name="compileTestDir" value="${buildRoot}/test" />
|
||||||
|
<property name="releaseDir" value="${buildRoot}/release" />
|
||||||
|
<property name="reportsDir" value="${buildRoot}/reports" />
|
||||||
|
<property name="releaseJar" value="hal.jar" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ________________________ CLASSPATH ________________________ -->
|
||||||
|
|
||||||
|
<!--define standard arguments for javac-->
|
||||||
|
<presetdef name="javac">
|
||||||
|
<javac includeantruntime="false" />
|
||||||
|
</presetdef>
|
||||||
|
|
||||||
|
<!--classpath included when building-->
|
||||||
|
<path id="classpath.build">
|
||||||
|
<fileset dir="${libDir}">
|
||||||
|
<include name="**/*.jar"/>
|
||||||
|
</fileset>
|
||||||
|
<pathelement location="${compileDir}" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path id="classpath.test">
|
||||||
|
<pathelement location="${compileTestDir}" />
|
||||||
|
<!--include libraries used for building-->
|
||||||
|
<path refid="classpath.build"/>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<!-- ________________________ EXECUTION TARGETS ________________________ -->
|
||||||
|
|
||||||
|
<target name="run" depends="package-all">
|
||||||
|
<java fork="true" failonerror="true" classname="se.hal.HalServer">
|
||||||
|
<classpath>
|
||||||
|
<pathelement path="${releaseDir}/${releaseJar}"/>
|
||||||
|
<pathelement path="${releaseDir}/plugins/*"/>
|
||||||
|
<pathelement path="${libDir}/*"/>
|
||||||
|
</classpath>
|
||||||
|
</java>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="debug-remote" depends="package">
|
||||||
|
<java fork="true" failonerror="true" classname="se.hal.HalServer">
|
||||||
|
<jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" />
|
||||||
|
<classpath>
|
||||||
|
<pathelement path="${releaseDir}/${releaseJar}"/>
|
||||||
|
<pathelement path="${libDir}/*"/> <!--wildcard may not be platform independent, ok?-->
|
||||||
|
</classpath>
|
||||||
|
</java>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- Test targets -->
|
||||||
|
<target name="test-all" depends="test,test-plugins" />
|
||||||
|
|
||||||
|
<target name="test" depends="build-test">
|
||||||
|
<mkdir dir="${reportsDir}" />
|
||||||
|
<junit printsummary="yes" haltonfailure="false" fork="true">
|
||||||
|
<classpath refid="classpath.test" />
|
||||||
|
<formatter type="plain" usefile="false" /> <!-- to screen -->
|
||||||
|
<formatter type="xml" /> <!-- to file -->
|
||||||
|
|
||||||
|
<batchtest todir="${reportsDir}" skipNonTests="true">
|
||||||
|
<fileset dir="${compileTestDir}" includes="**/*Test*.class" />
|
||||||
|
</batchtest>
|
||||||
|
</junit>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="test-plugins" depends="build-test">
|
||||||
|
<subant target="test" verbose="true">
|
||||||
|
<fileset dir="plugins/" includes="*/build.xml"/>
|
||||||
|
</subant>
|
||||||
|
</target>
|
||||||
|
<!-- ________________________ BUILD TARGETS ________________________ -->
|
||||||
|
|
||||||
|
<!-- clean all build paths -->
|
||||||
|
<target name="clean">
|
||||||
|
<delete includeemptydirs="true" failonerror="false">
|
||||||
|
<fileset dir="${buildRoot}" includes="**/*"/>
|
||||||
|
</delete>
|
||||||
|
<!-- clean plugins -->
|
||||||
|
<subant target="clean" verbose="true">
|
||||||
|
<fileset dir="plugins/" includes="*/build.xml"/>
|
||||||
|
</subant>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- build product code -->
|
||||||
|
<target name="build-all" depends="build,build-plugins" />
|
||||||
|
|
||||||
|
<target name="build" depends="build-dependencies">
|
||||||
|
<mkdir dir="${compileDir}" />
|
||||||
|
<javac srcdir="${srcDir}" destdir="${compileDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
||||||
|
<classpath refid="classpath.build" />
|
||||||
|
<include name="**/*.java" />
|
||||||
|
<exclude name="se/hal/tts/GoogleTTSClient.java" />
|
||||||
|
</javac>
|
||||||
|
<copy todir="${compileDir}">
|
||||||
|
<fileset dir="${srcDir}"
|
||||||
|
excludes="**/*.java" />
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="build-dependencies">
|
||||||
|
<mkdir dir="${compileDir}" />
|
||||||
|
<get src="http://ci.koc.se/jenkins/job/Zutil/lastSuccessfulBuild/artifact/se/koc/zutil/1.0.2-231/zutil-1.0.2-231.jar"
|
||||||
|
dest="${libDir}" verbose="true" usetimestamp="true"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="build-plugins" depends="build">
|
||||||
|
<subant target="build" verbose="true">
|
||||||
|
<fileset dir="plugins/" includes="*/build.xml"/>
|
||||||
|
</subant>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="build-test" depends="build">
|
||||||
|
<mkdir dir="${compileTestDir}" />
|
||||||
|
<javac srcdir="${testDir}" destdir="${compileTestDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
||||||
|
<classpath refid="classpath.test" />
|
||||||
|
<include name="**/*.java" />
|
||||||
|
</javac>
|
||||||
|
<copy todir="${compileTestDir}">
|
||||||
|
<fileset dir="${testDir}"
|
||||||
|
excludes="**/*.java" />
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- generate release packages -->
|
||||||
|
<target name="package-all" depends="package,package-plugins" />
|
||||||
|
|
||||||
|
<target name="package" depends="build">
|
||||||
|
<copy todir="${releaseDir}" >
|
||||||
|
<fileset file="${root}/hal.conf.example" />
|
||||||
|
<fileset file="${root}/hal-default.db" />
|
||||||
|
<fileset file="${root}/logging.properties" />
|
||||||
|
<fileset file="${root}/run.sh" />
|
||||||
|
</copy>
|
||||||
|
<copy todir="${releaseDir}/lib">
|
||||||
|
<fileset dir="${libDir}" excludes="junit-*.jar,hamcrest-*.jar" />
|
||||||
|
</copy>
|
||||||
|
<copy todir="${releaseDir}/resource/web">
|
||||||
|
<fileset dir="resource/web" />
|
||||||
|
</copy>
|
||||||
|
<jar destfile="${releaseDir}/${releaseJar}" basedir="${compileDir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="package-plugins" depends="package">
|
||||||
|
<subant target="package" verbose="true">
|
||||||
|
<fileset dir="plugins/" includes="*/build.xml"/>
|
||||||
|
</subant>
|
||||||
|
<!-- Copy plugin jars -->
|
||||||
|
<copy todir="${releaseDir}/plugins" flatten="true" includeEmptyDirs="false">
|
||||||
|
<fileset dir="plugins/">
|
||||||
|
<include name="*/build/release/**"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
<!-- Copy plugin libs -->
|
||||||
|
<copy todir="${releaseDir}/lib" flatten="true" includeEmptyDirs="false">
|
||||||
|
<fileset dir="plugins/">
|
||||||
|
<include name="*/lib/**"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- ________________________ UTILITY TARGETS ________________________ -->
|
||||||
|
|
||||||
|
<target name="clear-aggr-data-from-db" depends="">
|
||||||
|
<exec executable="sqlite3">
|
||||||
|
<arg line="hal.db 'DELETE FROM sensor_data_aggr'" />
|
||||||
|
</exec>
|
||||||
|
|
||||||
|
<!-- update all internal sensors aggregation version to indicate for peers that they need to re-sync all data -->
|
||||||
|
<exec executable="sqlite3">
|
||||||
|
<arg line="hal.db 'UPDATE sensor SET aggr_version = (aggr_version+1) WHERE id = (SELECT sensor.id FROM user, sensor WHERE user.external == 0 AND sensor.user_id = user.id)'" />
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
100
build_plugin.xml
Executable file
100
build_plugin.xml
Executable file
|
|
@ -0,0 +1,100 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project name="abstract plugin build file" >
|
||||||
|
|
||||||
|
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
|
||||||
|
<!-- ____________ (THESE SHOULD BE SET BY IMPORTING BUILD SCRIPT) ____________ -->
|
||||||
|
|
||||||
|
<!--common properties-->
|
||||||
|
<!--
|
||||||
|
<property name="root" value="." />
|
||||||
|
<property name="srcDir" value="${root}/src" />
|
||||||
|
<property name="testDir" value="${root}/test" />
|
||||||
|
<property name="libDir" value="${root}/lib" />
|
||||||
|
|
||||||
|
<property name="buildRoot" value="${root}/build" />
|
||||||
|
<property name="compileDir" value="${buildRoot}/production" />
|
||||||
|
<property name="compileTestDir" value="${buildRoot}/test" />
|
||||||
|
<property name="releaseDir" value="${buildRoot}/release" />
|
||||||
|
<property name="releaseJar" value="tellstick.jar" />
|
||||||
|
<property name="reportsDir" value="../../${buildRoot}/reports" />
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- ________________________ CLASSPATH ________________________ -->
|
||||||
|
|
||||||
|
<!--define standard arguments for javac-->
|
||||||
|
<presetdef name="javac">
|
||||||
|
<javac includeantruntime="false" />
|
||||||
|
</presetdef>
|
||||||
|
|
||||||
|
<!--classpath included when building-->
|
||||||
|
<path id="classpath.build">
|
||||||
|
<fileset dir="${libDir}" erroronmissingdir="false">
|
||||||
|
<include name="**/*.jar"/>
|
||||||
|
</fileset>
|
||||||
|
<pathelement location="${compileDir}" />
|
||||||
|
<!-- Hal core -->
|
||||||
|
<pathelement location="../../build/production" />
|
||||||
|
<fileset dir="../../lib">
|
||||||
|
<include name="**/*.jar"/>
|
||||||
|
</fileset>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path id="classpath.test">
|
||||||
|
<pathelement location="${compileTestDir}" />
|
||||||
|
<pathelement location="../../${compileTestDir}" />
|
||||||
|
<!--include libraries used for building-->
|
||||||
|
<path refid="classpath.build"/>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<!-- ________________________ EXECUTION TARGETS ________________________ -->
|
||||||
|
|
||||||
|
<target name="test" depends="build-test">
|
||||||
|
<mkdir dir="${reportsDir}" />
|
||||||
|
<junit printsummary="yes" haltonfailure="false" fork="true">
|
||||||
|
<classpath refid="classpath.test" />
|
||||||
|
<formatter type="plain" usefile="false" /> <!-- to screen -->
|
||||||
|
<formatter type="xml" /> <!-- to file -->
|
||||||
|
|
||||||
|
<batchtest todir="${reportsDir}" skipNonTests="true">
|
||||||
|
<fileset dir="${compileTestDir}" includes="**/*Test*.class" erroronmissingdir="false"/>
|
||||||
|
</batchtest>
|
||||||
|
</junit>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- ________________________ BUILD TARGETS ________________________ -->
|
||||||
|
|
||||||
|
<!--clean all build paths-->
|
||||||
|
<target name="clean">
|
||||||
|
<delete includeemptydirs="true" failonerror="false">
|
||||||
|
<fileset dir="${buildRoot}" includes="**/*"/>
|
||||||
|
</delete>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!--build product code-->
|
||||||
|
<target name="build">
|
||||||
|
<mkdir dir="${compileDir}" />
|
||||||
|
<javac srcdir="${srcDir}" destdir="${compileDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
||||||
|
<classpath refid="classpath.build" />
|
||||||
|
<include name="**/*.java" />
|
||||||
|
</javac>
|
||||||
|
<copy todir="${compileDir}">
|
||||||
|
<fileset dir="${srcDir}"
|
||||||
|
excludes="**/*.java" />
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<available file="${testDir}" property="testDirAvailable" value=""/>
|
||||||
|
|
||||||
|
<target name="build-test" depends="build" if="testDirAvailable">
|
||||||
|
<mkdir dir="${compileTestDir}" />
|
||||||
|
<javac srcdir="${testDir}" destdir="${compileTestDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
|
||||||
|
<classpath refid="classpath.test" />
|
||||||
|
<include name="**/*.java" />
|
||||||
|
</javac>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="package" depends="build">
|
||||||
|
<jar destfile="${releaseDir}/${releaseJar}" basedir="${compileDir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
0
external/tellstick-core/AUTHORS.txt
vendored
Normal file → Executable file
0
external/tellstick-core/AUTHORS.txt
vendored
Normal file → Executable file
0
external/tellstick-core/LICENSE.txt
vendored
Normal file → Executable file
0
external/tellstick-core/LICENSE.txt
vendored
Normal file → Executable file
18
external/tellstick-core/Protocol.cpp
vendored
Normal file → Executable file
18
external/tellstick-core/Protocol.cpp
vendored
Normal file → Executable file
|
|
@ -97,7 +97,7 @@ bool Protocol::checkBit(int data, int bitno) {
|
||||||
|
|
||||||
|
|
||||||
Protocol *Protocol::getProtocolInstance(const std::wstring &protocolname) {
|
Protocol *Protocol::getProtocolInstance(const std::wstring &protocolname) {
|
||||||
if (TelldusCore::comparei(protocolname, L"arctech")) {
|
if(TelldusCore::comparei(protocolname, L"arctech")) {
|
||||||
return new ProtocolNexa();
|
return new ProtocolNexa();
|
||||||
|
|
||||||
} else if (TelldusCore::comparei(protocolname, L"brateck")) {
|
} else if (TelldusCore::comparei(protocolname, L"brateck")) {
|
||||||
|
|
@ -151,7 +151,7 @@ Protocol *Protocol::getProtocolInstance(const std::wstring &protocolname) {
|
||||||
|
|
||||||
std::list<std::string> Protocol::getParametersForProtocol(const std::wstring &protocolName) {
|
std::list<std::string> Protocol::getParametersForProtocol(const std::wstring &protocolName) {
|
||||||
std::list<std::string> parameters;
|
std::list<std::string> parameters;
|
||||||
if (TelldusCore::comparei(protocolName, L"arctech")) {
|
if(TelldusCore::comparei(protocolName, L"arctech")) {
|
||||||
parameters.push_back("house");
|
parameters.push_back("house");
|
||||||
parameters.push_back("unit");
|
parameters.push_back("unit");
|
||||||
|
|
||||||
|
|
@ -218,7 +218,7 @@ std::list<std::string> Protocol::decodeData(const std::string &fullData) {
|
||||||
std::string decoded = "";
|
std::string decoded = "";
|
||||||
|
|
||||||
ControllerMessage dataMsg(fullData);
|
ControllerMessage dataMsg(fullData);
|
||||||
if ( TelldusCore::comparei(dataMsg.protocol(), L"arctech") ) {
|
if( TelldusCore::comparei(dataMsg.protocol(), L"arctech") ) {
|
||||||
decoded = ProtocolNexa::decodeData(dataMsg);
|
decoded = ProtocolNexa::decodeData(dataMsg);
|
||||||
if (decoded != "") {
|
if (decoded != "") {
|
||||||
retval.push_back(decoded);
|
retval.push_back(decoded);
|
||||||
|
|
@ -231,32 +231,32 @@ std::list<std::string> Protocol::decodeData(const std::string &fullData) {
|
||||||
if (decoded != "") {
|
if (decoded != "") {
|
||||||
retval.push_back(decoded);
|
retval.push_back(decoded);
|
||||||
}
|
}
|
||||||
} else if (TelldusCore::comparei(dataMsg.protocol(), L"everflourish") ) {
|
} else if(TelldusCore::comparei(dataMsg.protocol(), L"everflourish") ) {
|
||||||
decoded = ProtocolEverflourish::decodeData(dataMsg);
|
decoded = ProtocolEverflourish::decodeData(dataMsg);
|
||||||
if (decoded != "") {
|
if (decoded != "") {
|
||||||
retval.push_back(decoded);
|
retval.push_back(decoded);
|
||||||
}
|
}
|
||||||
} else if (TelldusCore::comparei(dataMsg.protocol(), L"fineoffset") ) {
|
} else if(TelldusCore::comparei(dataMsg.protocol(), L"fineoffset") ) {
|
||||||
decoded = ProtocolFineoffset::decodeData(dataMsg);
|
decoded = ProtocolFineoffset::decodeData(dataMsg);
|
||||||
if (decoded != "") {
|
if (decoded != "") {
|
||||||
retval.push_back(decoded);
|
retval.push_back(decoded);
|
||||||
}
|
}
|
||||||
} else if (TelldusCore::comparei(dataMsg.protocol(), L"mandolyn") ) {
|
} else if(TelldusCore::comparei(dataMsg.protocol(), L"mandolyn") ) {
|
||||||
decoded = ProtocolMandolyn::decodeData(dataMsg);
|
decoded = ProtocolMandolyn::decodeData(dataMsg);
|
||||||
if (decoded != "") {
|
if (decoded != "") {
|
||||||
retval.push_back(decoded);
|
retval.push_back(decoded);
|
||||||
}
|
}
|
||||||
} else if (TelldusCore::comparei(dataMsg.protocol(), L"oregon") ) {
|
} else if(TelldusCore::comparei(dataMsg.protocol(), L"oregon") ) {
|
||||||
decoded = ProtocolOregon::decodeData(dataMsg);
|
decoded = ProtocolOregon::decodeData(dataMsg);
|
||||||
if (decoded != "") {
|
if (decoded != "") {
|
||||||
retval.push_back(decoded);
|
retval.push_back(decoded);
|
||||||
}
|
}
|
||||||
} else if (TelldusCore::comparei(dataMsg.protocol(), L"x10") ) {
|
} else if(TelldusCore::comparei(dataMsg.protocol(), L"x10") ) {
|
||||||
decoded = ProtocolX10::decodeData(dataMsg);
|
decoded = ProtocolX10::decodeData(dataMsg);
|
||||||
if (decoded != "") {
|
if (decoded != "") {
|
||||||
retval.push_back(decoded);
|
retval.push_back(decoded);
|
||||||
}
|
}
|
||||||
} else if (TelldusCore::comparei(dataMsg.protocol(), L"hasta") ) {
|
} else if(TelldusCore::comparei(dataMsg.protocol(), L"hasta") ) {
|
||||||
decoded = ProtocolHasta::decodeData(dataMsg);
|
decoded = ProtocolHasta::decodeData(dataMsg);
|
||||||
if (decoded != "") {
|
if (decoded != "") {
|
||||||
retval.push_back(decoded);
|
retval.push_back(decoded);
|
||||||
|
|
|
||||||
0
external/tellstick-core/Protocol.h
vendored
Normal file → Executable file
0
external/tellstick-core/Protocol.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolBrateck.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolBrateck.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolBrateck.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolBrateck.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolComen.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolComen.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolComen.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolComen.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolEverflourish.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolEverflourish.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolEverflourish.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolEverflourish.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolFineoffset.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolFineoffset.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolFineoffset.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolFineoffset.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolFuhaote.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolFuhaote.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolFuhaote.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolFuhaote.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolGroup.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolGroup.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolGroup.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolGroup.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolHasta.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolHasta.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolHasta.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolHasta.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolIkea.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolIkea.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolIkea.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolIkea.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolMandolyn.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolMandolyn.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolMandolyn.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolMandolyn.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolNexa.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolNexa.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolNexa.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolNexa.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolOregon.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolOregon.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolOregon.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolOregon.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolRisingSun.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolRisingSun.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolRisingSun.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolRisingSun.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolSartano.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolSartano.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolSartano.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolSartano.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolScene.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolScene.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolScene.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolScene.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolSilvanChip.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolSilvanChip.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolSilvanChip.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolSilvanChip.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolUpm.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolUpm.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolUpm.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolUpm.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolWaveman.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolWaveman.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolWaveman.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolWaveman.h
vendored
Normal file → Executable file
2
external/tellstick-core/ProtocolX10.cpp
vendored
Normal file → Executable file
2
external/tellstick-core/ProtocolX10.cpp
vendored
Normal file → Executable file
|
|
@ -175,7 +175,7 @@ std::string ProtocolX10::decodeData(const ControllerMessage& dataMsg) {
|
||||||
retString << "house:" << static_cast<char>('A' + intHouse);
|
retString << "house:" << static_cast<char>('A' + intHouse);
|
||||||
retString << ";unit:" << unit+1;
|
retString << ";unit:" << unit+1;
|
||||||
retString << ";method:";
|
retString << ";method:";
|
||||||
if (method == 0) {
|
if(method == 0) {
|
||||||
retString << "turnon;";
|
retString << "turnon;";
|
||||||
} else {
|
} else {
|
||||||
retString << "turnoff;";
|
retString << "turnoff;";
|
||||||
|
|
|
||||||
0
external/tellstick-core/ProtocolX10.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolX10.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolYidong.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolYidong.cpp
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolYidong.h
vendored
Normal file → Executable file
0
external/tellstick-core/ProtocolYidong.h
vendored
Normal file → Executable file
0
external/tellstick-core/README.txt
vendored
Normal file → Executable file
0
external/tellstick-core/README.txt
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/Static/amd64/ftd2xx.lib
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/Static/amd64/ftd2xx.lib
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/Static/i386/ftd2xx.lib
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/Static/i386/ftd2xx.lib
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftbusui.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftbusui.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftcserco.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftcserco.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftd2xx.lib
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftd2xx.lib
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftd2xx64.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftd2xx64.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftdibus.sys
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftdibus.sys
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftlang.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftlang.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftser2k.sys
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftser2k.sys
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftserui2.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/amd64/ftserui2.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/dpinst-amd64.exe
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/dpinst-amd64.exe
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/dpinst-x86.exe
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/dpinst-x86.exe
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/ftd2xx.h
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/ftd2xx.h
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/ftdibus.cat
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/ftdibus.cat
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/ftdibus.inf
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/ftdibus.inf
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/ftdiport.cat
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/ftdiport.cat
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/ftdiport.inf
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/ftdiport.inf
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftbusui.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftbusui.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftcserco.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftcserco.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftd2xx.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftd2xx.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftd2xx.lib
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftd2xx.lib
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftdibus.sys
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftdibus.sys
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftlang.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftlang.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftser2k.sys
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftser2k.sys
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftserui2.dll
vendored
Normal file → Executable file
0
external/tellstick-driver/SerialDriver_Windows/i386/ftserui2.dll
vendored
Normal file → Executable file
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue