Compare commits

...

502 commits

Author SHA1 Message Date
1779916d97 Fixed build dist containing the correct structure and be able to build zip files explicitly.
Also fixed some compile warnings
2025-12-18 03:47:54 +01:00
c7f0d4e8b3 Uplift to Java 21 2025-12-16 23:55:17 +01:00
e39e1b462d Added links in settings page 2025-10-24 01:56:41 +02:00
9d41856854 Added support for multiple eco cube devices 2025-10-24 01:55:49 +02:00
c26c769108 Renamed devices to have Config at the end 2025-10-24 01:47:19 +02:00
ac97ca8068 Fixed equals method and refactored vue folder 2025-10-24 01:10:58 +02:00
c96a00333b Renamed Tibber plugin name 2025-10-23 23:30:55 +02:00
21a672acf4 Implementation of EcoSens Cloud API 2025-10-23 23:29:31 +02:00
be7b6cc2d6 Refactored Tibber query code into a seperate class 2025-10-23 23:19:15 +02:00
6cec337db1 Implement the proper shutdown for TibberController 2025-10-23 22:31:30 +02:00
8ee7ed0ef2 Fixed current showing incorrectly 2024-12-29 22:38:53 +01:00
3e60e55f16 Fixed plugin config issue 2024-12-29 22:32:56 +01:00
bec5a3098b Fixed equals bug in Tibber 2024-12-29 22:28:23 +01:00
96635381f4 Finished tibber controller logic 2024-12-29 00:38:07 +01:00
12d3c80ba8 Fixed bug with tibber request 2024-12-28 22:11:26 +01:00
17026db07e Added power, voltage and current to MQTT parsing 2024-12-28 20:55:37 +01:00
f68ec9a8e9 Downgraded SQLite 2024-10-01 23:49:57 +02:00
aa3c3d05e1 Added doc for missing commands 2024-10-01 23:38:21 +02:00
3d883e0674 Fixed incorrect Zigbee2mqtt topic name for setting values 2024-10-01 23:26:32 +02:00
22e6400369 Removed old event page 2024-09-26 00:55:47 +02:00
60024dc915 Fixed Event overview page to properly modify events 2024-09-26 00:54:58 +02:00
d049e524d5 Added support for setting event values through MQTT 2024-09-26 00:31:25 +02:00
cc0b50f288 Updated readme with current project state 2024-09-26 00:30:49 +02:00
a980bc4946 Implemented MQTT events and added additional test cases 2024-09-25 00:16:07 +02:00
3ef524accd Uplift to solve vulnerabilities 2024-09-22 00:09:48 +02:00
34e6843d91 Fixe some buggs in MQTT, it works now 2024-09-09 23:35:26 +02:00
b7ee6b16dc Introduced MQTT detectors to autodetect MQTT devices 2024-09-04 02:58:44 +02:00
e4707c2493 Fixed console output issue 2024-07-16 23:44:46 +02:00
f3cbda43d1 Some bugfixes 2024-05-27 01:41:37 +02:00
ce73bd70fe Moved Zigbee neighbour info to API 2024-05-27 00:01:22 +02:00
784844b85f added favicon 2024-03-22 02:05:51 +01:00
c145056e5e robustness fix 2024-03-22 01:43:09 +01:00
e39f282abf robustness fix 2024-03-22 01:41:40 +01:00
1d8b26998a fixed some JS issues where event overview links did not work and all devices does is not visible 2024-03-22 01:27:43 +01:00
98c48e595f Fixed compilation issues 2024-03-15 00:59:47 +01:00
7d64788154 Introduction of JS based pages 2024-03-15 00:17:15 +01:00
c4cb9ff458 Added Tibber plugin 2024-03-15 00:07:52 +01:00
2e924d2882 Minor robustness fix 2024-03-15 00:06:10 +01:00
e6de5e4576 Added daemon view to plugin page 2024-03-15 00:05:39 +01:00
183e14733c Added missing plugins to example configuration 2024-03-15 00:04:28 +01:00
7935dd5c93 Added initial zigbee network map 2024-03-15 00:03:39 +01:00
9fe699b40d Added missing tibber build file 2024-03-14 23:25:32 +01:00
0b84b5aea4 Moving checkbox switch to css and colored the slider 2024-01-27 00:15:23 +01:00
2af860f694 Added daemon list to frontend 2024-01-25 14:42:28 +01:00
47f730b76e Introduction of Javascript modules for frontend 2024-01-24 22:23:48 +01:00
c27f1030b6 Moved around some properties in the API 2024-01-24 22:22:20 +01:00
99a61f8ca3 Added controller status indication 2024-01-24 21:41:51 +01:00
78b7484403 Updated exception reporting to Logger 2024-01-23 23:00:25 +01:00
eb24b32952 Changed extension of license files 2023-11-04 23:20:09 +01:00
c818d5bcc7 Improved data column title 2023-10-04 23:44:43 +02:00
8a5267b0f8 Fixed exceptions and color selection 2023-10-04 23:32:24 +02:00
54a9fcedf8 some bugfixes 2023-09-28 22:14:13 +02:00
198c681333 some bugfixes 2023-09-28 22:09:46 +02:00
ec4cbc1e7c some bugfixes 2023-09-28 22:08:35 +02:00
7ea6f8b3e4 silence gradle on run 2023-09-28 22:05:26 +02:00
a52de9ccb7 silence gradle on run 2023-09-28 21:59:58 +02:00
dc4f54be4b Pressure data bugfix 2023-09-28 21:37:32 +02:00
f7f590a77e Bugfix of incorrectly read level of zigbee devices 2023-09-08 23:16:03 +02:00
a4745cdccd Added Color and Brightness traits to Google Assistant 2023-09-08 22:14:03 +02:00
a68980a6b3 Fixed color in event overview 2023-09-04 01:21:43 +02:00
cdb66470b5 Fixed auto table update messing with user input 2023-08-28 22:09:18 +02:00
1875160f6f Fixed compile error 2023-08-22 22:09:50 +02:00
dd0cc96d58 Improved MQTT Unkown device printout 2023-08-22 20:29:29 +02:00
2d2a79470d Fixed MQTT and added PM2.5 trait to google assistant 2023-08-21 02:44:12 +02:00
cfcebca5a0 Fixed incoorect data type for humidity 2023-08-20 23:40:31 +02:00
4d473573db Fixed deletion issue 2023-05-16 02:29:12 +02:00
6acf0ad031 added no color option to run script 2023-05-16 01:43:16 +02:00
070aeb35d7 Reshuffled init order to allow web server port modification 2023-05-16 01:13:53 +02:00
b710626ad0 Updated junit report path 2023-05-15 23:47:08 +02:00
16604f7fdb Fixed run permissions 2023-05-15 23:33:54 +02:00
6e4e7fba4a Uplift zutil version 2023-05-15 15:40:16 +02:00
234125bc35 Implementation of level and color data types 2023-05-15 15:35:56 +02:00
a89b418350 Fixed alerts as strings was not escaped properly 2023-03-29 01:07:41 +02:00
2dec5c1a05 Added PM sensor 2023-03-26 01:32:27 +01:00
926c3e2af2 Improved MQTT Broker and added overview page 2023-03-26 00:53:39 +01:00
bda3f270af Added telegram support 2023-03-04 00:24:20 +01:00
aff64c354c Fixing incorrect position of UI button 2023-02-27 23:34:20 +01:00
425012517c Refactored run script to not run Hal through gradle. 2023-02-27 23:33:56 +01:00
13b8dc95db Fixed wording 2023-02-26 17:04:02 +01:00
1dec30e2fa Added room hint to google assistant 2023-01-12 00:57:56 +01:00
7747a10959 Introduction of room alerts 2023-01-11 16:11:11 +01:00
ed04554a4a Refactored alerts to be API based and not directly generated into the HTML 2023-01-11 03:41:15 +01:00
2ee0e775be Moved css into a lib folder for external code 2023-01-10 03:08:17 +01:00
b80991280a Downgraded svg.js as many plugins did not support v3.x
Now rooms can be moved and resized.
2023-01-10 02:58:36 +01:00
fb7f43ed23 Upgraded svg.js library to version 3 2023-01-10 00:53:30 +01:00
d8a1b66738 Removed unnecessary extra layer in resource folder structure. 2023-01-09 01:02:37 +01:00
94485b5633 Starting differential update of map 2023-01-09 00:51:51 +01:00
628c89b1d1 Moved external JS scripts to lib folder, moved map JS to a seperate file 2023-01-09 00:14:54 +01:00
7a90189927 Introduction of Room assignments 2023-01-06 23:54:53 +01:00
b5ac492414 Added AlertAction and fixed enum selection issues on the frontend 2023-01-06 00:16:45 +01:00
0efa7320e3 Fixed up the API and added API doc 2023-01-05 22:24:47 +01:00
253208b6f9 Fixed issue where API always returned all devices 2022-06-01 20:04:26 +02:00
b80ca96a73 Fixed misspelling 2022-05-27 03:08:13 +02:00
fa28d7e3d7 Uplifted Jenkins jdk 2022-05-27 03:06:04 +02:00
4dfba22914 Uplift of Zutil 2022-05-27 03:02:00 +02:00
100123e716 Uplift of Zutil 2022-05-27 02:21:19 +02:00
ef365f360c Moved Json Pages to api folder and added auto update javascript to overview pages. 2022-05-27 02:13:33 +02:00
95ff5b81c0 Added possibility to refresh individual Zigbee attributes. 2022-05-23 23:19:21 +02:00
7cf6849e5d Added duplicate listener logic to prevent duplicate reports. 2022-05-23 20:09:45 +02:00
53e9f08272 Added some robustness to RTSP recorder 2022-05-23 20:09:05 +02:00
6b92172d74 Added missing NVR files 2022-05-20 13:05:34 +02:00
2501831a59 Working NVR plugin 2022-05-20 13:04:23 +02:00
3a278b0ca6 Changed to disable plugins by default 2022-05-20 12:00:06 +02:00
78e2edd4e9 Fixed some spelling mistakes 2022-05-20 11:59:49 +02:00
a8fe102bb8 Changed type to show configuration class 2022-05-20 11:58:59 +02:00
e88250196e fixed js include 2021-12-05 21:04:30 +01:00
57ef44c450 Removed staging ACME server 2021-12-04 22:52:49 +01:00
931669bf53 CHanged manual URL generation to a util class. 2021-12-04 22:50:22 +01:00
c01367e422 Improved logging 2021-12-04 22:14:49 +01:00
b91f006d8b Made error handling more robust for managers 2021-12-04 21:31:48 +01:00
b65a9f0bd3 Improved external web-server 2021-12-04 21:00:08 +01:00
d91556681b Added some user messages to cert generation 2021-12-03 02:12:59 +01:00
242d3addef Fixed warning 2021-12-03 01:55:44 +01:00
81b7d7e930 Removed unused API classes 2021-12-03 01:55:33 +01:00
5dae45bb0b Renamed DB Upgrade classes 2021-12-03 01:53:23 +01:00
fa78d02778 Added additional method needed for newer Zigbee lib versions 2021-12-03 01:52:09 +01:00
370fecaa8a Fixed a bug where null device are returned on sync request 2021-10-10 02:40:18 +02:00
b6a0e39ac3 Improved logging and removed exception in factory. 2021-10-10 02:25:22 +02:00
433b3ee002 Fixed incorrect exception messages 2021-10-10 02:11:24 +02:00
58894924a5 Updated some js libs and added license info 2021-10-02 20:48:17 +02:00
3edea58f8c Renamed some DeviceData classes, added additional data classes also and better handling in zigbee 2021-10-02 19:42:23 +02:00
dc200294be Added ability to disable local mDNS server 2021-10-02 19:40:45 +02:00
4d1922d088 Added ID to config pages 2021-09-23 00:36:40 +02:00
c9227fd8ac Added safty check so that Google sync does not fail 2021-09-23 00:05:38 +02:00
0b029f68e3 Bugfix for devices that do not have any data yet 2021-09-23 00:02:05 +02:00
c46aab31e9 Added margin to logo 2021-09-16 22:46:28 +02:00
184fdc14d1 Bugfix 2021-09-16 22:01:27 +02:00
940016f44a Added default aggregation intervall. 2021-09-16 21:58:48 +02:00
af39f2c94b bah, added exec permission 2021-09-16 17:21:04 +02:00
9c74043172 added exec permission on run.sh 2021-09-16 17:18:32 +02:00
7cf816c903 Added collapsable panels to zigbee network page 2021-09-16 17:15:22 +02:00
342368bd77 Fixed startup page 2021-09-16 00:10:46 +02:00
bc35492cee Refactoring navigation 2021-09-15 22:58:01 +02:00
d7605da60f Added startup page 2021-09-15 22:21:21 +02:00
bfd895112d Added a test mode without cert for external web server 2021-09-15 16:56:24 +02:00
b4f6f15055 fixed misspelling 2021-09-15 16:29:59 +02:00
1b93608d2a Added Scannable interface to NetScan 2021-09-15 16:34:21 +02:00
987dab9079 Uplift of Zutil 2021-09-10 22:19:02 +02:00
f2dfe7a88f Removed deconz 2021-09-09 17:53:07 +02:00
28ff89d07f Moved OAuth to the external http daemon and added OAuth2 store 2021-09-09 17:52:14 +02:00
20228d9e79 Fixed gradle config warning 2021-09-06 16:40:42 +02:00
b2d96b34b1 Bugfix 2021-09-06 16:34:20 +02:00
6cb0a2ddf0 Fixed ctrl-c for the gradle build 2021-09-06 16:17:11 +02:00
b94b33ecf1 Possibly fixed multiple listener addition 2021-09-06 16:05:32 +02:00
f27f7e4c81 Added google oath token to DB as the session was invalidated after restart. 2021-09-06 16:04:36 +02:00
48a139cdd5 bugfix 2021-08-30 01:52:38 +02:00
ce0f6ebd7c Switched to Integer 2021-08-30 01:50:19 +02:00
d00a13bb50 bugfix 2021-08-30 01:47:49 +02:00
1cbb44f714 Fixed casting issue 2021-08-30 01:46:39 +02:00
f5f3730281 Refactored event sending function to be more robust and thread safe 2021-08-30 01:42:34 +02:00
102d8aa266 Updated so that if a device data is not set then the latest one will be loaded from the DB 2021-08-30 01:39:29 +02:00
b1db199beb Refactored getController method 2021-08-30 01:32:26 +02:00
41357ed8dd Missed a check 2021-08-30 01:19:03 +02:00
4339239c33 Added more google traits and implemented execution function 2021-08-30 01:16:00 +02:00
08fd1b6edd Another fix 2021-08-29 22:24:32 +02:00
02f9d4fcb7 Another fix 2021-08-29 22:15:44 +02:00
17337e39ba Fixed another issue 2021-08-29 22:10:41 +02:00
b30248d973 Fixed null pointer exeption 2021-08-29 22:06:25 +02:00
41dfcd0e4f Seems google does not return custom data during query 2021-08-29 22:00:10 +02:00
870d9cbbab Some more bug fixes 2021-08-29 19:59:02 +02:00
fa80fbc114 Added Event devices to google assistant 2021-08-29 17:00:33 +02:00
2d30b9451b Temporarily disabled zip and tar packing 2021-08-29 15:01:44 +02:00
e863797030 bugfix 2021-08-29 14:57:03 +02:00
f4b9d46077 Removed unnecessary check 2021-08-29 14:53:16 +02:00
2d1e6f8f50 Fixed issue where external pages are not set 2021-08-29 14:16:42 +02:00
378d00b83e Zigbee plugin version uplift 2021-08-29 01:30:49 +02:00
8c369ed2e8 Uplift of zutil and updated documentation 2021-08-29 01:22:33 +02:00
9e58387ef7 Fixed recursive issue with dummy event and reduce update time for gui selections 2021-08-28 16:58:03 +02:00
5e31cea660 Added robustness for invalid IeeeAdresses 2021-08-28 16:52:24 +02:00
ed04b687ed Fixed issue where new devices was not showing up in the gui as selections 2021-08-28 16:46:55 +02:00
0cf4909df4 Removed some padding on trigger page 2021-08-28 16:29:51 +02:00
b700fdd8dd fixed comment 2021-08-28 16:12:58 +02:00
a21ac02333 Some bugfixes for multiple reports 2021-08-28 16:10:58 +02:00
17438db7a2 Made cron date time trigger more robust 2021-08-28 15:32:12 +02:00
870be06255 Moved external http server to a daemon 2021-08-28 14:09:41 +02:00
ee89eeb39d Uplift of zutil 2021-08-27 01:25:53 +02:00
291c4cb42a Added mDNS Daemon which will resolve hal.local domain 2021-08-26 21:21:55 +02:00
68c7755e7e Added exec permisison 2021-08-26 19:54:54 +01:00
48a62d819a Upgraded Zutil lib version 2021-08-22 16:09:43 +02:00
ac27882ad1 Fixed programmatically using a Certificate object for HttpServer 2021-08-22 02:11:06 +02:00
c197606204 Use existing certificate instead of doing the process all the time 2021-08-22 01:42:28 +02:00
d9ce3af5aa Fixed certificate handling 2021-08-20 23:10:13 +02:00
e8270d4027 Moved external HttpServer to hal-core and added SSL possibility through LestEncrypt 2021-08-05 16:41:40 +02:00
2dc35e212b Changed properties defined by .config file to be read only 2021-08-05 16:41:40 +02:00
e57d62471b Added hal.service file for systemd and updated the run script to support forground execution 2021-07-29 10:30:55 +01:00
5e3b103815 changed execution permission on run script 2021-07-28 15:46:15 +02:00
e1b2494835 updated run script to run gradle instead of ANT 2021-07-28 15:44:24 +02:00
c27556500e made gradlew executable 2021-07-28 15:32:09 +02:00
696cca0087 set a fixed zutil version dependency 2021-07-28 15:10:29 +02:00
9e6172caeb Added Zigbee attribute reading daemon 2021-07-23 23:35:19 +02:00
68054ebf4f Fixed zigbee on off events 2021-07-19 23:51:29 +02:00
203bb67f7f Added hal prefix to all config properties 2021-07-19 18:06:00 +02:00
4dfa80c17f Moved Zigbee DB things to its own package 2021-07-13 00:52:02 +02:00
3cd96cfc82 Some Zigbee bugfixes 2021-07-12 22:39:57 +02:00
bcc4133a31 Fixed some zigbee bugs 2021-07-12 00:35:25 +02:00
d6fc1390fd Fixed some bugs 2021-07-12 00:35:06 +02:00
55ceb0bf34 Small cleanup and fixed tests 2021-07-11 23:07:14 +02:00
6a81f5de16 Initial implementation of plugin DB upgrade support 2021-07-11 23:00:47 +02:00
aea0d9bab1 Added zigbee Hal DB data storage 2021-07-06 21:57:21 +02:00
52273e1ebe Hal now properly detects Zigbee sensors 2021-07-03 00:59:18 +02:00
902d87a9c5 Added overview Zigbee Node page for troubleshooting 2021-07-03 00:03:18 +02:00
81dc81a1ae Added scan button to Event and Sensor config pages 2021-07-02 00:42:11 +02:00
94bfbbd664 Removed generics from device listener and updated some js libs 2021-07-02 00:06:26 +02:00
53d471c0aa Changed device listener to be a list instead of single listener 2021-06-25 22:35:01 +02:00
8d9896f8b4 Refactored Zigbee attribute listener 2021-06-25 20:43:54 +02:00
3a49b15dea Added Zigbee attribute listener 2021-06-25 00:21:18 +02:00
1adaf8bc46 Updated vendore code exclusion as project now shows as majority javascript 2021-06-21 12:19:21 +02:00
267054e4ba Changed controllers to be singleton in the manager and moved isAvailable to AbstractController 2021-06-09 23:27:42 +02:00
a80a1c5cdc Added scanning button animation, detection of scannable controllers and scan start 2021-06-09 22:17:32 +02:00
6656882859 Added scan button to controller section 2021-06-09 20:53:10 +02:00
e662f7e29d More bug fixes for controller initiations 2021-06-09 20:35:54 +02:00
cf795be35f Fixed listing of controllers 2021-06-08 23:51:28 +02:00
1cc834f089 Made Hal more robust 2021-06-08 23:34:44 +02:00
132bd3b29d Downgraded zigbee framework to work with CC2531 dongle 2021-06-06 04:33:28 +02:00
d68c3cae54 Updated github language settings 2021-05-23 01:32:57 +02:00
e1618604c9 Updated with new Configurator changes and cleaned up imports 2021-05-08 01:41:13 +02:00
6109f66ea0 Updated to new Zutil naming 2021-05-07 00:17:38 +02:00
5716584772 Some small refactoring 2021-04-29 01:10:45 +02:00
edaa23f0f6 Fixed device reconfiguration, not tested though 2021-03-24 00:46:15 +01:00
5a1be3c2e4 Formatting cleanup 2021-03-23 21:54:29 +01:00
c7e286f51e Moved find device to its own utility method, and added a specific equals method and reworked some test. 2021-03-23 01:57:12 +01:00
7e8938c38c Renamed AbstractDevice to HalAbstractDevice and moved int intf package 2021-03-21 19:40:36 +01:00
8d51526481 Added architecture description 2021-03-21 19:37:17 +01:00
c0188cd5cc Refactoring of of inheritance structure, ControllerManagers will now also be able to be provided through plugins 2021-03-16 22:24:43 +01:00
28bc108921 Some cleanup in triggers page 2021-02-17 22:43:33 +01:00
0a1ce4fe60 Migrated to Zutil UserMessage class 2021-02-17 22:28:27 +01:00
1e0ec282ca Some troubleshooting on ZigBee plugin 2021-02-13 16:03:29 +01:00
6f39d31d5d Updated run permission 2021-02-09 00:14:21 +01:00
41b2eb6b07 Moved hal-default.db file into resource folder. 2021-01-29 21:56:43 +01:00
9ad529d9eb Added videojs player to play hls streams, fixed monitor web page 2021-01-29 21:40:54 +01:00
da3ba116da initial commit for NVR plugin 2021-01-26 01:53:11 +01:00
65581f13d5 Some small updates and fixes for Zigbee 2021-01-26 01:52:50 +01:00
326d773741 Fixed device pairing for ZigBee devices, endpoints not working still 2021-01-07 01:25:58 +01:00
3b949b13f7 ABle to connect to zigbee dongle now 2021-01-02 18:08:19 +01:00
6214c01157 Split switch event data into multiple classes 2021-01-02 04:25:04 +01:00
4499824965 Switched to use input and output streams 2021-01-02 04:05:45 +01:00
48e0c065b6 Started migration to new zigbee library 2021-01-02 01:20:59 +01:00
e59d65fac0 Small updates 2021-01-01 23:19:16 +01:00
3dbd626aee Moved out the pan id configuration 2021-01-01 22:20:17 +01:00
ee485c4466 Moved sync request to smart app 2021-01-01 22:19:51 +01:00
b60a7af9cd Added custom serial port implementation using JSerialComm 2020-12-26 01:35:03 +01:00
1c0340b9cf Updated readme files 2020-12-25 23:09:45 +01:00
dd1cc00c9d Added Zigbee plugin based on Zigbee4java 2020-12-25 23:08:42 +01:00
4f0398260b Moved current zigbee prototype into zigbee-deconz plugin and disabled plugin. 2020-12-25 18:21:02 +01:00
49318f3191 Small fixes 2020-12-16 22:30:58 +01:00
490655fb02 small change 2020-12-09 00:23:41 +01:00
907e8ee498 Fixed synchronization issues 2020-12-09 00:20:47 +01:00
d7a14a4899 Separated traits into their own classes, added humidity 2020-12-08 23:15:20 +01:00
a968c1a91e Added some more dummy sensors and improved the architecture 2020-12-08 23:14:36 +01:00
f4515f86c8 Dives now registered in Google Assistant but no data is displayed 2020-12-05 01:41:08 +01:00
7f22b2dee2 Some bugfixes 2020-12-05 01:00:08 +01:00
fc37d158c5 Added dummy plugin for simulated sensors 2020-12-05 00:08:29 +01:00
c6f90c42af Some more assistant progress, SYNC is now working but not yet returning devices 2020-12-05 00:07:41 +01:00
1b83d4180b Added description to plugins page 2020-12-05 00:03:12 +01:00
e54b53c974 Cleanup of sort function 2020-11-30 23:58:57 +01:00
fee3fd81a0 Fixed some things in assistant 2020-11-30 23:32:53 +01:00
ccc99033cd Now using Zutil Oauth code properly 2020-11-27 02:18:59 +01:00
03ae4329bc Migrated to new Oauth2 pages in Zutil 2020-11-22 23:26:00 +01:00
baaeddb9fb Make OAuth pages to follow spec 2020-11-20 00:36:29 +01:00
e0c464416d Fixed OAth2 pages, still some things to fix 2020-11-17 01:00:23 +01:00
43892798ef Some progress on G assistant api 2020-11-11 22:17:41 +01:00
64f2f598df Fixed resource path issues with gradle 2020-11-11 01:48:09 +01:00
b405f0b191 Fixed resource paths, still not working 2020-11-10 22:02:11 +01:00
ded778fd11 Fixed build dependency issues by moving hal core into hal-core folder/subproject 2020-11-10 18:36:02 +01:00
f1da2c5a4d Fixed build failures 2020-11-10 16:41:01 +01:00
9a44631a96 Fixing build issues 2020-11-10 16:40:31 +01:00
8fad681f01 With gradle the lib folder is no longer needed 2020-11-10 16:40:03 +01:00
0ca8bcab43 Removed TTS and STT code 2020-11-10 15:08:18 +01:00
51fa28bddf Updated plugin versions to indicate alpha status and changed back JSON page function parameters. 2020-09-05 14:13:35 +02:00
4a31b474c5 Added its own http server for Google Assistant api 2020-09-05 14:13:35 +02:00
9bca47d566 Added header parameters to JSON pages, Some cleanup of google assistant example code 2020-09-05 14:13:35 +02:00
0632804bd4 moved zwave config files 2020-08-31 17:03:42 +02:00
8362585b7b Updated readme files 2020-08-31 12:03:46 +02:00
67801e0c91 Including gradle wrapper 2020-08-28 23:22:29 +02:00
a49cb55b93 Switched to Gradle as build system 2020-08-28 23:09:15 +02:00
da36be0862 Updated plugin build files 2020-08-28 16:59:13 +02:00
5612a5e039 Added deConz interface 2020-07-28 14:08:35 +02:00
d003727113 added some more log printouts 2020-07-24 00:53:59 +02:00
c4968633ed fixed comment 2020-07-24 00:43:01 +02:00
12a6c1d31b Cleanedup property names 2020-07-24 00:39:11 +02:00
c3731ca4b4 Cleanup of property names 2020-07-24 00:25:58 +02:00
467a5ff068 small refactoring 2020-07-23 23:48:04 +02:00
d759ebcd77 Introduced AbstractController 2020-07-23 23:44:40 +02:00
267eda7afd Fixed test 2020-06-26 01:17:47 +02:00
b065d1136e Fixed PC web page definition 2020-06-26 01:15:04 +02:00
47afc78ee4 Moved PC to a plugin directory 2020-06-26 00:56:56 +02:00
fccc6a3609 Renamed PC 2020-06-26 00:00:28 +02:00
c7583d9d6f Incremented Zutil version 2020-06-25 23:37:20 +02:00
dc829b9487 Added the ability to enable or disable plugins on startup 2020-06-25 23:36:37 +02:00
b3f28c8276 Fixed wrong DNS entries 2020-06-25 23:25:38 +02:00
14c925d480 Added start of services 2020-06-25 17:01:28 +02:00
3f94756fa8 Clarified log text 2020-06-25 17:00:58 +02:00
b7eab6e3d0 Fixed zutil version link 2020-06-25 17:00:28 +02:00
eb63ff0a51 Moved event nav lower 2020-06-22 22:27:57 +02:00
edd5d0d083 Moved the smaller plugins to separate folders. 2020-06-22 22:26:53 +02:00
fc11ae264f Added plugin page for viewing plugin information 2020-06-22 22:16:50 +02:00
4f7476bb84 Renamed HalHttpPage to HalWebPage 2020-06-22 22:02:17 +02:00
cf3c922fa2 Added page for viewing properties. 2020-06-22 21:55:04 +02:00
584760b6ba New MQTT plugin 2020-06-22 16:30:07 +02:00
cb9838181f Fixed zutil dependecy issues 2020-06-22 16:29:44 +02:00
bc9d598bfe Added some comments 2020-06-22 14:58:44 +02:00
659d5ea0d2 Updated comment 2020-06-22 14:13:57 +02:00
2242401977 Updated parameter names 2020-06-22 14:07:03 +02:00
c3f2b91d72 Added missing file 2020-06-22 12:08:39 +02:00
e5cd72ec2d Fixed some issues 2020-06-22 11:47:36 +02:00
Ziver Koc
e777d4e3bf updated zutil download link 2020-01-21 10:54:08 +01:00
Ziver Koc
d12c378b4f Added config files for Zwave and added better logging 2019-11-23 00:36:57 +01:00
Ziver Koc
b7c7913c92 Moved main class into a test class 2019-11-22 21:05:55 +01:00
04864434a1 Fixed event data toggle 2019-11-12 14:52:31 +01:00
78189c8881 removed old plugin paths 2019-11-12 14:46:34 +01:00
09ae1b2667 Fixed merge issues 2019-11-12 14:27:04 +01:00
81a85320a2 Fixed build error 2019-11-12 14:16:54 +01:00
4c4a96b5e5 fixed git ignore and zutil download url 2019-11-12 14:16:49 +01:00
Ziver Koc
1b4f558e8d Fixed event details page state switch 2019-11-12 14:15:59 +01:00
Ziver Koc
a8ed1ef5a9 Update sensor configuration to use util function 2019-11-12 14:15:58 +01:00
Ziver Koc
86cab179a8 Added additional logging 2019-11-12 14:14:54 +01:00
Ziver Koc
efebd4c5ec Small code cleanup 2019-11-12 14:14:53 +01:00
Ziver Koc
5d21a0cc05 Added toggle witch to detail page 2019-11-12 14:12:24 +01:00
Ziver Koc
9de2ee1e3c Fixed Event config page 2019-11-12 14:12:24 +01:00
Ziver Koc
cff5685a61 remove old file 2019-11-12 14:11:42 +01:00
Ziver Koc
40b232422e Added zigbee skeleton plugin 2019-11-12 14:11:42 +01:00
Ziver Koc
b18becabad Added some more logging 2019-11-12 14:11:38 +01:00
Ziver Koc
7777972d97 Replaced zwave lib with OpenZwave 2019-11-12 14:11:38 +01:00
Ziver Koc
12673437da some refactoring in TellStickController 2019-11-12 14:11:37 +01:00
2f3dbf462e Added sorting by name in overview pages 2018-12-04 18:33:53 +01:00
6a15640aea changed indent to space and removed created by comment 2018-12-04 18:01:41 +01:00
8526e5157d fixed arduino timer issue 2018-12-03 22:28:05 +01:00
c1c923a2fc updated run.sh 2018-12-03 19:35:56 +01:00
b3c2d195b5 Added alert dismiss when sensor starts responding 2018-12-03 19:32:37 +01:00
6f6a764f97 Zutil upgrade 2018-12-03 19:21:15 +01:00
52a2cb207f fixed creating new event or sensor from autodetect 2018-12-03 19:19:39 +01:00
88d2b2cebf Added clear detected events button 2018-12-03 19:13:27 +01:00
a3a7409808 fixed event save issue 2018-12-03 19:07:30 +01:00
93a237ad17 Fixed sensor conf save issue 2018-12-03 19:05:51 +01:00
208655b465 Added clear button for detected sensors 2018-12-03 18:55:34 +01:00
68e695da67 Sensor list description update 2018-12-03 18:43:13 +01:00
02aaf46f2b change name of alert url template parameter 2018-12-03 18:41:14 +01:00
ca42cb71b9 Made title bold 2018-02-26 23:22:08 +01:00
60e5131850 Added description for flows and turn on and off option 2018-02-26 23:17:03 +01:00
89d4291168 Changed checkbox name and action 2018-02-26 22:40:17 +01:00
d33ebbfd25 Updated zwave libs with upstream jserialcomm implementaion 2018-02-26 21:29:40 +01:00
b8b0a1e62b updated jdk label 2017-10-17 16:29:07 +02:00
99c5608a1e updated zutil url 2017-10-15 17:49:12 +02:00
eab6c72800 Moved raspberry pi plugin into its own plugin folder 2017-08-29 16:03:26 +02:00
26ed8584c8 Split plugin ant targets into a abstract build.xml file 2017-08-29 15:52:23 +02:00
279c19272e Change run to do package-all 2017-07-29 21:03:37 +02:00
6e41f357b0 Fixed missed zwave dependency and added plugin folder to run classpath 2017-07-29 21:01:01 +02:00
9ccdee277c Added focus event to update charts 2017-07-29 20:44:55 +02:00
ca3de56e60 Some Zwave progress 2017-07-03 19:55:47 +02:00
04dec80d9a fixed eclipse paths? 2017-05-31 17:23:00 +02:00
9d698fa2bc Some bug fixes 2017-05-29 17:14:09 +02:00
27abb20728 fixed failing copy 2017-05-29 17:08:23 +02:00
da290e570f Mooved Tellstick plugin to plugin folder and added all targets to build xml 2017-05-29 17:05:02 +02:00
efdbc56859 Added build.xml for zwave plugin 2017-05-24 16:05:49 +02:00
c897c5ba60 Fixed not moved ZWave classes 2017-05-16 17:54:13 +02:00
fa3b6f35f5 Initial implementation of ZWave plugin 2017-05-16 17:21:34 +02:00
017b690437 initial ZWave implementation 2017-05-15 17:31:43 +02:00
84ba74b656 Reformatted example configuration file 2017-05-09 17:29:34 +02:00
052571a226 updated readme 2017-04-19 17:34:33 +02:00
1f7889e4f1 Fixed exception when removing triggers and actions. issue 52 2017-04-19 17:34:33 +02:00
f069aa69e6 Cleaned up html forms a bit 2017-04-19 17:34:33 +02:00
c438882f74 bugfix 2017-04-01 00:19:18 +02:00
3329695671 Added Sensor trigger 2017-03-30 18:13:11 +02:00
5b67dde4e4 small optimization 2017-03-30 17:55:37 +02:00
cc703e5091 Fixed small bug where aggregator ran even if there was no data to aggregate. issue 46 2017-03-23 16:25:39 +01:00
160c437430 cleaned up ping code 2017-03-18 18:34:04 +01:00
9abf7c0952 rename of remote debug target 2017-03-18 18:21:26 +01:00
dd163a797e Trying to fix consistent netscan pings 2017-03-18 18:20:29 +01:00
2b5182b56a Fixed run.sh and replaced depricated cmd in build.xml 2017-03-18 17:37:58 +01:00
5a222ba051 Changed cron trigger to reset when majority of minute is over 2017-03-18 17:13:51 +01:00
f0137b2161 run.sh will kill previous hal session 2017-03-16 17:02:11 +01:00
6b13f3527a Refactoring of duplicate JS form code 2017-03-16 17:01:49 +01:00
b688217ad0 DateTime will include current minute 2017-03-16 17:01:16 +01:00
09651491e3 Fixed bug where no triggers was evaluating to true 2017-03-16 17:00:52 +01:00
18b15569d6 Made netscan more robust by requiring two offline pings to report device as offline 2017-03-14 16:59:51 +01:00
9687f28eb0 bugfixes 2017-03-13 18:08:36 +01:00
fddaa34c30 Improved toString and added trigger on change option 2017-03-13 18:08:07 +01:00
b5024a063d Fixed issue with dynamic checkboxes 2017-03-13 18:07:29 +01:00
9af96a7cb2 Implementation of Event based triggering. issue 51 2017-03-10 16:59:07 +01:00
a020ec6668 Bugfix 2017-03-07 20:18:20 +01:00
da219e2105 Updated Zutil version 2017-03-07 18:12:53 +01:00
52357fd589 Updated and cleaned up old libs and refactored speech api. FIX 2017-03-07 18:12:11 +01:00
0c14bbb6a3 Updated and cleaned up old libs and refactored speech api 2017-03-07 18:11:13 +01:00
25b15e3fd2 Added delete button to flows. fixes issue 48 2017-03-06 16:15:47 +01:00
74bdd33a9c Added toString metods, and some robustness fixes in TriggerManager 2017-03-06 15:42:35 +01:00
2608ad0bfd Changed new trigger flow button to do post. fixed issue 47 2017-03-06 15:39:44 +01:00
0a77d3f400 Added ID fields to Event and Sensor detail page 2017-03-06 15:38:17 +01:00
1338f20624 Impl date time trigger and updated Zutil 2017-03-01 17:53:09 +01:00
90c1dd7e37 Refactored sensor detail page. issue 38 2017-02-27 18:54:00 +01:00
655de59490 Added fields to DateTimeTrigger 2017-02-24 18:44:49 +01:00
2c5026cdac Zutil update 2017-02-21 17:39:39 +01:00
65e396a472 Updated to new Zutil 2017-02-13 17:59:52 +01:00
1265c38d82 Implemented UI for editing Triggers and Actions 2017-02-10 18:11:52 +01:00
5170a151c8 Some more work on Triggers. issue 6 2017-02-09 17:03:40 +01:00
36f2509d94 Implemented instantiatiation of triggers and actions. issue 6 2017-02-08 17:23:34 +01:00
9fa687081a Split alert messages into title and msg, title should be unique 2017-01-30 17:31:06 +01:00
df9b41a843 Added som initial triggers. issue 43, issue 44 2017-01-30 17:17:47 +01:00
a1cb12f6ce Refactored storing logic of triggers and actions. issue 6 2017-01-30 17:16:56 +01:00
8d9354d845 Some more backend ui code for triggers. issue 6 2017-01-27 17:38:39 +01:00
115bf6efac Small refactoring of internal class 2017-01-27 17:37:19 +01:00
5814b2537f Added trigger page (incomplete). issue 6 2017-01-25 17:02:05 +01:00
1688a8b2e5 Some cleanup in the templates 2017-01-25 16:56:13 +01:00
33de44b166 Made alerts bold, fixed sensor not responding alert, refactored aggregator a small bit 2017-01-21 19:26:15 +01:00
0b41bbc446 Added alerts for non responding sensors and user actions. issue #32 2017-01-18 17:44:53 +01:00
c384a46863 Added gitattribute file to fix github wrongly marking the project as javascript heavy 2017-01-18 12:56:16 +01:00
4b24615f4f Implementation of DB read and store procedures for Actions and triggers(not tested). issue 6 2017-01-16 17:10:11 +01:00
44d5fa0227 improved auto start comments and log 2017-01-16 17:09:08 +01:00
f2e940cda1 Refactored main and added timed thread in TriggerManager. issue 6 2017-01-12 17:12:26 +01:00
274b708089 bugfix 2017-01-11 17:09:05 +01:00
dd1bb75192 initial implementation of triggers. issue 6 2017-01-11 17:01:55 +01:00
6a8040b529 artifact subfolders also 2017-01-10 17:50:51 +01:00
893122e111 Moved hal to Jenkins pipeline 2017-01-10 17:22:51 +01:00
89c65fb61f Added TC for ControllerManager class. issue 28 2017-01-03 16:29:19 +01:00
814c40afca Updated Zutil version 2016-12-27 04:53:57 +01:00
9eff27dbab Added no caching for json pages 2016-12-27 04:51:05 +01:00
d799e0a487 Disabled ping logging 2016-12-05 17:00:14 +01:00
172975d792 a couple of bug fixes:
- fixed sensor detail chart not showing data
- fixed? out ouf memory in PowerChalange page
- temporary fix for wrong / redirect
2016-12-01 14:51:31 +01:00
9e59b53546 fixed package name misspelling 2016-11-29 20:14:45 +01:00
909c8ea2b3 Implemented sensor filtering for json endpoint 2016-11-29 16:45:30 +01:00
d26a9d0018 build file now uses specific zutil build instead of latest 2016-11-29 16:27:31 +01:00
92f402a07b Created Json endpoints and separated json stuff from http pages, moved chart JS to common file. 2016-11-28 17:11:17 +01:00
969f089a9e Made aggregation period logging a bit more user friendly 2016-11-28 17:09:26 +01:00
9fd00f227a Split out core Hal stuff as plugins registered as "Hal Core" 2016-11-28 17:08:57 +01:00
0d0f0a4044 bugfix, forgot to add email column into deafult db 2016-11-19 18:14:18 +01:00
beff7da576 Added avatar to ext users in sensor config page. issue 39 2016-11-19 17:50:30 +01:00
5b2eabcfd3 Added Gravatar avatar icons. issue 39 2016-11-19 17:36:45 +01:00
dfa07de6c8 added email field to sync daemon. issue 39 2016-11-16 21:29:55 +01:00
a55064846f Added email field to user. issue 39 2016-11-16 21:29:05 +01:00
d90bc0f59f some changes to charts 2016-11-10 17:03:31 +01:00
0fac8b29f8 Finished change of chart api. issue 1 2016-11-09 16:57:58 +01:00
5a7d1042de updated some chart css 2016-11-08 17:23:13 +01:00
dd22551e65 New chart lib added, some problems exist 2016-11-07 17:07:11 +01:00
5de797cd8d bugfix 2016-11-06 20:15:25 +01:00
d795c27911 updated git ignore to include all screenlog files 2016-10-05 17:09:17 +02:00
26e38ed704 Added some more traces and an additional thread to the netscan pool as the network scan will block the ping for 5 min 2016-10-05 16:40:38 +02:00
45eabe2845 bugfix 2016-10-04 22:16:08 +02:00
23f0645581 Fixed bug where local data was only cleared for the first sensor 2016-10-04 22:08:44 +02:00
bf303604bd Merge remote-tracking branch 'origin/master' 2016-10-04 21:57:05 +02:00
5df0bd1f28 Fixed issue 33 where confidence index was throwing off the average calculations 2016-10-04 21:56:56 +02:00
32a48a753a Zutil updates and NetScan now only triggers on IP state changes and now is listening to the ipscan parameter 2016-10-04 17:03:37 +02:00
49ec412fff Updated readme file 2016-10-04 17:01:21 +02:00
e4ceb609be Fixed local address issue in linux 2016-10-03 20:50:40 +02:00
b30fcba967 Some updates to ip scanner 2016-10-03 17:48:00 +02:00
e7b3c4ba5a fixed sensor not sleeping 2016-10-02 21:30:14 +02:00
ffe721ab97 tc updates 2016-10-02 21:29:50 +02:00
0a9bca2804 Implemented network scanner 2016-10-02 01:47:35 +02:00
990db6a74a initial implementation of netscanner plugin 2016-09-30 16:59:55 +02:00
173d01a275 updated readme 2016-09-28 18:58:16 +02:00
c5ce7df958 Added map sensor data text 2016-09-23 16:20:15 +02:00
0c64d4d1ad Updated README.md file 2016-09-23 15:51:40 +02:00
d099a76ca5 Revert: remove HalSensorData 2016-09-20 19:05:06 +02:00
2cef2053a1 added readme file 2016-09-14 21:01:12 +02:00
6e745acaa5 bugfix 2016-08-30 19:53:13 +02:00
726fc3e955 fixed event icons and added 10s refresh to map 2016-08-30 19:50:05 +02:00
b9d684fbbc Converted map icons to svg and added off for lights 2016-08-30 17:13:18 +02:00
1a6025de6d Fixed junit test for nexa 2016-08-30 11:10:16 +02:00
6839ad1a53 Fixed issue 35 where device configuration params was not showing 2016-08-30 11:04:55 +02:00
b21a28e3a4 Fixes issue 34
nexa transmission issue
2016-08-29 22:59:57 +02:00
6cf1415285 bugfix, fixed send from website 2016-08-29 19:22:23 +02:00
2b9be4f09c bugfix 2016-08-29 19:17:26 +02:00
b6e902feb6 bugfix 2016-08-29 19:10:04 +02:00
69544b4552 bugfix 2016-08-29 19:08:15 +02:00
30530c0648 bugfix 2016-08-29 19:04:36 +02:00
41c15c68c8 Ignoring 0 humidity 2016-08-29 18:48:44 +02:00
beac1c34c4 Added some robustness 2016-08-29 18:42:34 +02:00
d3cd7287d5 Partiallly added Dimmer decoding 2016-08-29 17:13:24 +02:00
c0e2fccce5 Added NexaDimmer and Cmd classes to simplify sending tellstick commands 2016-08-29 17:04:20 +02:00
5351e56be7 Oregon is now registering unregistered reception 2016-08-26 22:05:26 +02:00
3574f7a433 Fixed nullpointer crash 2016-08-26 17:07:09 +02:00
439be77a8b bugfix, fixed retrieval of sensors 2016-08-25 22:57:24 +02:00
68265759ba bugfix, fixed unicode 2016-08-25 22:53:07 +02:00
197d554bee bugfix, updated sensor column 2016-08-25 22:45:11 +02:00
889f9fc85f AbstractDevice was not loading latest DeviceData at startup 2016-08-25 22:15:45 +02:00
3cb72a1d17 small fixes 2016-08-25 21:37:35 +02:00
72bd17569d bugfix, missed method name rename 2016-08-25 21:27:29 +02:00
e7655b380e bugfix, null check before switch 2016-08-25 21:21:18 +02:00
d622648bab Bugfix 2016-08-25 21:11:19 +02:00
23df77f898 Merge remote-tracking branch 'origin/master' into device_refactoring 2016-08-25 16:55:56 +02:00
73a36dfcca Adde toString methods to all SensorData types 2016-08-25 16:53:47 +02:00
fa9f7aed2b OregonProtocol now supports multiple types of SensorData 2016-08-25 16:49:42 +02:00
d91d5c5b81 Added missing licence file for tellstick reference code 2016-08-25 16:24:15 +02:00
3fd3b0430f Updated plugin files and added Upgrade post work 2016-08-24 17:27:16 +02:00
c50e50305f Added enum configuration to Oregon and updated configuration pages to show new device structure correctly 2016-08-24 17:26:36 +02:00
cee57cba93 Powering down adc 2016-08-22 17:13:08 +02:00
95240dd392 Added data class getter in device config so that we can load generic device data 2016-08-22 16:58:38 +02:00
6b4b565a62 updated some log traces and plugin files 2016-08-19 16:38:03 +02:00
253e359483 Added Tellstic sensor test 2016-08-19 16:25:18 +02:00
b405c12293 more bugfixes 2016-08-19 16:09:11 +02:00
aeef862ab4 bug fix 2016-08-19 16:02:50 +02:00
d692c30bd9 Refactored remaining code (RPi Plugin) 2016-08-19 15:55:00 +02:00
3a8bb12bab Fixed test cases 2016-08-18 16:43:05 +02:00
a9b8799f21 Finnished major refactoring of Telstick plugin 2016-08-18 16:27:57 +02:00
3bdb4ea043 Some progress 2016-08-17 16:45:02 +02:00
52afc53660 Initial refactoring of device structure 2016-08-17 15:46:10 +02:00
1526e58b06 Preparations for a major refactoring 2016-08-16 16:12:44 +02:00
bd54762bac Removed old arduino code that has been replaced by HalMultiSensor 2016-08-16 15:58:30 +02:00
21ab281ec6 Added Junit test for Tellstick Controller and reverted equals(Hal...) as it was causing unforeseen issues. 2016-08-15 17:36:46 +02:00
2c1ccb8b57 Concurrency fixes 2016-07-28 15:31:45 +02:00
5f230a921d Fixed issue where user set params on DeviceData is reset when new sensor data is registered. 2016-07-19 01:07:52 +02:00
7155b98934 Fixed null items for longer sensor intervals 2016-07-18 19:57:23 +02:00
78895b2354 bug fixes 2016-07-18 18:52:48 +02:00
858a3eb6ff bugfix 2016-07-17 03:15:52 +02:00
887 changed files with 98162 additions and 368445 deletions

View file

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="lib" path="external/marytts-5.1.2/lib/icu4j-54.1.1.jar"/>
<classpathentry kind="lib" path="external/marytts-5.1.2/lib/marytts-client-5.1.2-jar-with-dependencies.jar"/>
<classpathentry kind="lib" path="external/marytts-5.1.2/lib/marytts-lang-en-5.1.2.jar"/>
<classpathentry kind="lib" path="external/marytts-5.1.2/lib/marytts-lang-sv-5.1.2.jar"/>
<classpathentry kind="lib" path="external/marytts-5.1.2/lib/marytts-runtime-5.1.2-jar-with-dependencies.jar"/>
<classpathentry kind="lib" path="external/marytts-5.1.2/lib/voice-cmu-slt-hsmm-5.1.2.jar"/>
<classpathentry kind="lib" path="lib/Ab.jar"/>
<classpathentry kind="lib" path="lib/commons-math3-3.5.jar"/>
<classpathentry kind="lib" path="lib/marytts-client-5.1.2-jar-with-dependencies.jar"/>
<classpathentry kind="lib" path="lib/marytts-runtime-5.1.2-jar-with-dependencies.jar"/>
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="lib" path="lib/java-speech-api-master.jar"/>
<classpathentry kind="lib" path="lib/sphinx4-core.jar"/>
<classpathentry kind="lib" path="lib/sqlite-jdbc-3.8.11.2_HACKED_FOR_RPI.jar"/>
<classpathentry kind="lib" path="lib/jSerialComm-1.3.10.jar"/>
<classpathentry kind="lib" path="lib/pi4j-core-1.1-SNAPSHOT.jar" sourcepath="external/pi4j-1.1/pi4j-core-sources-1.1-SNAPSHOT.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/hal/external/pi4j-1.1/pi4j-core-javadoc-1.1-SNAPSHOT.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/pi4j-device-1.1-SNAPSHOT.jar" sourcepath="external/pi4j-1.1/pi4j-device-sources-1.1-SNAPSHOT.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/hal/external/pi4j-1.1/pi4j-device-javadoc-1.1-SNAPSHOT.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/pi4j-gpio-extension-1.1-SNAPSHOT.jar" sourcepath="external/pi4j-1.1/pi4j-gpio-extension-sources-1.1-SNAPSHOT.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/hal/external/pi4j-1.1/pi4j-gpio-extension-javadoc-1.1-SNAPSHOT.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/pi4j-service-1.1-SNAPSHOT.jar" sourcepath="external/pi4j-1.1/pi4j-service-sources-1.1-SNAPSHOT.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/hal/external/pi4j-1.1/pi4j-service-javadoc-1.1-SNAPSHOT.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/zutil-java"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="build"/>
</classpath>

5
.gitattributes vendored Normal file
View file

@ -0,0 +1,5 @@
# Github language stats file
external/* linguist-vendored
lib/* linguist-vendored
*.css linguist-vendored
*.js linguist-vendored

15
.gitignore vendored Executable file → Normal file
View file

@ -1,5 +1,14 @@
/screenlog.0 # Configuration and dependencies
/hal.conf /hal.conf
/hal.db* /hal.db*
/build/ /lib/zutil-*
/lib/Zutil.jar /recordings/
# Runtime files
/screenlog.0*
/OZW_Log.txt
# Build and Ide files
build
.gradle
.idea

View file

@ -1,17 +0,0 @@
<?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>

39
Hal.iml
View file

@ -1,39 +0,0 @@
<?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" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<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/jSerialComm-1.3.10-sources.jar!/" />
</SOURCES>
<jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
</library>
</orderEntry>
<orderEntry type="module" module-name="Zutil" exported="" />
<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>

35
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,35 @@
// Jenkinsfile (Pipeline Script)
node {
// Configure environment
env.JAVA_HOME = tool name: 'jdk-11'
env.REPO_URL = "repo.koc.se/hal.git" //scm.getUserRemoteConfigs()[0].getUrl()
env.BUILD_NAME = "BUILD-${env.BUILD_ID}"
checkout scm
stage('Build') {
sh './gradlew clean'
sh './gradlew build'
}
stage('Test') {
try {
sh './gradlew test'
} finally {
junit testResults: '**/build/test-results/test/*.xml'
}
}
stage('Package') {
sh './gradlew distZip'
archiveArtifacts artifacts: 'build/distributions/Hal.zip', fingerprint: true
// Tag artifact
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'f8e5f6c6-4adb-4ab2-bb5d-1c8535dff491',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
sh "git tag ${env.BUILD_NAME}"
sh "git push 'https://${USERNAME}:${PASSWORD}@${env.REPO_URL}' ${env.BUILD_NAME}"
}
}
}

2
LICENSE.txt Executable file → Normal file
View file

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2016 Daniel Collin, Ziver Koc Copyright (c) 2016-2025 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

104
README.md Normal file
View file

@ -0,0 +1,104 @@
# Hal
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
Sensors and other input devices can be supported.
Features:
- **Map**, Set up a house map with sensors and events mapped on a floorplan
- **Triggers and Actions**, IFTTT type functionality
- **Power;Challenge**, Sync power or sensor usage between friends to challenge each other to lower the power usage
- **[Google Assistant Integration](plugins/hal-assistant-google/READNME.md)**
Currently supported devices:
- **Network Scanner**, IP scanner to detect devices on local network
- **NUT**, Linux UPS daemon
- **Tellstick**, Supported devices:
- NexaSelfLearning
- Oregon0x1A2D
- **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.
### Screenshots
![Week Graph](screenshot_01.jpg)
![Home Map](screenshot_02.jpg)
![Sensor Overview](screenshot_03.jpg)
![Event Overview](screenshot_04.jpg)
## Installing
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:
```
./gradlew run
```
Check `hal.conf.example` for available configuration options.
By default, HAL server will be listening to http://localhost:8080.
## Running the tests
The current test coverage is greatly lacking, but to run the available JUnit
test-cases run:
```
./gradlew test
```
## Architecture
```
HalAbstractControlerManager
|
| HalAbstractController
| |
| | HalAbstractDevice
| | |
.-----------. .------------. .--------.
| | | | | |
| | | | ----> | Device |
| | | | | |
| | ----> | Controller | '--------'
| | | | .--------.
| | | | | |
| Manager | | | ----> | Device |
| | | | | |
| | '------------' '--------'
| | .------------. .--------.
| | | | | |
| | ----> | Controller | ----> | Device |
| | | | | |
'-----------' '------------' '--------'
```
## Authors
* **Daniel Collin**
* **Ziver Koc**
## License
This project is licensed under the MIT License - see the
[LICENSE.txt](LICENSE.txt) file for details
## Acknowledgments
* Tellstick, for open-sourcing their code

11
arduino/HalMultiSensor/HalConfiguration.h Executable file → Normal file
View file

@ -6,24 +6,25 @@
#define TIMER_MILLISECOND 60000 // poling in minutes #define TIMER_MILLISECOND 60000 // poling in minutes
#define INDICATOR_PIN 13 // diode #define INDICATOR_PIN 13 // diode
#define DEVICE_BASE_ID 20 #define TX_PIN 11
#define DEVICE_BASE_ID 99
// POWER CONSUMPTION SENSOR // POWER CONSUMPTION SENSOR
//#define POWERCON_ENABLED // comment out to disable sensor //#define POWERCON_ENABLED // comment out to disable sensor
#define POWERCON_SENSOR SensorPhotocell() #define POWERCON_SENSOR SensorPhotocell()
#define POWERCON_PROTOCOL ProtocolOregon(11, DEVICE_BASE_ID + 1) #define POWERCON_PROTOCOL ProtocolOregon(TX_PIN, DEVICE_BASE_ID + 0)
#define POWER_TIMER_MULTIPLIER 1 #define POWER_TIMER_MULTIPLIER 1
// TEMPERATURE SENSOR // TEMPERATURE SENSOR
#define TEMPERATURE_ENABLED // comment out to disable sensor #define TEMPERATURE_ENABLED // comment out to disable sensor
#define TEMPERATURE_SENSOR SensorDHT(DHT11, 10) #define TEMPERATURE_SENSOR SensorDHT(DHT11, 10)
#define TEMPERATURE_PROTOCOL ProtocolOregon(11, DEVICE_BASE_ID + 2) #define TEMPERATURE_PROTOCOL ProtocolOregon(TX_PIN, DEVICE_BASE_ID + 1)
#define TEMPERATURE_TIMER_MULTIPLIER 10 #define TEMPERATURE_TIMER_MULTIPLIER 10
// LIGHT SENSOR // LIGHT SENSOR
#define LIGHT_ENABLED // comment out to disable sensor //#define LIGHT_ENABLED // comment out to disable sensor
#define LIGHT_SENSOR SensorBH1750() #define LIGHT_SENSOR SensorBH1750()
#define LIGHT_PROTOCOL ProtocolOregon(11, DEVICE_BASE_ID + 3) #define LIGHT_PROTOCOL ProtocolOregon(TX_PIN, DEVICE_BASE_ID + 2)
#define LIGHT_TIMER_MULTIPLIER 10 #define LIGHT_TIMER_MULTIPLIER 10

0
arduino/HalMultiSensor/HalInclude.h Executable file → Normal file
View file

0
arduino/HalMultiSensor/HalInterfaces.h Executable file → Normal file
View file

9
arduino/HalMultiSensor/HalMultiSensor.ino Executable file → Normal file
View file

@ -10,6 +10,15 @@ the data to a central location.
#include "Interrupt.h" #include "Interrupt.h"
#ifndef POWERCON_ENABLED
#define POWER_TIMER_MULTIPLIER 1
#endif
#ifndef TEMPERATURE_ENABLED
#define TEMPERATURE_TIMER_MULTIPLIER 1
#endif
#ifndef LIGHT_ENABLED
#define LIGHT_TIMER_MULTIPLIER 1
#endif
#define TIMER_MULTIPLIER_MAX \ #define TIMER_MULTIPLIER_MAX \
POWER_TIMER_MULTIPLIER * TEMPERATURE_TIMER_MULTIPLIER * LIGHT_TIMER_MULTIPLIER POWER_TIMER_MULTIPLIER * TEMPERATURE_TIMER_MULTIPLIER * LIGHT_TIMER_MULTIPLIER
unsigned int timerMultiplier = 0; unsigned int timerMultiplier = 0;

0
arduino/HalMultiSensor/HalMultiSensorEnclosure.FCStd Executable file → Normal file
View file

View file

0
arduino/HalMultiSensor/HalMultiSensorEnclosure_top.stl Executable file → Normal file
View file

25
arduino/HalMultiSensor/Interrupt.cpp Executable file → Normal file
View file

@ -35,14 +35,16 @@ void Interrupt::sleep()
sleep_enable(); // enables the sleep bit in the mcucr register sleep_enable(); // enables the sleep bit in the mcucr register
// so sleep is possible. just a safety pin // so sleep is possible. just a safety pin
/*
power_adc_disable(); //power_adc_disable();
power_spi_disable(); //power_spi_disable();
power_timer0_disable(); //power_usart0_disable();
power_timer1_disable(); //power_timer0_disable();
power_timer2_disable(); //power_timer1_disable();
power_twi_disable(); //power_timer2_disable();
*/ //power_twi_disable();
//power_all_disable();
while( ! Interrupt::wakeUpNow) while( ! Interrupt::wakeUpNow)
{ {
sleep_mode(); // here the device is actually put to sleep!! sleep_mode(); // here the device is actually put to sleep!!
@ -51,6 +53,13 @@ void Interrupt::sleep()
sleep_disable(); // first thing after waking from sleep: sleep_disable(); // first thing after waking from sleep:
// disable sleep... // disable sleep...
//power_adc_enable();
//power_spi_enable();
//power_usart0_enable();
//power_timer0_enable();
//power_timer1_enable();
//power_timer2_enable();
//power_twi_enable();
//power_all_enable(); // during normal running time. //power_all_enable(); // during normal running time.
} }

0
arduino/HalMultiSensor/Interrupt.h Executable file → Normal file
View file

0
arduino/HalMultiSensor/ProtocolNexa.cpp Executable file → Normal file
View file

0
arduino/HalMultiSensor/ProtocolNexa.h Executable file → Normal file
View file

4
arduino/HalMultiSensor/ProtocolOregon.cpp Executable file → Normal file
View file

@ -127,9 +127,9 @@ inline void ProtocolOregon::calculateAndSetChecksum(byte data[])
for(byte i = 0; i<8;i++) for(byte i = 0; i<8;i++)
{ {
sum += (data[i]&0xF0) >> 4; sum += (data[i]&0xF0) >> 4;
sum += (data[i]&0xF); sum += (data[i]&0x0F);
} }
data[8] = ((sum - 0xa) & 0xFF); data[8] = ((sum - 0x0A) & 0xFF);
} }

0
arduino/HalMultiSensor/ProtocolOregon.h Executable file → Normal file
View file

7
arduino/HalMultiSensor/SensorBH1750.cpp Executable file → Normal file
View file

@ -51,7 +51,7 @@ based on Christopher Laws, March, 2013 code.
void SensorBH1750::setup() { void SensorBH1750::setup() {
Wire.begin(); Wire.begin();
configure(BH1750_ONE_TIME_HIGH_RES_MODE); //configure(BH1750_ONE_TIME_HIGH_RES_MODE);
} }
@ -78,11 +78,12 @@ void SensorBH1750::configure(uint8_t mode) {
void SensorBH1750::read(LightData& data) { void SensorBH1750::read(LightData& data) {
uint16_t level; configure(BH1750_ONE_TIME_HIGH_RES_MODE);
_delay_ms(200); // Wait for measurement
Wire.beginTransmission(BH1750_I2CADDR); Wire.beginTransmission(BH1750_I2CADDR);
Wire.requestFrom(BH1750_I2CADDR, 2); Wire.requestFrom(BH1750_I2CADDR, 2);
level = Wire.read(); uint16_t level = Wire.read();
level <<= 8; level <<= 8;
level |= Wire.read(); level |= Wire.read();
Wire.endTransmission(); Wire.endTransmission();

0
arduino/HalMultiSensor/SensorBH1750.h Executable file → Normal file
View file

0
arduino/HalMultiSensor/SensorDHT.cpp Executable file → Normal file
View file

0
arduino/HalMultiSensor/SensorDHT.h Executable file → Normal file
View file

0
arduino/HalMultiSensor/SensorPhotocell.cpp Executable file → Normal file
View file

0
arduino/HalMultiSensor/SensorPhotocell.h Executable file → Normal file
View file

View file

@ -1,76 +0,0 @@
#include "BH1750FVI.h"
BH1750FVI::BH1750FVI(){ }
void BH1750FVI::begin(void){
Wire.begin();
I2CWriteTo(Power_On ); //Turn it On
pinMode(AddrPin,OUTPUT);
digitalWrite(AddrPin,HIGH);
}
void BH1750FVI::Sleep(void){
I2CWriteTo(Power_Down ); //Turn it off , Reset operator won't work in this mode
}
void BH1750FVI::Reset(void){
I2CWriteTo(Power_On ); //Turn it on again
I2CWriteTo(reset ); //Reset
}
void BH1750FVI::SetAddress(uint8_t add){
switch (add){
case Device_Address_L:
address_value=Device_Address_L;
digitalWrite(AddrPin,LOW);
state=false;
break;
case Device_Address_H:
address_value=Device_Address_H;
digitalWrite(AddrPin,HIGH);
state=true;
break;
}
}
void BH1750FVI::SetMode(uint8_t MODE){
switch(MODE){
case Continuous_H_resolution_Mode:
break;
case Continuous_H_resolution_Mode2:
break;
case Continuous_L_resolution_Mode:
break;
case OneTime_H_resolution_Mode:
break;
case OneTime_H_resolution_Mode2:
break;
case OneTime_L_resolution_Mode:
break;
}
delay(10);
I2CWriteTo(MODE);
}
uint16_t BH1750FVI::GetLightIntensity(void){
uint16_t Intensity_value;
if(state ==true){
Wire.beginTransmission(Device_Address_H);
Wire.requestFrom(Device_Address_H, 2);
}
if(state ==false){
Wire.beginTransmission(Device_Address_L);
Wire.requestFrom(Device_Address_L, 2);
}
Intensity_value = Wire.read();
Intensity_value <<= 8;
Intensity_value |= Wire.read();
Wire.endTransmission();
Intensity_value=Intensity_value/1.2;
return Intensity_value;
}
void BH1750FVI::I2CWriteTo(uint8_t DataToSend){
Wire.beginTransmission(address_value);
Wire.write(DataToSend);
Wire.endTransmission();
}

View file

@ -1,69 +0,0 @@
/* This library for Digital Light sensor BH1750FVI
use I2C Communication protocal , SDA,SCL Are required
to interface with this sensor
pin configuration :
VCC >>> 3.3V
SDA >>> A4
SCL >>> A5
ADDR >> A3 "Optional"
GND >>> gnd
written By : Mohannad Rawashdeh
www.genotronex.com
*/
#ifndef BH1750FVI_h
#define BH1750FVI_h
#include <Arduino.h>
#include <Wire.h>
#define Device_Address_L 0x23 // Device address when address pin LOW
#define Device_Address_H 0x5C // Device address when address pin LOW
//all command here taken from Data sheet OPECODE Table page 5
#define Power_Down 0x00
#define Power_On 0x01
#define reset 0x07
#define Continuous_H_resolution_Mode 0x10
#define Continuous_H_resolution_Mode2 0x11
#define Continuous_L_resolution_Mode 0x13
#define OneTime_H_resolution_Mode 0x20
#define OneTime_H_resolution_Mode2 0x21
#define OneTime_L_resolution_Mode 0x23//As well as address value
#define AddrPin 17 // Address pin enable
class BH1750FVI {
public:
BH1750FVI();
void begin(void);
void Sleep(void);
void SetMode(uint8_t MODE);
void Reset(void);
void SetAddress(uint8_t add);
uint16_t GetLightIntensity(void);
private:
void I2CWriteTo(uint8_t DataToSend);
byte address_value;
boolean state;
};
#endif

View file

@ -1,289 +0,0 @@
/*
* Protocol: Oregon V2.1
* Emulating sensor: THGR2228N
*/
#include <OneWire.h>
#include <DallasTemperature.h>
#define TEMP_SENSOR_PIN 9
OneWire oneWire(TEMP_SENSOR_PIN);
DallasTemperature tempSensors(&oneWire);
const byte TX_PIN = 10;
const byte LED_PIN = 13;
const unsigned long TIME = 512;
const unsigned long TWOTIME = TIME*2;
#define SEND_HIGH() digitalWrite(TX_PIN, HIGH)
#define SEND_LOW() digitalWrite(TX_PIN, LOW)
byte OregonMessageBuffer[9];
unsigned long previousTime = 0;
unsigned long currentTime = millis();
void setup()
{
Serial.begin(9600);
pinMode(TX_PIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
SEND_LOW();
byte ID[] = { 0x1A,0x2D }; //temperature/humidity sensor (THGR2228N)
setType(OregonMessageBuffer, ID);
setChannel(OregonMessageBuffer, 0x20);
tempSensors.begin();
}
boolean light = false;
void loop()
{
currentTime = millis();
if(currentTime - previousTime > 5000) {
previousTime = currentTime;
tempSensors.requestTemperatures();
float temp = tempSensors.getTempCByIndex(0);
Serial.print("temp = ");
Serial.println(temp);
send433(temp,0,0xBB);
delay(500);
}
}
void send433(float temperature, byte humidity, byte Identitet)
{
digitalWrite(LED_PIN, HIGH);
setId(OregonMessageBuffer, Identitet); //set id of the sensor, BB=187
setBatteryLevel(OregonMessageBuffer, 1); // 0 : low, 1 : high
setTemperature(OregonMessageBuffer, temperature); //org setTemperature(OregonMessageBuffer, 55.5);
setHumidity(OregonMessageBuffer, humidity);
calculateAndSetChecksum(OregonMessageBuffer);
// Show the Oregon Message
for (byte i = 0; i < sizeof(OregonMessageBuffer); ++i) {
Serial.print(OregonMessageBuffer[i] >> 4, HEX);
Serial.print(OregonMessageBuffer[i] & 0x0F, HEX);
}
Serial.println();
// Send the Message over RF
sendOregon(OregonMessageBuffer, sizeof(OregonMessageBuffer));
// Send a "pause"
SEND_LOW();
delayMicroseconds(TWOTIME*8);
// Send a copie of the first message. The v2.1 protocol send the message two time
sendOregon(OregonMessageBuffer, sizeof(OregonMessageBuffer));
SEND_LOW();
digitalWrite(LED_PIN, LOW);
}
inline void setId(byte *data, byte ID)
{
data[3] = ID;
}
void setBatteryLevel(byte *data, byte level)
{
if(!level) data[4] = 0x0C;
else data[4] = 0x00;
}
void setTemperature(byte *data, float temp)
{
// Set temperature sign
if(temp < 0)
{
data[6] = 0x08;
temp *= -1;
}
else
{
data[6] = 0x00;
}
// Determine decimal and float part
int tempInt = (int)temp;
int td = (int)(tempInt / 10);
int tf = (int)round((float)((float)tempInt/10 - (float)td) * 10);
int tempFloat = (int)round((float)(temp - (float)tempInt) * 10);
// Set temperature decimal part
data[5] = (td << 4);
data[5] |= tf;
// Set temperature float part
data[4] |= (tempFloat << 4);
}
void setHumidity(byte* data, byte hum)
{
data[7] = (hum/10);
data[6] |= (hum - data[7]*10) << 4;
}
void calculateAndSetChecksum(byte* data)
{
int sum = 0;
for(byte i = 0; i<8;i++)
{
sum += (data[i]&0xF0) >> 4;
sum += (data[i]&0xF);
}
data[8] = ((sum - 0xa) & 0xFF);
}
//*********************************************************************************************************
/**
* \brief Send logical "0" over RF
* \details azero bit be represented by an off-to-on transition
* \ of the RF signal at the middle of a clock period.
* \ Remenber, the Oregon v2.1 protocol add an inverted bit first
*/
inline void sendZero(void)
{
SEND_HIGH();
delayMicroseconds(TIME);
SEND_LOW();
delayMicroseconds(TWOTIME);
SEND_HIGH();
delayMicroseconds(TIME);
}
/**
* \brief Send logical "1" over RF
* \details a one bit be represented by an on-to-off transition
* \ of the RF signal at the middle of a clock period.
* \ Remenber, the Oregon v2.1 protocol add an inverted bit first
*/
inline void sendOne(void)
{
SEND_LOW();
delayMicroseconds(TIME);
SEND_HIGH();
delayMicroseconds(TWOTIME);
SEND_LOW();
delayMicroseconds(TIME);
}
/**
* \brief Send a bits quarter (4 bits = MSB from 8 bits value) over RF
* \param data Data to send
*/
inline void sendQuarterMSB(const byte data)
{
(bitRead(data, 4)) ? sendOne() : sendZero();
(bitRead(data, 5)) ? sendOne() : sendZero();
(bitRead(data, 6)) ? sendOne() : sendZero();
(bitRead(data, 7)) ? sendOne() : sendZero();
}
/**
* \brief Send a bits quarter (4 bits = LSB from 8 bits value) over RF
* \param data Data to send
*/
inline void sendQuarterLSB(const byte data)
{
(bitRead(data, 0)) ? sendOne() : sendZero();
(bitRead(data, 1)) ? sendOne() : sendZero();
(bitRead(data, 2)) ? sendOne() : sendZero();
(bitRead(data, 3)) ? sendOne() : sendZero();
}
/******************************************************************/
/******************************************************************/
/******************************************************************/
/**
* \brief Send a buffer over RF
* \param data Data to send
* \param size size of data to send
*/
void sendData(byte *data, byte size)
{
for(byte i = 0; i < size; ++i)
{
sendQuarterLSB(data[i]);
sendQuarterMSB(data[i]);
}
}
/**
* \brief Send an Oregon message
* \param data The Oregon message
*/
void sendOregon(byte *data, byte size)
{
sendPreamble();
//sendSync();
sendData(data, size);
sendPostamble();
}
/**
* \brief Send preamble
* \details The preamble consists of 16 "1" bits
*/
inline void sendPreamble(void)
{
byte PREAMBLE[]={
0xFF,0xFF };
sendData(PREAMBLE, 2);
}
/**
* \brief Send postamble
* \details The postamble consists of 8 "0" bits
*/
inline void sendPostamble(void)
{
byte POSTAMBLE[]={
0x00 };
sendData(POSTAMBLE, 1);
}
/**
* \brief Send sync nibble
* \details The sync is 0xA. It is not use in this version since the sync nibble
* \ is include in the Oregon message to send.
*/
inline void sendSync(void)
{
sendQuarterLSB(0xA);
}
/******************************************************************/
/******************************************************************/
/******************************************************************/
/**
* \brief Set the sensor type
* \param data Oregon message
* \param type Sensor type
*/
inline void setType(byte *data, byte* type)
{
data[0] = type[0];
data[1] = type[1];
}
/**
* \brief Set the sensor channel
* \param data Oregon message
* \param channel Sensor channel (0x10, 0x20, 0x30)
*/
inline void setChannel(byte *data, byte channel)
{
data[2] = channel;
}

View file

@ -1,80 +0,0 @@
#include "BH1750FVI.h"
#include "Arduino.h"
BH1750FVI::BH1750FVI(){
}
void BH1750FVI::begin(void){
Wire.begin();
I2CWriteTo(Power_On ); //Turn it On
pinMode(AddrPin,OUTPUT);
digitalWrite(AddrPin,HIGH);
}
void BH1750FVI::Sleep(void){
I2CWriteTo(Power_Down ); //Turn it off , Reset operator won't work in this mode
}
void BH1750FVI::Reset(void){
I2CWriteTo(Power_On ); //Turn it on again
I2CWriteTo(reset ); //Reset
}
void BH1750FVI::SetAddress(uint8_t add){
switch (add){
case Device_Address_L:
address_value=Device_Address_L;
digitalWrite(AddrPin,LOW);
state=false;
break;
case Device_Address_H:
address_value=Device_Address_H;
digitalWrite(AddrPin,HIGH);
state=true;
break;
}
}
void BH1750FVI::SetMode(uint8_t MODE){
switch(MODE){
case Continuous_H_resolution_Mode:
break;
case Continuous_H_resolution_Mode2:
break;
case Continuous_L_resolution_Mode:
break;
case OneTime_H_resolution_Mode:
break;
case OneTime_H_resolution_Mode2:
break;
case OneTime_L_resolution_Mode:
break;
}
delay(10);
I2CWriteTo(MODE);
}
uint16_t BH1750FVI::GetLightIntensity(void){
uint16_t Intensity_value;
if(state ==true){
Wire.beginTransmission(Device_Address_H);
Wire.requestFrom(Device_Address_H, 2);
}
if(state ==false){
Wire.beginTransmission(Device_Address_L);
Wire.requestFrom(Device_Address_L, 2);
}
Intensity_value = Wire.read();
Intensity_value <<= 8;
Intensity_value |= Wire.read();
Wire.endTransmission();
Intensity_value=Intensity_value/1.2;
return Intensity_value;
}
void BH1750FVI::I2CWriteTo(uint8_t DataToSend){
Wire.beginTransmission(address_value);
Wire.write(DataToSend);
Wire.endTransmission();
}

View file

@ -1,68 +0,0 @@
/* This library for Digital Light sensor BH1750FVI
use I2C Communication protocal , SDA,SCL Are required
to interface with this sensor
pin configuration :
VCC >>> 3.3V
SDA >>> A4
SCL >>> A5
ADDR >> A3 "Optional"
GND >>> gnd
written By : Mohannad Rawashdeh
www.genotronex.com
*/
#ifndef BH1750FVI_h
#define BH1750FVI_h
#include "Arduino.h"
#include "Wire.h"
#define Device_Address_L 0x23 // Device address when address pin LOW
#define Device_Address_H 0x5C // Device address when address pin LOW
//all command here taken from Data sheet OPECODE Table page 5
#define Power_Down 0x00
#define Power_On 0x01
#define reset 0x07
#define Continuous_H_resolution_Mode 0x10
#define Continuous_H_resolution_Mode2 0x11
#define Continuous_L_resolution_Mode 0x13
#define OneTime_H_resolution_Mode 0x20
#define OneTime_H_resolution_Mode2 0x21
#define OneTime_L_resolution_Mode 0x23//As well as address value
#define AddrPin 17 // Address pin enable
class BH1750FVI {
public:
BH1750FVI();
void begin(void);
void Sleep(void);
void SetMode(uint8_t MODE);
void Reset(void);
void SetAddress(uint8_t add);
uint16_t GetLightIntensity(void);
private:
void I2CWriteTo(uint8_t DataToSend);
byte address_value;
boolean state;
};
#endif

View file

@ -1,60 +0,0 @@
/*
This is a simple code to test BH1750FVI Light senosr
communicate using I2C Protocol
this library enable 2 slave device address
Main address 0x23
secondary address 0x5C
connect this sensor as following :
VCC >>> 3.3V
SDA >>> A4
SCL >>> A5
addr >> A3
Gnd >>>Gnd
Written By : Mohannad Rawashdeh
*/
// First define the library :
#include <BH1750FVI.h> // Sensor Library
#include <Wire.h> // I2C Library
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
uint16_t Light_Intensity=0;
// Call the function
BH1750FVI LightSensor;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
lcd.begin(16, 2);
// call begin Function so turn the sensor On .
LightSensor.begin();
LightSensor.SetAddress(Device_Address_H); //Address 0x5C
LightSensor.SetMode(Continuous_H_resolution_Mode);
lcd.setCursor(0, 0);
lcd.print("BH1750 Sensor");
lcd.setCursor(1, 1);
lcd.print("Please wait...");
delay(3000);
lcd.clear();
}
void loop() {
// put your main code here, to run repeatedly:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" Intensity = ");
lcd.setCursor(5, 1);
Light_Intensity = LightSensor.GetLightIntensity();
lcd.print(Light_Intensity);
lcd.print(" Lux");
delay(2000);
}

View file

@ -1,74 +0,0 @@
/*
This is a simple code to test BH1750FVI Light senosr
communicate using I2C Protocol
this library enable 2 slave device address
Main address 0x23
secondary address 0x5C
connect this sensor as following :
VCC >>> 3.3V
SDA >>> A4
SCL >>> A5
addr >> A3
Gnd >>>Gnd
Written By : Mohannad Rawashdeh
*/
// First define the library :
#include <BH1750FVI.h> // Sensor Library
#include <Wire.h> // I2C Library
uint16_t Light_Intensity=0;
// Call the function
#define LedPin 9 // led connecting to pin D9
BH1750FVI LightSensor;
int SensorValue =0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
// call begin Function so turn the sensor On .
LightSensor.begin();
/*
Set the address for this sensor
you can use 2 different address
Device_Address_H "0x5C"
Device_Address_L "0x23"
you must connect Addr pin to A3 .
*/
LightSensor.SetAddress(Device_Address_H); //Address 0x5C
// To adjust the slave on other address , uncomment this line
// lightMeter.SetAddress(Device_Address_L); //Address 0x5C
//-----------------------------------------------
/*
set the Working Mode for this sensor
Select the following Mode:
Continuous_H_resolution_Mode
Continuous_H_resolution_Mode2
Continuous_L_resolution_Mode
OneTime_H_resolution_Mode
OneTime_H_resolution_Mode2
OneTime_L_resolution_Mode
The data sheet recommanded To use Continuous_H_resolution_Mode
*/
LightSensor.SetMode(Continuous_H_resolution_Mode);
pinMode(9,OUTPUT) // Connect LED With 100ohm resistor
// to pin D9
}
void loop() {
// put your main code here, to run repeatedly:
// call GetLightIntensity() Function , so the sensor read
//the Intensity Value and send it
Light_Intensity=LightSensor.GetLightIntensity();
delay(50);
SensorValue=map(Light_Intensity,0,2000,255,0);
SensorValue=constrain(SensorValue,255,0);
digitalWrite(LedPin,SensorValue);
// ready to another reading .
}

View file

@ -1,68 +0,0 @@
/*
This is a simple code to test BH1750FVI Light senosr
communicate using I2C Protocol
this library enable 2 slave device address
Main address 0x23
secondary address 0x5C
connect this sensor as following :
VCC >>> 3.3V
SDA >>> A4
SCL >>> A5
addr >> A3
Gnd >>>Gnd
Written By : Mohannad Rawashdeh
*/
// First define the library :
#include <Wire.h>
#include <BH1750FVI.h>
BH1750FVI LightSensor;
void setup() { // put your setup code here, to run once:
Serial.begin(9600);
LightSensor.begin();
/*
Set the address for this sensor
you can use 2 different address
Device_Address_H "0x5C"
Device_Address_L "0x23"
you must connect Addr pin to A3 .
*/
LightSensor.SetAddress(Device_Address_H);//Address 0x5C
// To adjust the slave on other address , uncomment this line
// lightMeter.SetAddress(Device_Address_L); //Address 0x5C
//-----------------------------------------------
/*
set the Working Mode for this sensor
Select the following Mode:
Continuous_H_resolution_Mode
Continuous_H_resolution_Mode2
Continuous_L_resolution_Mode
OneTime_H_resolution_Mode
OneTime_H_resolution_Mode2
OneTime_L_resolution_Mode
The data sheet recommanded To use Continuous_H_resolution_Mode
*/
LightSensor.SetMode(Continuous_H_resolution_Mode);
Serial.println("Running...");
}
void loop() {
// put your main code here, to run repeatedly:
uint16_t lux = LightSensor.GetLightIntensity();// Get Lux value
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lux");
delay(1000);
}

View file

@ -1,24 +0,0 @@
#######################################
# Syntax Coloring Map For BH1750FVI
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
KEYWORD1
BH1750FVI KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
KEYWORD2
begin KEYWORD2
Sleep KEYWORD2SetMode KEYWORD2Reset KEYWORD2GetLightIntensity KEYWORD2
#######################################
# Constants (LITERAL1)
#######################################

View file

@ -1,738 +0,0 @@
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// Version 3.7.2 modified on Dec 6, 2011 to support Arduino 1.0
// See Includes...
// Modified by Jordan Hochenbaum
#include "DallasTemperature.h"
#if ARDUINO >= 100
#include "Arduino.h"
#else
extern "C" {
#include "WConstants.h"
}
#endif
DallasTemperature::DallasTemperature(OneWire* _oneWire)
#if REQUIRESALARMS
: _AlarmHandler(&defaultAlarmHandler)
#endif
{
_wire = _oneWire;
devices = 0;
parasite = false;
bitResolution = 9;
waitForConversion = true;
checkForConversion = true;
}
// initialise the bus
void DallasTemperature::begin(void)
{
DeviceAddress deviceAddress;
_wire->reset_search();
devices = 0; // Reset the number of devices when we enumerate wire devices
while (_wire->search(deviceAddress))
{
if (validAddress(deviceAddress))
{
if (!parasite && readPowerSupply(deviceAddress)) parasite = true;
ScratchPad scratchPad;
readScratchPad(deviceAddress, scratchPad);
bitResolution = max(bitResolution, getResolution(deviceAddress));
devices++;
}
}
}
// returns the number of devices found on the bus
uint8_t DallasTemperature::getDeviceCount(void)
{
return devices;
}
// returns true if address is valid
bool DallasTemperature::validAddress(uint8_t* deviceAddress)
{
return (_wire->crc8(deviceAddress, 7) == deviceAddress[7]);
}
// finds an address at a given index on the bus
// returns true if the device was found
bool DallasTemperature::getAddress(uint8_t* deviceAddress, uint8_t index)
{
uint8_t depth = 0;
_wire->reset_search();
while (depth <= index && _wire->search(deviceAddress))
{
if (depth == index && validAddress(deviceAddress)) return true;
depth++;
}
return false;
}
// attempt to determine if the device at the given address is connected to the bus
bool DallasTemperature::isConnected(uint8_t* deviceAddress)
{
ScratchPad scratchPad;
return isConnected(deviceAddress, scratchPad);
}
// attempt to determine if the device at the given address is connected to the bus
// also allows for updating the read scratchpad
bool DallasTemperature::isConnected(uint8_t* deviceAddress, uint8_t* scratchPad)
{
readScratchPad(deviceAddress, scratchPad);
return (_wire->crc8(scratchPad, 8) == scratchPad[SCRATCHPAD_CRC]);
}
// read device's scratch pad
void DallasTemperature::readScratchPad(uint8_t* deviceAddress, uint8_t* scratchPad)
{
// send the command
_wire->reset();
_wire->select(deviceAddress);
_wire->write(READSCRATCH);
// TODO => collect all comments & use simple loop
// byte 0: temperature LSB
// byte 1: temperature MSB
// byte 2: high alarm temp
// byte 3: low alarm temp
// byte 4: DS18S20: store for crc
// DS18B20 & DS1822: configuration register
// byte 5: internal use & crc
// byte 6: DS18S20: COUNT_REMAIN
// DS18B20 & DS1822: store for crc
// byte 7: DS18S20: COUNT_PER_C
// DS18B20 & DS1822: store for crc
// byte 8: SCRATCHPAD_CRC
//
// for(int i=0; i<9; i++)
// {
// scratchPad[i] = _wire->read();
// }
// read the response
// byte 0: temperature LSB
scratchPad[TEMP_LSB] = _wire->read();
// byte 1: temperature MSB
scratchPad[TEMP_MSB] = _wire->read();
// byte 2: high alarm temp
scratchPad[HIGH_ALARM_TEMP] = _wire->read();
// byte 3: low alarm temp
scratchPad[LOW_ALARM_TEMP] = _wire->read();
// byte 4:
// DS18S20: store for crc
// DS18B20 & DS1822: configuration register
scratchPad[CONFIGURATION] = _wire->read();
// byte 5:
// internal use & crc
scratchPad[INTERNAL_BYTE] = _wire->read();
// byte 6:
// DS18S20: COUNT_REMAIN
// DS18B20 & DS1822: store for crc
scratchPad[COUNT_REMAIN] = _wire->read();
// byte 7:
// DS18S20: COUNT_PER_C
// DS18B20 & DS1822: store for crc
scratchPad[COUNT_PER_C] = _wire->read();
// byte 8:
// SCTRACHPAD_CRC
scratchPad[SCRATCHPAD_CRC] = _wire->read();
_wire->reset();
}
// writes device's scratch pad
void DallasTemperature::writeScratchPad(uint8_t* deviceAddress, const uint8_t* scratchPad)
{
_wire->reset();
_wire->select(deviceAddress);
_wire->write(WRITESCRATCH);
_wire->write(scratchPad[HIGH_ALARM_TEMP]); // high alarm temp
_wire->write(scratchPad[LOW_ALARM_TEMP]); // low alarm temp
// DS18S20 does not use the configuration register
if (deviceAddress[0] != DS18S20MODEL) _wire->write(scratchPad[CONFIGURATION]); // configuration
_wire->reset();
// save the newly written values to eeprom
_wire->write(COPYSCRATCH, parasite);
if (parasite) delay(10); // 10ms delay
_wire->reset();
}
// reads the device's power requirements
bool DallasTemperature::readPowerSupply(uint8_t* deviceAddress)
{
bool ret = false;
_wire->reset();
_wire->select(deviceAddress);
_wire->write(READPOWERSUPPLY);
if (_wire->read_bit() == 0) ret = true;
_wire->reset();
return ret;
}
// set resolution of all devices to 9, 10, 11, or 12 bits
// if new resolution is out of range, it is constrained.
void DallasTemperature::setResolution(uint8_t newResolution)
{
bitResolution = constrain(newResolution, 9, 12);
DeviceAddress deviceAddress;
for (int i=0; i<devices; i++)
{
getAddress(deviceAddress, i);
setResolution(deviceAddress, bitResolution);
}
}
// set resolution of a device to 9, 10, 11, or 12 bits
// if new resolution is out of range, 9 bits is used.
bool DallasTemperature::setResolution(uint8_t* deviceAddress, uint8_t newResolution)
{
ScratchPad scratchPad;
if (isConnected(deviceAddress, scratchPad))
{
// DS18S20 has a fixed 9-bit resolution
if (deviceAddress[0] != DS18S20MODEL)
{
switch (newResolution)
{
case 12:
scratchPad[CONFIGURATION] = TEMP_12_BIT;
break;
case 11:
scratchPad[CONFIGURATION] = TEMP_11_BIT;
break;
case 10:
scratchPad[CONFIGURATION] = TEMP_10_BIT;
break;
case 9:
default:
scratchPad[CONFIGURATION] = TEMP_9_BIT;
break;
}
writeScratchPad(deviceAddress, scratchPad);
}
return true; // new value set
}
return false;
}
// returns the global resolution
uint8_t DallasTemperature::getResolution()
{
return bitResolution;
}
// returns the current resolution of the device, 9-12
// returns 0 if device not found
uint8_t DallasTemperature::getResolution(uint8_t* deviceAddress)
{
if (deviceAddress[0] == DS18S20MODEL) return 9; // this model has a fixed resolution
ScratchPad scratchPad;
if (isConnected(deviceAddress, scratchPad))
{
switch (scratchPad[CONFIGURATION])
{
case TEMP_12_BIT:
return 12;
case TEMP_11_BIT:
return 11;
case TEMP_10_BIT:
return 10;
case TEMP_9_BIT:
return 9;
}
}
return 0;
}
// sets the value of the waitForConversion flag
// TRUE : function requestTemperature() etc returns when conversion is ready
// FALSE: function requestTemperature() etc returns immediately (USE WITH CARE!!)
// (1) programmer has to check if the needed delay has passed
// (2) but the application can do meaningful things in that time
void DallasTemperature::setWaitForConversion(bool flag)
{
waitForConversion = flag;
}
// gets the value of the waitForConversion flag
bool DallasTemperature::getWaitForConversion()
{
return waitForConversion;
}
// sets the value of the checkForConversion flag
// TRUE : function requestTemperature() etc will 'listen' to an IC to determine whether a conversion is complete
// FALSE: function requestTemperature() etc will wait a set time (worst case scenario) for a conversion to complete
void DallasTemperature::setCheckForConversion(bool flag)
{
checkForConversion = flag;
}
// gets the value of the waitForConversion flag
bool DallasTemperature::getCheckForConversion()
{
return checkForConversion;
}
bool DallasTemperature::isConversionAvailable(uint8_t* deviceAddress)
{
// Check if the clock has been raised indicating the conversion is complete
ScratchPad scratchPad;
readScratchPad(deviceAddress, scratchPad);
return scratchPad[0];
}
// sends command for all devices on the bus to perform a temperature conversion
void DallasTemperature::requestTemperatures()
{
_wire->reset();
_wire->skip();
_wire->write(STARTCONVO, parasite);
// ASYNC mode?
if (!waitForConversion) return;
blockTillConversionComplete(&bitResolution, 0);
return;
}
// sends command for one device to perform a temperature by address
// returns FALSE if device is disconnected
// returns TRUE otherwise
bool DallasTemperature::requestTemperaturesByAddress(uint8_t* deviceAddress)
{
_wire->reset();
_wire->select(deviceAddress);
_wire->write(STARTCONVO, parasite);
// check device
ScratchPad scratchPad;
if (!isConnected(deviceAddress, scratchPad)) return false;
// ASYNC mode?
if (!waitForConversion) return true;
uint8_t bitResolution = getResolution(deviceAddress);
blockTillConversionComplete(&bitResolution, deviceAddress);
return true;
}
void DallasTemperature::blockTillConversionComplete(uint8_t* bitResolution, uint8_t* deviceAddress)
{
if(deviceAddress != 0 && checkForConversion && !parasite)
{
// Continue to check if the IC has responded with a temperature
// NB: Could cause issues with multiple devices (one device may respond faster)
unsigned long start = millis();
while(!isConversionAvailable(0) && ((millis() - start) < 750));
}
// Wait a fix number of cycles till conversion is complete (based on IC datasheet)
switch (*bitResolution)
{
case 9:
delay(94);
break;
case 10:
delay(188);
break;
case 11:
delay(375);
break;
case 12:
default:
delay(750);
break;
}
}
// sends command for one device to perform a temp conversion by index
bool DallasTemperature::requestTemperaturesByIndex(uint8_t deviceIndex)
{
DeviceAddress deviceAddress;
getAddress(deviceAddress, deviceIndex);
return requestTemperaturesByAddress(deviceAddress);
}
// Fetch temperature for device index
float DallasTemperature::getTempCByIndex(uint8_t deviceIndex)
{
DeviceAddress deviceAddress;
getAddress(deviceAddress, deviceIndex);
return getTempC((uint8_t*)deviceAddress);
}
// Fetch temperature for device index
float DallasTemperature::getTempFByIndex(uint8_t deviceIndex)
{
return toFahrenheit(getTempCByIndex(deviceIndex));
}
// reads scratchpad and returns the temperature in degrees C
float DallasTemperature::calculateTemperature(uint8_t* deviceAddress, uint8_t* scratchPad)
{
int16_t rawTemperature = (((int16_t)scratchPad[TEMP_MSB]) << 8) | scratchPad[TEMP_LSB];
switch (deviceAddress[0])
{
case DS18B20MODEL:
case DS1822MODEL:
switch (scratchPad[CONFIGURATION])
{
case TEMP_12_BIT:
return (float)rawTemperature * 0.0625;
break;
case TEMP_11_BIT:
return (float)(rawTemperature >> 1) * 0.125;
break;
case TEMP_10_BIT:
return (float)(rawTemperature >> 2) * 0.25;
break;
case TEMP_9_BIT:
return (float)(rawTemperature >> 3) * 0.5;
break;
}
break;
case DS18S20MODEL:
/*
Resolutions greater than 9 bits can be calculated using the data from
the temperature, COUNT REMAIN and COUNT PER <EFBFBD>C registers in the
scratchpad. Note that the COUNT PER <EFBFBD>C register is hard-wired to 16
(10h). After reading the scratchpad, the TEMP_READ value is obtained
by truncating the 0.5<EFBFBD>C bit (bit 0) from the temperature data. The
extended resolution temperature can then be calculated using the
following equation:
COUNT_PER_C - COUNT_REMAIN
TEMPERATURE = TEMP_READ - 0.25 + --------------------------
COUNT_PER_C
*/
// Good spot. Thanks Nic Johns for your contribution
return (float)(rawTemperature >> 1) - 0.25 +((float)(scratchPad[COUNT_PER_C] - scratchPad[COUNT_REMAIN]) / (float)scratchPad[COUNT_PER_C] );
break;
}
}
// returns temperature in degrees C or DEVICE_DISCONNECTED if the
// device's scratch pad cannot be read successfully.
// the numeric value of DEVICE_DISCONNECTED is defined in
// DallasTemperature.h. It is a large negative number outside the
// operating range of the device
float DallasTemperature::getTempC(uint8_t* deviceAddress)
{
// TODO: Multiple devices (up to 64) on the same bus may take
// some time to negotiate a response
// What happens in case of collision?
ScratchPad scratchPad;
if (isConnected(deviceAddress, scratchPad)) return calculateTemperature(deviceAddress, scratchPad);
return DEVICE_DISCONNECTED;
}
// returns temperature in degrees F
// TODO: - when getTempC returns DEVICE_DISCONNECTED
// -127 gets converted to -196.6 F
float DallasTemperature::getTempF(uint8_t* deviceAddress)
{
return toFahrenheit(getTempC(deviceAddress));
}
// returns true if the bus requires parasite power
bool DallasTemperature::isParasitePowerMode(void)
{
return parasite;
}
#if REQUIRESALARMS
/*
ALARMS:
TH and TL Register Format
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
S 2^6 2^5 2^4 2^3 2^2 2^1 2^0
Only bits 11 through 4 of the temperature register are used
in the TH and TL comparison since TH and TL are 8-bit
registers. If the measured temperature is lower than or equal
to TL or higher than or equal to TH, an alarm condition exists
and an alarm flag is set inside the DS18B20. This flag is
updated after every temperature measurement; therefore, if the
alarm condition goes away, the flag will be turned off after
the next temperature conversion.
*/
// sets the high alarm temperature for a device in degrees celsius
// accepts a float, but the alarm resolution will ignore anything
// after a decimal point. valid range is -55C - 125C
void DallasTemperature::setHighAlarmTemp(uint8_t* deviceAddress, char celsius)
{
// make sure the alarm temperature is within the device's range
if (celsius > 125) celsius = 125;
else if (celsius < -55) celsius = -55;
ScratchPad scratchPad;
if (isConnected(deviceAddress, scratchPad))
{
scratchPad[HIGH_ALARM_TEMP] = (uint8_t)celsius;
writeScratchPad(deviceAddress, scratchPad);
}
}
// sets the low alarm temperature for a device in degreed celsius
// accepts a float, but the alarm resolution will ignore anything
// after a decimal point. valid range is -55C - 125C
void DallasTemperature::setLowAlarmTemp(uint8_t* deviceAddress, char celsius)
{
// make sure the alarm temperature is within the device's range
if (celsius > 125) celsius = 125;
else if (celsius < -55) celsius = -55;
ScratchPad scratchPad;
if (isConnected(deviceAddress, scratchPad))
{
scratchPad[LOW_ALARM_TEMP] = (uint8_t)celsius;
writeScratchPad(deviceAddress, scratchPad);
}
}
// returns a char with the current high alarm temperature or
// DEVICE_DISCONNECTED for an address
char DallasTemperature::getHighAlarmTemp(uint8_t* deviceAddress)
{
ScratchPad scratchPad;
if (isConnected(deviceAddress, scratchPad)) return (char)scratchPad[HIGH_ALARM_TEMP];
return DEVICE_DISCONNECTED;
}
// returns a char with the current low alarm temperature or
// DEVICE_DISCONNECTED for an address
char DallasTemperature::getLowAlarmTemp(uint8_t* deviceAddress)
{
ScratchPad scratchPad;
if (isConnected(deviceAddress, scratchPad)) return (char)scratchPad[LOW_ALARM_TEMP];
return DEVICE_DISCONNECTED;
}
// resets internal variables used for the alarm search
void DallasTemperature::resetAlarmSearch()
{
alarmSearchJunction = -1;
alarmSearchExhausted = 0;
for(uint8_t i = 0; i < 7; i++)
alarmSearchAddress[i] = 0;
}
// This is a modified version of the OneWire::search method.
//
// Also added the OneWire search fix documented here:
// http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1238032295
//
// Perform an alarm search. If this function returns a '1' then it has
// enumerated the next device and you may retrieve the ROM from the
// OneWire::address variable. If there are no devices, no further
// devices, or something horrible happens in the middle of the
// enumeration then a 0 is returned. If a new device is found then
// its address is copied to newAddr. Use
// DallasTemperature::resetAlarmSearch() to start over.
bool DallasTemperature::alarmSearch(uint8_t* newAddr)
{
uint8_t i;
char lastJunction = -1;
uint8_t done = 1;
if (alarmSearchExhausted) return false;
if (!_wire->reset()) return false;
// send the alarm search command
_wire->write(0xEC, 0);
for(i = 0; i < 64; i++)
{
uint8_t a = _wire->read_bit( );
uint8_t nota = _wire->read_bit( );
uint8_t ibyte = i / 8;
uint8_t ibit = 1 << (i & 7);
// I don't think this should happen, this means nothing responded, but maybe if
// something vanishes during the search it will come up.
if (a && nota) return false;
if (!a && !nota)
{
if (i == alarmSearchJunction)
{
// this is our time to decide differently, we went zero last time, go one.
a = 1;
alarmSearchJunction = lastJunction;
}
else if (i < alarmSearchJunction)
{
// take whatever we took last time, look in address
if (alarmSearchAddress[ibyte] & ibit) a = 1;
else
{
// Only 0s count as pending junctions, we've already exhasuted the 0 side of 1s
a = 0;
done = 0;
lastJunction = i;
}
}
else
{
// we are blazing new tree, take the 0
a = 0;
alarmSearchJunction = i;
done = 0;
}
// OneWire search fix
// See: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1238032295
}
if (a) alarmSearchAddress[ibyte] |= ibit;
else alarmSearchAddress[ibyte] &= ~ibit;
_wire->write_bit(a);
}
if (done) alarmSearchExhausted = 1;
for (i = 0; i < 8; i++) newAddr[i] = alarmSearchAddress[i];
return true;
}
// returns true if device address has an alarm condition
// TODO: can this be done with only TEMP_MSB REGISTER (faster)
// if ((char) scratchPad[TEMP_MSB] <= (char) scratchPad[LOW_ALARM_TEMP]) return true;
// if ((char) scratchPad[TEMP_MSB] >= (char) scratchPad[HIGH_ALARM_TEMP]) return true;
bool DallasTemperature::hasAlarm(uint8_t* deviceAddress)
{
ScratchPad scratchPad;
if (isConnected(deviceAddress, scratchPad))
{
float temp = calculateTemperature(deviceAddress, scratchPad);
// check low alarm
if ((char)temp <= (char)scratchPad[LOW_ALARM_TEMP]) return true;
// check high alarm
if ((char)temp >= (char)scratchPad[HIGH_ALARM_TEMP]) return true;
}
// no alarm
return false;
}
// returns true if any device is reporting an alarm condition on the bus
bool DallasTemperature::hasAlarm(void)
{
DeviceAddress deviceAddress;
resetAlarmSearch();
return alarmSearch(deviceAddress);
}
// runs the alarm handler for all devices returned by alarmSearch()
void DallasTemperature::processAlarms(void)
{
resetAlarmSearch();
DeviceAddress alarmAddr;
while (alarmSearch(alarmAddr))
{
if (validAddress(alarmAddr))
_AlarmHandler(alarmAddr);
}
}
// sets the alarm handler
void DallasTemperature::setAlarmHandler(AlarmHandler *handler)
{
_AlarmHandler = handler;
}
// The default alarm handler
void DallasTemperature::defaultAlarmHandler(uint8_t* deviceAddress)
{
}
#endif
// Convert float celsius to fahrenheit
float DallasTemperature::toFahrenheit(float celsius)
{
return (celsius * 1.8) + 32;
}
// Convert float fahrenheit to celsius
float DallasTemperature::toCelsius(float fahrenheit)
{
return (fahrenheit - 32) / 1.8;
}
#if REQUIRESNEW
// MnetCS - Allocates memory for DallasTemperature. Allows us to instance a new object
void* DallasTemperature::operator new(unsigned int size) // Implicit NSS obj size
{
void * p; // void pointer
p = malloc(size); // Allocate memory
memset((DallasTemperature*)p,0,size); // Initalise memory
//!!! CANT EXPLICITLY CALL CONSTRUCTOR - workaround by using an init() methodR - workaround by using an init() method
return (DallasTemperature*) p; // Cast blank region to NSS pointer
}
// MnetCS 2009 - Unallocates the memory used by this instance
void DallasTemperature::operator delete(void* p)
{
DallasTemperature* pNss = (DallasTemperature*) p; // Cast to NSS pointer
pNss->~DallasTemperature(); // Destruct the object
free(p); // Free the memory
}
#endif

View file

@ -1,242 +0,0 @@
#ifndef DallasTemperature_h
#define DallasTemperature_h
#define DALLASTEMPLIBVERSION "3.7.2"
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// set to true to include code for new and delete operators
#ifndef REQUIRESNEW
#define REQUIRESNEW false
#endif
// set to true to include code implementing alarm search functions
#ifndef REQUIRESALARMS
#define REQUIRESALARMS true
#endif
#include <inttypes.h>
#include <OneWire.h>
// Model IDs
#define DS18S20MODEL 0x10
#define DS18B20MODEL 0x28
#define DS1822MODEL 0x22
// OneWire commands
#define STARTCONVO 0x44 // Tells device to take a temperature reading and put it on the scratchpad
#define COPYSCRATCH 0x48 // Copy EEPROM
#define READSCRATCH 0xBE // Read EEPROM
#define WRITESCRATCH 0x4E // Write to EEPROM
#define RECALLSCRATCH 0xB8 // Reload from last known
#define READPOWERSUPPLY 0xB4 // Determine if device needs parasite power
#define ALARMSEARCH 0xEC // Query bus for devices with an alarm condition
// Scratchpad locations
#define TEMP_LSB 0
#define TEMP_MSB 1
#define HIGH_ALARM_TEMP 2
#define LOW_ALARM_TEMP 3
#define CONFIGURATION 4
#define INTERNAL_BYTE 5
#define COUNT_REMAIN 6
#define COUNT_PER_C 7
#define SCRATCHPAD_CRC 8
// Device resolution
#define TEMP_9_BIT 0x1F // 9 bit
#define TEMP_10_BIT 0x3F // 10 bit
#define TEMP_11_BIT 0x5F // 11 bit
#define TEMP_12_BIT 0x7F // 12 bit
// Error Codes
#define DEVICE_DISCONNECTED -127
typedef uint8_t DeviceAddress[8];
class DallasTemperature
{
public:
DallasTemperature(OneWire*);
// initalise bus
void begin(void);
// returns the number of devices found on the bus
uint8_t getDeviceCount(void);
// Is a conversion complete on the wire?
bool isConversionComplete(void);
// returns true if address is valid
bool validAddress(uint8_t*);
// finds an address at a given index on the bus
bool getAddress(uint8_t*, const uint8_t);
// attempt to determine if the device at the given address is connected to the bus
bool isConnected(uint8_t*);
// attempt to determine if the device at the given address is connected to the bus
// also allows for updating the read scratchpad
bool isConnected(uint8_t*, uint8_t*);
// read device's scratchpad
void readScratchPad(uint8_t*, uint8_t*);
// write device's scratchpad
void writeScratchPad(uint8_t*, const uint8_t*);
// read device's power requirements
bool readPowerSupply(uint8_t*);
// get global resolution
uint8_t getResolution();
// set global resolution to 9, 10, 11, or 12 bits
void setResolution(uint8_t);
// returns the device resolution, 9-12
uint8_t getResolution(uint8_t*);
// set resolution of a device to 9, 10, 11, or 12 bits
bool setResolution(uint8_t*, uint8_t);
// sets/gets the waitForConversion flag
void setWaitForConversion(bool);
bool getWaitForConversion(void);
// sets/gets the checkForConversion flag
void setCheckForConversion(bool);
bool getCheckForConversion(void);
// sends command for all devices on the bus to perform a temperature conversion
void requestTemperatures(void);
// sends command for one device to perform a temperature conversion by address
bool requestTemperaturesByAddress(uint8_t*);
// sends command for one device to perform a temperature conversion by index
bool requestTemperaturesByIndex(uint8_t);
// returns temperature in degrees C
float getTempC(uint8_t*);
// returns temperature in degrees F
float getTempF(uint8_t*);
// Get temperature for device index (slow)
float getTempCByIndex(uint8_t);
// Get temperature for device index (slow)
float getTempFByIndex(uint8_t);
// returns true if the bus requires parasite power
bool isParasitePowerMode(void);
bool isConversionAvailable(uint8_t*);
#if REQUIRESALARMS
typedef void AlarmHandler(uint8_t*);
// sets the high alarm temperature for a device
// accepts a char. valid range is -55C - 125C
void setHighAlarmTemp(uint8_t*, const char);
// sets the low alarm temperature for a device
// accepts a char. valid range is -55C - 125C
void setLowAlarmTemp(uint8_t*, const char);
// returns a signed char with the current high alarm temperature for a device
// in the range -55C - 125C
char getHighAlarmTemp(uint8_t*);
// returns a signed char with the current low alarm temperature for a device
// in the range -55C - 125C
char getLowAlarmTemp(uint8_t*);
// resets internal variables used for the alarm search
void resetAlarmSearch(void);
// search the wire for devices with active alarms
bool alarmSearch(uint8_t*);
// returns true if ia specific device has an alarm
bool hasAlarm(uint8_t*);
// returns true if any device is reporting an alarm on the bus
bool hasAlarm(void);
// runs the alarm handler for all devices returned by alarmSearch()
void processAlarms(void);
// sets the alarm handler
void setAlarmHandler(AlarmHandler *);
// The default alarm handler
static void defaultAlarmHandler(uint8_t*);
#endif
// convert from celcius to farenheit
static float toFahrenheit(const float);
// convert from farenheit to celsius
static float toCelsius(const float);
#if REQUIRESNEW
// initalize memory area
void* operator new (unsigned int);
// delete memory reference
void operator delete(void*);
#endif
private:
typedef uint8_t ScratchPad[9];
// parasite power on or off
bool parasite;
// used to determine the delay amount needed to allow for the
// temperature conversion to take place
uint8_t bitResolution;
// used to requestTemperature with or without delay
bool waitForConversion;
// used to requestTemperature to dynamically check if a conversion is complete
bool checkForConversion;
// count of devices on the bus
uint8_t devices;
// Take a pointer to one wire instance
OneWire* _wire;
// reads scratchpad and returns the temperature in degrees C
float calculateTemperature(uint8_t*, uint8_t*);
void blockTillConversionComplete(uint8_t*,uint8_t*);
#if REQUIRESALARMS
// required for alarmSearch
uint8_t alarmSearchAddress[8];
char alarmSearchJunction;
uint8_t alarmSearchExhausted;
// the alarm handler function pointer
AlarmHandler *_AlarmHandler;
#endif
};
#endif

View file

@ -1,152 +0,0 @@
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
#define TEMPERATURE_PRECISION 9
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
// arrays to hold device addresses
DeviceAddress insideThermometer, outsideThermometer, middleThermometer;
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
// locate devices on the bus
Serial.print("Locating devices...");
Serial.print("Found ");
Serial.print(sensors.getDeviceCount(), DEC);
Serial.println(" devices.");
// report parasite power requirements
Serial.print("Parasite power is: ");
if (sensors.isParasitePowerMode()) Serial.println("ON");
else Serial.println("OFF");
// assign address manually. the addresses below will beed to be changed
// to valid device addresses on your bus. device address can be retrieved
// by using either oneWire.search(deviceAddress) or individually via
// sensors.getAddress(deviceAddress, index)
//insideThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };
//outsideThermometer = { 0x28, 0x3F, 0x1C, 0x31, 0x2, 0x0, 0x0, 0x2 };
// search for devices on the bus and assign based on an index. ideally,
// you would do this to initially discover addresses on the bus and then
// use those addresses and manually assign them (see above) once you know
// the devices on your bus (and assuming they don't change).
//
// method 1: by index
if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find address for Device 0");
if (!sensors.getAddress(outsideThermometer, 1)) Serial.println("Unable to find address for Device 1");
if (!sensors.getAddress(middleThermometer, 2)) Serial.println("Unable to find address for Device 2");
// method 2: search()
// search() looks for the next device. Returns 1 if a new address has been
// returned. A zero might mean that the bus is shorted, there are no devices,
// or you have already retrieved all of them. It might be a good idea to
// check the CRC to make sure you didn't get garbage. The order is
// deterministic. You will always get the same devices in the same order
//
// Must be called before search()
//oneWire.reset_search();
// assigns the first address found to insideThermometer
//if (!oneWire.search(insideThermometer)) Serial.println("Unable to find address for insideThermometer");
// assigns the seconds address found to outsideThermometer
//if (!oneWire.search(outsideThermometer)) Serial.println("Unable to find address for outsideThermometer");
// show the addresses we found on the bus
Serial.print("Device 0 Address: ");
printAddress(insideThermometer);
Serial.println();
Serial.print("Device 1 Address: ");
printAddress(outsideThermometer);
Serial.println();
Serial.print("Device 2 Address: ");
printAddress(middleThermometer);
Serial.println();
// set the resolution to 9 bit
sensors.setResolution(insideThermometer, TEMPERATURE_PRECISION);
sensors.setResolution(outsideThermometer, TEMPERATURE_PRECISION);
sensors.setResolution(middleThermometer, TEMPERATURE_PRECISION);
Serial.print("Device 0 Resolution: ");
Serial.print(sensors.getResolution(insideThermometer), DEC);
Serial.println();
Serial.print("Device 1 Resolution: ");
Serial.print(sensors.getResolution(outsideThermometer), DEC);
Serial.println();
Serial.print("Device 2 Resolution: ");
Serial.print(sensors.getResolution(middleThermometer), DEC);
Serial.println();
}
// function to print a device address
void printAddress(DeviceAddress deviceAddress)
{
for (uint8_t i = 0; i < 8; i++)
{
// zero pad the address if necessary
if (deviceAddress[i] < 16) Serial.print("0");
Serial.print(deviceAddress[i], HEX);
}
}
// function to print the temperature for a device
void printTemperature(DeviceAddress deviceAddress)
{
float tempC = sensors.getTempC(deviceAddress);
Serial.print("Temp C: ");
Serial.print(tempC);
Serial.print(" Temp F: ");
Serial.print(DallasTemperature::toFahrenheit(tempC));
}
// function to print a device's resolution
void printResolution(DeviceAddress deviceAddress)
{
Serial.print("Resolution: ");
Serial.print(sensors.getResolution(deviceAddress));
Serial.println();
}
// main function to print information about a device
void printData(DeviceAddress deviceAddress)
{
Serial.print("Device Address: ");
printAddress(deviceAddress);
Serial.print(" ");
printTemperature(deviceAddress);
Serial.println();
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures();
Serial.println("DONE");
// print the device information
printData(insideThermometer);
printData(outsideThermometer);
printData(middleThermometer);
delay(1000);
}

View file

@ -1,53 +0,0 @@
Arduino Library for Dallas Temperature ICs
==========================================
Usage
-----
This library supports the following devices:
DS18B20
DS18S20 - Please note there appears to be an issue with this series.
DS1822
You will need a pull-up resistor of about 5 KOhm between the 1-Wire data line
and your 5V power. If you are using the DS18B20, ground pins 1 and 3. The
centre pin is the data line '1-wire'.
We have included a "REQUIRESNEW" and "REQUIRESALARMS" definition. If you
want to slim down the code feel free to use either of these by including
#define REQUIRESNEW or #define REQUIRESALARMS a the top of DallasTemperature.h
Credits
-------
The OneWire code has been derived from
http://www.arduino.cc/playground/Learning/OneWire.
Miles Burton <miles@mnetcs.com> originally developed this library.
Tim Newsome <nuisance@casualhacker.net> added support for multiple sensors on
the same bus.
Guil Barros [gfbarros@bappos.com] added getTempByAddress (v3.5)
Rob Tillaart [rob.tillaart@gmail.com] added async modus (v3.7.0)
Website
-------
You can find the latest version of the library at
http://milesburton.com/index.php?title=Dallas_Temperature_Control_Library
License
-------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

View file

@ -1,85 +0,0 @@
This file contains the change history of the Dallas Temperature Control Library.
VERSION 3.7.2 BETA
===================
DATE: 6 DEC 2011
- Jordan Hochenbaum [jhochenbaum@gmail.com] updated library for compatibility with Arduino 1.0.
VERSION 3.7.0 BETA
===================
DATE: 11 JAN 2011
- Rob Tillaart [rob.tillaart@gmail.com] added async modus (v3.7.0)
The library is backwards compatible with version 3.6.0
MAJOR: async modus
------------------
- Added - private bool waitForConversion.
This boolean is default set to true in the Constructor to keep the library backwards compatible. If this flag is true calls to requestTemperatures(), requestTemperaturesByAddress() et al, will be blocking with the appropiate time specified (in datasheet) for the resolution used. If the flag is set to false, requestTemperatures() et al, will return immediately after the conversion command is send over the 1-wire interface. The programmer is responsible to wait long enough before reading the temperature values. This enables the application to do other things while waiting for a new reading, like calculations, update LCD, read/write other IO lines etc. See examples.
- Added - void setWaitForConversion(bool);
To set the flag to true or false, depending on the modus needed.
- Added - bool getWaitForConversion(void);
To get the current value of the flag.
- Changed - void requestTemperatures(void);
Added a test (false == waitForConversion) to return immediately after the conversion command instead of waiting until the conversion is ready.
- Changed - bool requestTemperaturesByAddress(uint8_t*);
Added a test (false == waitForConversion) to return immediately after the conversion command instead of waiting until the conversion is ready.
MINOR version number
--------------------
- Added - #define DALLASTEMPLIBVERSION "3.7.0"
To indicate the version number in .h file
MINOR internal var bitResolution
----------------------------
- Changed - private int conversionDelay - is renamed to - private int bitResolution
As this variable holds the resolution. The delay for the conversion is derived from it.
- Changed - uint8_t getResolution(uint8_t* deviceAddress);
If the device is not connected, it returns 0, otherwise it returns the resolution of the device.
- Changed - bool setResolution(uint8_t* deviceAddress, uint8_t newResolution);
If the device is not connected, it returns FALSE (fail), otherwise it returns TRUE (succes).
- Added - uint8_t getResolution();
Returns bitResolution.
- Added - void setResolution(uint8_t newResolution)
Sets the internal variable bitResolution, and all devices to this value
MINOR check connected state
----------------------------
- Changed - bool requestTemperaturesByIndex(deviceIndex)
Changed return type from void to bool. The function returns false if the device identified with [deviceIndex] is not found on the bus and true otherwise.
- Changed - bool requestTemperaturesByAddress(deviceAddress)
Changed return type from void to bool. The function returns false if the device identified with [deviceAddress] is not found on the bus and true otherwise.
Added code to handle the DS18S20 which has a 9 bit resolution separately.
Changed code so the blocking delay matches the bitResolution set in the device with deviceAddress.
- Changed - bool requestTemperaturesByIndex(uint8_t deviceIndex)
Changed return type from void to bool. The function returns false if the device identified with [deviceIndex] is not found on the bus and true otherwise.
VERSION 3.6.0
==============
DATE: 2010-10-10
- no detailed change history known except:
- The OneWire code has been derived from
http://www.arduino.cc/playground/Learning/OneWire.
- Miles Burton <miles@mnetcs.com> originally developed this library.
- Tim Newsome <nuisance@casualhacker.net> added support for multiple sensors on
the same bus.
- Guil Barros [gfbarros@bappos.com] added getTempByAddress (v3.5)

View file

@ -1,140 +0,0 @@
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
#define TEMPERATURE_PRECISION 12
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
// arrays to hold device addresses
DeviceAddress insideThermometer, outsideThermometer;
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
// locate devices on the bus
Serial.print("Locating devices...");
Serial.print("Found ");
Serial.print(sensors.getDeviceCount(), DEC);
Serial.println(" devices.");
// report parasite power requirements
Serial.print("Parasite power is: ");
if (sensors.isParasitePowerMode()) Serial.println("ON");
else Serial.println("OFF");
// assign address manually. the addresses below will beed to be changed
// to valid device addresses on your bus. device address can be retrieved
// by using either oneWire.search(deviceAddress) or individually via
// sensors.getAddress(deviceAddress, index)
//insideThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };
//outsideThermometer = { 0x28, 0x3F, 0x1C, 0x31, 0x2, 0x0, 0x0, 0x2 };
// search for devices on the bus and assign based on an index. ideally,
// you would do this to initially discover addresses on the bus and then
// use those addresses and manually assign them (see above) once you know
// the devices on your bus (and assuming they don't change).
//
// method 1: by index
if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find address for Device 0");
if (!sensors.getAddress(outsideThermometer, 1)) Serial.println("Unable to find address for Device 1");
// method 2: search()
// search() looks for the next device. Returns 1 if a new address has been
// returned. A zero might mean that the bus is shorted, there are no devices,
// or you have already retrieved all of them. It might be a good idea to
// check the CRC to make sure you didn't get garbage. The order is
// deterministic. You will always get the same devices in the same order
//
// Must be called before search()
//oneWire.reset_search();
// assigns the first address found to insideThermometer
//if (!oneWire.search(insideThermometer)) Serial.println("Unable to find address for insideThermometer");
// assigns the seconds address found to outsideThermometer
//if (!oneWire.search(outsideThermometer)) Serial.println("Unable to find address for outsideThermometer");
// show the addresses we found on the bus
Serial.print("Device 0 Address: ");
printAddress(insideThermometer);
Serial.println();
Serial.print("Device 1 Address: ");
printAddress(outsideThermometer);
Serial.println();
// set the resolution
sensors.setResolution(insideThermometer, TEMPERATURE_PRECISION);
sensors.setResolution(outsideThermometer, TEMPERATURE_PRECISION);
Serial.print("Device 0 Resolution: ");
Serial.print(sensors.getResolution(insideThermometer), DEC);
Serial.println();
Serial.print("Device 1 Resolution: ");
Serial.print(sensors.getResolution(outsideThermometer), DEC);
Serial.println();
}
// function to print a device address
void printAddress(DeviceAddress deviceAddress)
{
for (uint8_t i = 0; i < 8; i++)
{
// zero pad the address if necessary
if (deviceAddress[i] < 16) Serial.print("0");
Serial.print(deviceAddress[i], HEX);
}
}
// function to print the temperature for a device
void printTemperature(DeviceAddress deviceAddress)
{
float tempC = sensors.getTempC(deviceAddress);
Serial.print("Temp C: ");
Serial.print(tempC);
Serial.print(" Temp F: ");
Serial.print(DallasTemperature::toFahrenheit(tempC));
}
// function to print a device's resolution
void printResolution(DeviceAddress deviceAddress)
{
Serial.print("Resolution: ");
Serial.print(sensors.getResolution(deviceAddress));
Serial.println();
}
// main function to print information about a device
void printData(DeviceAddress deviceAddress)
{
Serial.print("Device Address: ");
printAddress(deviceAddress);
Serial.print(" ");
printTemperature(deviceAddress);
Serial.println();
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures();
Serial.println("DONE");
// print the device information
printData(insideThermometer);
printData(outsideThermometer);
}

View file

@ -1,33 +0,0 @@
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
Serial.print("Temperature for the device 1 (index 0) is: ");
Serial.println(sensors.getTempCByIndex(0));
}

View file

@ -1,109 +0,0 @@
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
// arrays to hold device address
DeviceAddress insideThermometer;
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// locate devices on the bus
Serial.print("Locating devices...");
sensors.begin();
Serial.print("Found ");
Serial.print(sensors.getDeviceCount(), DEC);
Serial.println(" devices.");
// report parasite power requirements
Serial.print("Parasite power is: ");
if (sensors.isParasitePowerMode()) Serial.println("ON");
else Serial.println("OFF");
// assign address manually. the addresses below will beed to be changed
// to valid device addresses on your bus. device address can be retrieved
// by using either oneWire.search(deviceAddress) or individually via
// sensors.getAddress(deviceAddress, index)
//insideThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };
// Method 1:
// search for devices on the bus and assign based on an index. ideally,
// you would do this to initially discover addresses on the bus and then
// use those addresses and manually assign them (see above) once you know
// the devices on your bus (and assuming they don't change).
if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find address for Device 0");
// method 2: search()
// search() looks for the next device. Returns 1 if a new address has been
// returned. A zero might mean that the bus is shorted, there are no devices,
// or you have already retrieved all of them. It might be a good idea to
// check the CRC to make sure you didn't get garbage. The order is
// deterministic. You will always get the same devices in the same order
//
// Must be called before search()
//oneWire.reset_search();
// assigns the first address found to insideThermometer
//if (!oneWire.search(insideThermometer)) Serial.println("Unable to find address for insideThermometer");
// show the addresses we found on the bus
Serial.print("Device 0 Address: ");
printAddress(insideThermometer);
Serial.println();
// set the resolution to 9 bit (Each Dallas/Maxim device is capable of several different resolutions)
sensors.setResolution(insideThermometer, 9);
Serial.print("Device 0 Resolution: ");
Serial.print(sensors.getResolution(insideThermometer), DEC);
Serial.println();
}
// function to print the temperature for a device
void printTemperature(DeviceAddress deviceAddress)
{
// method 1 - slower
//Serial.print("Temp C: ");
//Serial.print(sensors.getTempC(deviceAddress));
//Serial.print(" Temp F: ");
//Serial.print(sensors.getTempF(deviceAddress)); // Makes a second call to getTempC and then converts to Fahrenheit
// method 2 - faster
float tempC = sensors.getTempC(deviceAddress);
Serial.print("Temp C: ");
Serial.print(tempC);
Serial.print(" Temp F: ");
Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
// It responds almost immediately. Let's print out the data
printTemperature(insideThermometer); // Use a simple function to print out the data
}
// function to print a device address
void printAddress(DeviceAddress deviceAddress)
{
for (uint8_t i = 0; i < 8; i++)
{
if (deviceAddress[i] < 16) Serial.print("0");
Serial.print(deviceAddress[i], HEX);
}
}

View file

@ -1,124 +0,0 @@
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
#define TEMPERATURE_PRECISION 9
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
int numberOfDevices; // Number of temperature devices found
DeviceAddress tempDeviceAddress; // We'll use this variable to store a found device address
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
// Grab a count of devices on the wire
numberOfDevices = sensors.getDeviceCount();
// locate devices on the bus
Serial.print("Locating devices...");
Serial.print("Found ");
Serial.print(numberOfDevices, DEC);
Serial.println(" devices.");
// report parasite power requirements
Serial.print("Parasite power is: ");
if (sensors.isParasitePowerMode()) Serial.println("ON");
else Serial.println("OFF");
// Loop through each device, print out address
for(int i=0;i<numberOfDevices; i++)
{
// Search the wire for address
if(sensors.getAddress(tempDeviceAddress, i))
{
Serial.print("Found device ");
Serial.print(i, DEC);
Serial.print(" with address: ");
printAddress(tempDeviceAddress);
Serial.println();
Serial.print("Setting resolution to ");
Serial.println(TEMPERATURE_PRECISION, DEC);
// set the resolution to TEMPERATURE_PRECISION bit (Each Dallas/Maxim device is capable of several different resolutions)
sensors.setResolution(tempDeviceAddress, TEMPERATURE_PRECISION);
Serial.print("Resolution actually set to: ");
Serial.print(sensors.getResolution(tempDeviceAddress), DEC);
Serial.println();
}else{
Serial.print("Found ghost device at ");
Serial.print(i, DEC);
Serial.print(" but could not detect address. Check power and cabling");
}
}
}
// function to print the temperature for a device
void printTemperature(DeviceAddress deviceAddress)
{
// method 1 - slower
//Serial.print("Temp C: ");
//Serial.print(sensors.getTempC(deviceAddress));
//Serial.print(" Temp F: ");
//Serial.print(sensors.getTempF(deviceAddress)); // Makes a second call to getTempC and then converts to Fahrenheit
// method 2 - faster
float tempC = sensors.getTempC(deviceAddress);
Serial.print("Temp C: ");
Serial.print(tempC);
Serial.print(" Temp F: ");
Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
// Loop through each device, print out temperature data
for(int i=0;i<numberOfDevices; i++)
{
// Search the wire for address
if(sensors.getAddress(tempDeviceAddress, i))
{
// Output the device ID
Serial.print("Temperature for device: ");
Serial.println(i,DEC);
// It responds almost immediately. Let's print out the data
printTemperature(tempDeviceAddress); // Use a simple function to print out the data
}
//else ghost device! Check your power requirements and cabling
}
}
// function to print a device address
void printAddress(DeviceAddress deviceAddress)
{
for (uint8_t i = 0; i < 8; i++)
{
if (deviceAddress[i] < 16) Serial.print("0");
Serial.print(deviceAddress[i], HEX);
}
}

View file

@ -1,49 +0,0 @@
// This sketch looks for 1-wire devices and
// prints their addresses (serial number) to
// the UART, in a format that is useful in Arduino sketches
// Tutorial:
// http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html
#include <OneWire.h>
OneWire ds(2); // Connect your 1-wire device to pin 2
void setup(void) {
Serial.begin(9600);
discoverOneWireDevices();
}
void discoverOneWireDevices(void) {
byte i;
byte present = 0;
byte data[12];
byte addr[8];
Serial.print("Looking for 1-Wire devices...\n\r");
while(ds.search(addr)) {
Serial.print("\n\rFound \'1-Wire\' device with address:\n\r");
for( i = 0; i < 8; i++) {
Serial.print("0x");
if (addr[i] < 16) {
Serial.print('0');
}
Serial.print(addr[i], HEX);
if (i < 7) {
Serial.print(", ");
}
}
if ( OneWire::crc8( addr, 7) != addr[7]) {
Serial.print("CRC is not valid!\n");
return;
}
}
Serial.print("\n\r\n\rThat's it.\r\n");
ds.reset_search();
return;
}
void loop(void) {
// nothing to see here
}

View file

@ -1,54 +0,0 @@
#######################################
# Syntax Coloring Map For Ultrasound
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
DallasTemperature KEYWORD1
OneWire KEYWORD1
AlarmHandler KEYWORD1
DeviceAddress KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
setResolution KEYWORD2
getResolution KEYWORD2
getTempC KEYWORD2
toFahrenheit KEYWORD2
getTempF KEYWORD2
getTempCByIndex KEYWORD2
getTempFByIndex KEYWORD2
setWaitForConversion KEYWORD2
getWaitForConversion KEYWORD2
requestTemperatures KEYWORD2
requestTemperaturesByAddress KEYWORD2
requestTemperaturesByIndex KEYWORD2
isParasitePowerMode KEYWORD2
begin KEYWORD2
getDeviceCount KEYWORD2
getAddress KEYWORD2
validAddress KEYWORD2
isConnected KEYWORD2
readScratchPad KEYWORD2
writeScratchPad KEYWORD2
readPowerSupply KEYWORD2
setHighAlarmTemp KEYWORD2
setLowAlarmTemp KEYWORD2
getHighAlarmTemp KEYWORD2
getLowAlarmTemp KEYWORD2
resetAlarmSearch KEYWORD2
alarmSearch KEYWORD2
hasAlarm KEYWORD2
toCelsius KEYWORD2
processAlarmss KEYWORD2
setAlarmHandlers KEYWORD2
defaultAlarmHandler KEYWORD2
calculateTemperature KEYWORD2
#######################################
# Constants (LITERAL1)
#######################################

126
build.gradle Normal file
View file

@ -0,0 +1,126 @@
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

138
build.xml
View file

@ -1,138 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Hal" >
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
<!--common properties-->
<property name="gitRoot" value="." />
<property name="srcDir" value="${gitRoot}/src" />
<property name="testDir" value="${gitRoot}/test" />
<property name="libDir" value="${gitRoot}/lib" />
<property name="buildRoot" value="${gitRoot}/build" />
<property name="buildDir" value="${buildRoot}/production" />
<property name="buildTestDir" value="${buildRoot}/test" />
<property name="releaseDir" value="${buildRoot}/release" />
<property name="reportsDir" value="${buildRoot}/reports" />
<!--define standard arduments for javac-->
<presetdef name="javac">
<javac includeantruntime="false" />
</presetdef>
<!-- ________________________ CLASSPATHS ________________________ -->
<!--classpath included when building-->
<path id="classpath.build">
<fileset dir="${libDir}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${buildDir}" />
</path>
<path id="classpath.test">
<pathelement location="${buildTestDir}" />
<!--include libraries used for building-->
<path refid="classpath.build"/>
</path>
<!-- ________________________ EXECUTION TARGETS ________________________ -->
<target name="run" depends="release">
<java fork="true" failonerror="true" classname="se.hal.HalServer">
<classpath>
<pathelement path="${releaseDir}/hal.jar"/>
<pathelement path="${libDir}/*"/> <!--wildcard may not be platform independent, ok?-->
</classpath>
</java>
</target>
<target name="remote-debug" depends="release">
<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}/hal.jar"/>
<pathelement path="${libDir}/*"/> <!--wildcard may not be platform independent, ok?-->
</classpath>
</java>
</target>
<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="${buildTestDir}" includes="**/*Test*.class" />
</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="release" depends="build">
<copy file="${gitRoot}/hal.conf.example" todir="${releaseDir}" />
<copy file="${gitRoot}/hal-default.db" todir="${releaseDir}" />
<copy file="${gitRoot}/logging.properties" todir="${releaseDir}" />
<copy file="${gitRoot}/run.sh" todir="${releaseDir}" />
<copydir src="${libDir}" dest="${releaseDir}/lib"
excludes="junit-*.jar,hamcrest-*.jar" />
<copydir src="resource/web" dest="${releaseDir}/resource/web" />
<jar destfile="${releaseDir}/hal.jar" basedir="${buildDir}" />
</target>
<target name="build" depends="build-dependencies">
<mkdir dir="${buildDir}" />
<javac srcdir="${srcDir}" destdir="${buildDir}" 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="${buildDir}">
<fileset dir="${srcDir}"
excludes="**/*.java" />
</copy>
</target>
<target name="build-dependencies">
<mkdir dir="${buildDir}" />
<get src="http://ci.koc.se/jenkins/job/Zutil/lastSuccessfulBuild/artifact/build/release/Zutil.jar" dest="${libDir}" verbose="true" usetimestamp="true"/>
</target>
<target name="build-test" depends="build">
<mkdir dir="${buildTestDir}" />
<javac srcdir="${testDir}" destdir="${buildTestDir}" debug="yes" debugLevel="lines,vars,source" fork="yes">
<classpath refid="classpath.test" />
<include name="**/*.java" />
<exclude name="se/hal/test/JarvisSyntersizerTest.java" />
</javac>
<copy todir="${buildTestDir}">
<fileset dir="${testDir}"
excludes="**/*.java" />
</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>

BIN
external/Z-Stick_Gen5_Drivers.zip vendored Normal file

Binary file not shown.

View file

@ -1,74 +0,0 @@
MARY Software User Agreement
11 April 2011
MARY is licensed under the following terms.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Applicable Licenses
MARY is built upon a number of other open source technologies and products.
Here is a list of those products with links to their licenses.
hts_engine: the HMM-based speech synthesis code in MARY TTS is based on HTS, ported to Java by DFKI. The original HTS can be obtained from
http://hts-engine.sourceforge.net/ -- it is released under the New and
Simplified BSD License.
freetts: MARY uses code from FreeTTS (http://freetts.sf.net) for various
processing modules and as the source of one method for waveform synthesis.
FreeTTS is licensed under the (BSD-style) FreeTTS license, see
doc/licenses/freetts-license.txt.
JTok: The JTok tokenizer from http://heartofgold.dfki.de is distributed
under the GNU Lesser General Public License, see http://www.gnu.org or
doc/licenses/LGPL.txt.
jsresources.jar: A few utility classes from http://www.jsresources.org
are distributed under the terms of the jsresources license, see
doc/licenses/jsresources-license.txt.
log4j: MARY uses log4j (http://logging.apache.org/log4j) as a logging
mechanism. log4j is distributed under the Apache Software License, see
http://www.apache.org or doc/licenses/apache-software-license.txt
JUnit: For unit testing of the java source, mary uses JUnit
(http://junit.org). JUnit is licensed under the Common Public License, see
http://junit.org or doc/licenses/CPL.txt.
java-diff: A java diff implementation from http://www.incava.org/projects/java-diff for input-output-comparisons in the
Mary Expert Interface. java-diff is licensed under the GNU Lesser General
Public License, see http://www.gnu.org or doc/licenses/LGPL.txt.
fast-md5: A fast md5 checksum implementation from http://www.twmacinta.com/myjava/fast_md5.php
used for computing checksums after downloading voices. fast-md5 is licensed under
the GNU Lesser General Public License, see http://www.gnu.org or doc/licenses/LGPL.txt.
JavaOpenAIR: MARY can optionally be used as an OpenAIR component,
building on the JavaOpenAIR reference implementation from
http://www.mindmakers.org, which is licensed under the
(BSD-style) JavaOpenAIR license, see doc/licenses/JavaOpenAIR-license.txt
(files concerned: JavaOpenAIR.jar)
mwdumper: A tool for extracting sets of pages from a MediaWiki dump file.
mwdumper is MIT-style like licensed, see http://www.mediawiki.org/wiki/Mwdumper
and for the license http://en.wikipedia.org/wiki/MIT_License.
(files concerned: mwdumper-2008-04-13.jar)
sgt: The Scientific Graphics Toolkit (sgt) is provided by the NOAA/PMEL/EPIC group (see http://www.epic.noaa.gov/java/sgt/) under the BSD-style EPIC license, see doc/licenses/epic-license.txt.
IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS
AND CONDITIONS PRIOR TO USE OF THIS CONTENT.

View file

@ -1,10 +0,0 @@
#!/bin/bash
##########################################################################
# MARY TTS client
##########################################################################
# Set the Mary base installation directory in an environment variable:
BINDIR="`dirname "$0"`"
export MARY_BASE="`(cd "$BINDIR"/.. ; pwd)`"
java -showversion -ea -Dserver.host=localhost -Dserver.port=59125 -jar "$MARY_BASE/lib/marytts-client-5.1.2-jar-with-dependencies.jar"

View file

@ -1,10 +0,0 @@
@echo off
set BINDIR=%~dp0
call :RESOLVE "%BINDIR%\.." MARY_BASE
java -showversion -ea -Dserver.host=localhost -Dserver.port=59125 -jar "%MARY_BASE%\lib\marytts-client-5.1.2-jar-with-dependencies.jar"
goto :EOF
:RESOLVE
set %2=%~f1
goto :EOF

View file

@ -1,5 +0,0 @@
#!/bin/sh
BINDIR="`dirname "$0"`"
export MARY_BASE="`(cd "$BINDIR"/.. ; pwd)`"
java -showversion -ea -Dmary.base="$MARY_BASE" $* -cp "$MARY_BASE/lib/*" marytts.tools.install.InstallerGUI

View file

@ -1,9 +0,0 @@
@echo off
set BINDIR=%~dp0
call :RESOLVE "%BINDIR%\.." MARY_BASE
java -showversion -ea -Dmary.base="%MARY_BASE%" -cp ".;%MARY_BASE%\lib\*" marytts.tools.install.InstallerGUI
goto :EOF
:RESOLVE
set %2=%~f1
goto :EOF

View file

@ -1,11 +0,0 @@
#!/bin/bash
##########################################################################
# MARY TTS server
##########################################################################
# Set the Mary base installation directory in an environment variable:
BINDIR="`dirname "$0"`"
export MARY_BASE="`(cd "$BINDIR"/.. ; pwd)`"
java -showversion -ea -Xms40m -Xmx1g -cp "$MARY_BASE/lib/*" -Dmary.base="$MARY_BASE" $* marytts.server.Mary

View file

@ -1,14 +0,0 @@
@echo off
rem Set the Mary base installation directory in an environment variable:
set BINDIR=%~dp0
call :RESOLVE "%BINDIR%\.." MARY_BASE
set CLASSPATH=".;%MARY_BASE%\lib\*"
java -showversion -ea -Xms40m -Xmx1g -cp %CLASSPATH% "-Dmary.base=%MARY_BASE%" marytts.server.Mary
goto :EOF
:RESOLVE
set %2=%~f1
goto :EOF

View file

@ -1,367 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket, sys, types, getopt
languageNames = {'de':'German',
'en':'English',
'en_US':'US English',
'tib':'Tibetan'}
class MaryClient:
specificationVersion = "0.1"
"""Python implementation of a MARY TTS client"""
def __init__( self, host="cling.dfki.uni-sb.de", port=59125, profile=False, quiet=False ):
self.host = host
self.port = port
self.profile = profile
self.quiet = quiet
self.allVoices = None # array of Voice objects
self.voicesByLocaleMap = {} # Map locale strings to arrays of Voice objects
self.allDataTypes = None # array of DataType objects
self.inputDataTypes = None # array of DataType objects
self.outputDataTypes = None # array of DataType objects
self.serverExampleTexts = {}
self.voiceExampleTexts = {}
self.serverVersionInfo = u''
if not self.quiet:
sys.stderr.write( "MARY TTS Python Client %s\n" % ( self.specificationVersion ) )
try:
info = self.getServerVersionInfo()
except:
sys.stderr.write( "Problem connecting to mary server at %s:%i\n" % ( self.host, self.port ) )
raise
sys.stderr.write( "Connected to %s:%i, " % ( self.host, self.port ) )
sys.stderr.write( info )
sys.stderr.write( '\n' )
def __getServerInfo( self, request="", marySocket=None ):
"""Get answer to request from mary server. Returns a list of unicode strings,
each representing a line without the line break.
"""
closeSocket = False
if marySocket is None:
closeSocket = True
marySocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
marySocket.connect( ( self.host, self.port ) )
assert isinstance(marySocket, socket.SocketType)
maryFile = marySocket.makefile( 'rwb', 1 ) # read-write, line-buffered
maryFile.write( unicode( request+"\n" ).encode( 'utf-8' ) )
result = []
while True:
got = unicode( maryFile.readline().strip(), 'utf-8' )
# read until end of file or an empty line is read:
if not got: break
result.append(got)
if closeSocket:
marySocket.close()
return result
def getServerVersionInfo( self ):
"Get version info from server. Returns a unicode string"
if self.serverVersionInfo == u'':
# need to get it from server
self.serverVersionInfo = u'\n'.join(self.__getServerInfo("MARY VERSION"))
return self.serverVersionInfo
def getAllDataTypes(self, locale=None):
"""Obtain a list of all data types known to the server. If the information is not
yet available, the server is queried. This is optional information
which is not required for the normal operation of the client, but
may help to avoid incompatibilities.
Returns an array of DataType objects
"""
if self.allDataTypes is None:
self.__fillDataTypes()
assert self.allDataTypes is not None and len( self.allDataTypes ) > 0
if locale is None:
return self.allDataTypes
else:
assert isinstance(locale, types.UnicodeType), "Unexpected type for locale: '%s'" % (type(locale))
return [d for d in self.allDataTypes if d.locale is None or d.locale == locale]
def getInputDataTypes(self,locale=None):
"""Obtain a list of input data types known to the server. If the information is not
yet available, the server is queried. This is optional information
which is not required for the normal operation of the client, but
may help to avoid incompatibilities.
Returns an arry of DataType objects
"""
if self.inputDataTypes is None:
self.__fillDataTypes()
assert self.inputDataTypes is not None and len( self.inputDataTypes ) > 0
if locale is None:
return self.inputDataTypes
else:
assert isinstance(locale, types.UnicodeType), "Unexpected type for locale: '%s'" % (type(locale))
return [d for d in self.inputDataTypes if d.locale is None or d.locale == locale]
def getOutputDataTypes(self, locale=None):
"""Obtain a list of output data types known to the server. If the information is not
yet available, the server is queried. This is optional information
which is not required for the normal operation of the client, but
may help to avoid incompatibilities.
Returns an arry of DataType objects
"""
if self.outputDataTypes is None:
self.__fillDataTypes()
assert self.outputDataTypes is not None and len( self.outputDataTypes ) > 0
if locale is None:
return self.outputDataTypes
else:
assert isinstance(locale, types.UnicodeType), "Unexpected type for locale: '%s'" % (type(locale))
return [d for d in self.outputDataTypes if d.locale is None or d.locale == locale]
def __fillDataTypes( self ):
self.allDataTypes = []
self.inputDataTypes = []
self.outputDataTypes = []
marySocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
marySocket.connect( ( self.host, self.port ) )
# Expect a variable number of lines of the kind
# RAWMARYXML INPUT OUTPUT
# TEXT_DE LOCALE=de INPUT
# AUDIO OUTPUT
typeStrings = self.__getServerInfo( "MARY LIST DATATYPES", marySocket )
if not typeStrings or len(typeStrings) == 0:
raise IOError( "Could not get list of data types from Mary server" )
marySocket.close()
for typeString in typeStrings:
parts = typeString.split()
if len( parts ) == 0:
continue
name = parts[0]
isInputType = False
isOutputType = False
locale = None
for part in parts[1:]:
if part[:7] == "LOCALE=":
locale = part[7:]
elif part == "INPUT":
isInputType = True
elif part == "OUTPUT":
isOutputType = True
dt = DataType( name, locale, isInputType, isOutputType )
self.allDataTypes.append( dt )
if dt.isInputType:
self.inputDataTypes.append( dt )
if dt.isOutputType:
self.outputDataTypes.append( dt )
def getVoices( self, locale=None ):
"""Obtain a list of voices known to the server. If the information is not
yet available, the server is queried. This is optional information
which is not required for the normal operation of the client, but
may help to avoid incompatibilities.
Returns an array of Voice objects
"""
if self.allVoices is None:
self.__fillVoices()
assert self.allVoices is not None and len( self.allVoices ) > 0
if locale is None:
return self.allVoices
else:
assert isinstance(locale, types.UnicodeType), "Unexpected type for locale: '%s'" % (type(locale))
if self.voicesByLocaleMap.has_key(locale):
return self.voicesByLocaleMap[locale]
else:
raise Exception("No voices for locale '%s'" % (locale))
def __fillVoices( self ):
self.allVoices = []
self.voicesByLocaleMap = {}
marySocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
marySocket.connect( ( self.host, self.port ) )
# Expect a variable number of lines of the kind
# de7 de female
# us2 en male
# dfki-stadium-emo de male limited
voiceStrings = self.__getServerInfo( "MARY LIST VOICES", marySocket )
if not voiceStrings or len(voiceStrings) == 0:
raise IOError( "Could not get list of voices from Mary server" )
marySocket.close()
for voiceString in voiceStrings:
parts = voiceString.split()
if len( parts ) < 3:
continue
name = parts[0]
locale = parts[1]
gender = parts[2]
domain = None
if len( parts ) > 3:
domain = parts[3]
voice = Voice( name, locale, gender, domain )
self.allVoices.append( voice )
localeVoices = None
if self.voicesByLocaleMap.has_key( locale ):
localeVoices = self.voicesByLocaleMap[locale]
else:
localeVoices = []
self.voicesByLocaleMap[locale] = localeVoices
localeVoices.append( voice )
def getGeneralDomainVoices( self, locale=None ):
"""Obtain a list of general domain voices known to the server. If the information is not
yet available, the server is queried. This is optional information
which is not required for the normal operation of the client, but
may help to avoid incompatibilities.
Returns an array of Voice objects
"""
return [v for v in self.getVoices( locale ) if not v.isLimitedDomain]
def getLimitedDomainVoices( self, locale=None ):
"""Obtain a list of limited domain voices known to the server. If the information is not
yet available, the server is queried. This is optional information
which is not required for the normal operation of the client, but
may help to avoid incompatibilities.
Returns an array of Voice objects
"""
return [v for v in self.getVoices( locale ) if v.isLimitedDomain]
def getAvailableLanguages(self):
""" Check available voices and return a list of tuples (abbrev, name)
representing the available languages -- e.g. [('en', 'English'),('de', 'German')].
"""
if self.allVoices is None:
self.__fillVoices()
assert self.allVoices is not None and len( self.allVoices ) > 0
languages = []
for l in self.voicesByLocaleMap.keys():
if languageNames.has_key(l):
languages.append((l,languageNames[l]))
else:
languages.append((l, l))
return languages
def getServerExampleText( self, dataType ):
"""Request an example text for a given data type from the server.
dataType the string representation of the data type,
e.g. "RAWMARYXML". This is optional information
which is not required for the normal operation of the client, but
may help to avoid incompatibilities."""
if not self.serverExampleTexts.has_key( dataType ):
exampleTexts = self.__getServerInfo( "MARY EXAMPLETEXT %s" % ( dataType ) )
if not exampleTexts or len(exampleTexts) == 0:
raise IOError( "Could not get example text for type '%s' from Mary server" % (dataType))
exampleText = u'\n'.join(exampleTexts)
self.serverExampleTexts[dataType] = exampleText
return self.serverExampleTexts[dataType]
def process( self, input, inputType, outputType, audioType=None, defaultVoiceName=None, output=sys.stdout ):
assert type( input ) in types.StringTypes
assert type( inputType ) in types.StringTypes
assert type( outputType ) in types.StringTypes
assert audioType is None or type( audioType ) in types.StringTypes
assert defaultVoiceName is None or type( defaultVoiceName ) in types.StringTypes
assert callable( getattr( output, 'write' ) )
if type( input ) != types.UnicodeType:
input = unicode( input, 'utf-8' )
maryInfoSocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
maryInfoSocket.connect( ( self.host, self.port ) )
assert type( maryInfoSocket ) is socket.SocketType
maryInfo = maryInfoSocket.makefile( 'rwb', 1 ) # read-write, line-buffered
maryInfo.write( unicode( "MARY IN=%s OUT=%s" % ( inputType, outputType ), 'utf-8' ) )
if audioType:
maryInfo.write( unicode( " AUDIO=%s" % ( audioType ), 'utf-8' ) )
if defaultVoiceName:
maryInfo.write( unicode( " VOICE=%s" % ( defaultVoiceName ), 'utf-8' ) )
maryInfo.write( "\r\n" )
# Receive a request ID:
id = maryInfo.readline()
maryDataSocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
maryDataSocket.connect( ( self.host, self.port ) )
assert type( maryDataSocket ) is socket.SocketType
maryDataSocket.sendall( id ) # includes newline
maryDataSocket.sendall( input.encode( 'utf-8' ) )
maryDataSocket.shutdown( 1 ) # shutdown writing
# Set mary info socket to non-blocking, so we only read somthing
# if there is something to read:
maryInfoSocket.setblocking( 0 )
while True:
try:
err = maryInfoSocket.recv( 8192 )
if err: sys.stderr.write( err )
except:
pass
got = maryDataSocket.recv( 8192 )
if not got: break
output.write( got )
maryInfoSocket.setblocking( 1 )
while True:
err = maryInfoSocket.recv( 8192 )
if not err: break
sys.stderr.write( err )
################ data representation classes ##################
class DataType:
def __init__( self, name, locale=None, isInputType=False, isOutputType=False ):
self.name = name
self.locale = locale
self.isInputType = isInputType
self.isOutputType = isOutputType
def isTextType( self ):
return self.name != "AUDIO"
class Voice:
def __init__( self, name, locale, gender, domain="general" ):
self.name = name
self.locale = locale
self.gender = gender
self.domain = domain
if not domain or domain == "general":
self.isLimitedDomain = False
else:
self.isLimitedDomain = True
def __str__(self):
if languageNames.has_key(self.locale):
langName = languageNames[self.locale]
else:
langName = self.locale
if self.isLimitedDomain:
return "%s (%s, %s %s)" % (self.name, self.domain, langName, self.gender)
else:
return "%s (%s %s)" % (self.name, langName, self.gender)
##################### Main #########################
if __name__ == '__main__':
serverHost = "cling.dfki.uni-sb.de"
serverPort = 59125
inputType = "TEXT"
outputType = "AUDIO"
audioType = "WAVE"
defaultVoice = None
inputEncoding = 'utf-8'
( options, rest ) = getopt.getopt( sys.argv[1:], '', \
['server.host=', 'server.port=', 'input.type=', 'output.type=', \
'audio.type=', 'voice.default=', 'input.encoding='] )
for ( option, value ) in options:
if option == '--server.host': serverHost = value
elif option == '--server.port': serverPort = int( value )
elif option == '--input.type': inputType = value
elif option == '--output.type': outputType = value
elif option == '--audio.type': audioType = value
elif option == '--voice.default': defaultVoice = value
elif option == '--input.encoding': inputEncoding = value
if len( rest )>0: # have input file
inputFile = file( rest[0] )
else:
inputFile = sys.stdin
input = unicode( ''.join( inputFile.readlines() ), inputEncoding )
if len( rest )>1: # also have output file
outputFile = file( rest[1] )
else:
outputFile = sys.stdout
maryClient = MaryClient( serverHost, serverPort )
maryClient.process( input, inputType, outputType, audioType, defaultVoice, outputFile )

View file

@ -1,96 +0,0 @@
/**
* Copyright 2000-2006 DFKI GmbH.
* All Rights Reserved. Use is subject to license terms.
*
* Permission is hereby granted, free of charge, to use and distribute
* this software and its documentation without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of this work, and to
* permit persons to whom this work is furnished to do so, subject to
* the following conditions:
*
* 1. The code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Any modifications must be clearly marked as such.
* 3. Original authors' names are not deleted.
* 4. The authors' names are not used to endorse or promote products
* derived from this software without specific prior written
* permission.
*
* DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE
* CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
import marytts.client.MaryClient;
import marytts.util.data.audio.AudioPlayer;
import marytts.util.http.Address;
import javax.sound.sampled.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.UnknownHostException;
/**
* A demo class illustrating how to use the MaryClient class.
* This will connect to a MARY server, version 4.x.
* It requires maryclient.jar from MARY 4.0.
* This works transparently with MARY servers in both http and socket server mode.
*
* Compile this as follows:
* <code>javac -cp maryclient.jar MaryClientUser.java</code>
*
* And run as:
* <code>java -cp .:maryclient.jar MaryClientUser</code>
*
* @author marc
*
*/
public class MaryClientUser {
public static void main(String[] args)
throws IOException, UnknownHostException, UnsupportedAudioFileException,
InterruptedException
{
String serverHost = System.getProperty("server.host", "cling.dfki.uni-sb.de");
int serverPort = Integer.getInteger("server.port", 59125).intValue();
MaryClient mary = MaryClient.getMaryClient(new Address(serverHost, serverPort));
String text = "Willkommen in der Welt der Sprachsynthese!";
// If the given locale is not supported by the server, it returns
// an ambigous exception: "Problem processing the data."
String locale = "de"; // or US English (en-US), Telugu (te), Turkish (tr), ...
String inputType = "TEXT";
String outputType = "AUDIO";
String audioType = "WAVE";
String defaultVoiceName = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
mary.process(text, inputType, outputType, locale, audioType, defaultVoiceName, baos);
// The byte array constitutes a full wave file, including the headers.
// And now, play the audio data:
AudioInputStream ais = AudioSystem.getAudioInputStream(
new ByteArrayInputStream(baos.toByteArray()));
LineListener lineListener = new LineListener() {
public void update(LineEvent event) {
if (event.getType() == LineEvent.Type.START) {
System.err.println("Audio started playing.");
} else if (event.getType() == LineEvent.Type.STOP) {
System.err.println("Audio stopped playing.");
} else if (event.getType() == LineEvent.Type.OPEN) {
System.err.println("Audio line opened.");
} else if (event.getType() == LineEvent.Type.CLOSE) {
System.err.println("Audio line closed.");
}
}
};
AudioPlayer ap = new AudioPlayer(ais, lineListener);
ap.start();
}
}

View file

@ -1,45 +0,0 @@
##########################################################################
# Copyright (C) 2000-2006 DFKI GmbH.
# All rights reserved. Use is subject to license terms.
#
# Permission is hereby granted, free of charge, to use and distribute
# this software and its documentation without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of this work, and to
# permit persons to whom this work is furnished to do so, subject to
# the following conditions:
#
# 1. The code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
# 2. Any modifications must be clearly marked as such.
# 3. Original authors' names are not deleted.
# 4. The authors' names are not used to endorse or promote products
# derived from this software without specific prior written
# permission.
#
# DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE
# CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
# THIS SOFTWARE.
##########################################################################
CC=g++
CFLAGS=-Wall -w -O3 -g
ICUDIR=/usr/local/icu
ICULIBS=-Wl,-R,$(ICUDIR)/lib -L$(ICUDIR)/lib -licuuc -licui18n -ldl
all: MaryDemo
MaryDemo: MaryClient.o MaryDemo.o
$(CC) $(CFLAGS) *.o -o MaryDemo $(LIBS)
%.o: %.cc
$(CC) $(CFLAGS) $(RFLAGS) -o $@ -c $<
clean:
rm -rf *.o ./MaryDemo

View file

@ -1,277 +0,0 @@
/**
* Copyright 2000-2006 DFKI GmbH.
* All Rights Reserved. Use is subject to license terms.
*
* Permission is hereby granted, free of charge, to use and distribute
* this software and its documentation without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of this work, and to
* permit persons to whom this work is furnished to do so, subject to
* the following conditions:
*
* 1. The code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Any modifications must be clearly marked as such.
* 3. Original authors' names are not deleted.
* 4. The authors' names are not used to endorse or promote products
* derived from this software without specific prior written
* permission.
*
* DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE
* CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <netdb.h>
#include <stdlib.h>
#include <iostream>
#include <string.h>
#include "MaryClient.h"
using namespace std;
/**
* A C++ implementation of a simple client to the MARY TTS system.
* result: an empty string serving as the container for the output.
* It will return text or audio data; text data will be encoded as UTF-8.
* inputText: the UTF-8 encoded text (or XML document) to send as a request
* maryInFormat: the input type of the data in inputText, e.g. TEXT
* maryOutFormat: the output type to produce, e.g. MBROLA, AUDIO
* locale: the language of the input, e.g. EN-US, DE
* audioType: for AUDIO output, the type of audio data to produce,
* e.g. WAVE or MP3.
* voice: the voice to be used, e.g. cmu-slt-hsmm, bits3.
* effects: the list of effects to be generated.
* return value: 0 on success, negative on failure.
*/
int
MaryClient::maryQuery( int server_port,
string server_host,
string& result,
string inputText,
string maryInFormat,
string maryOutFormat,
string locale,
string audioType,
string voice,
string effects ) {
// prepare the request
string query = "MARY";
query += " IN=" + maryInFormat;
query += " OUT=" + maryOutFormat;
query += " LOCALE=" + locale; // remove this line, if using an older version than MARY 4.0
query += " AUDIO=" + audioType;
query += " VOICE=" + voice;
if (effects != "") {
query += " EFFECTS=" + effects;
}
query += "\012\015";
//cout << "Constructed query: " << query << endl;
// declare connection stuff
struct sockaddr_in maryServer;
struct sockaddr_in maryClient;
struct hostent* hostInfo;
// declare variables
int maryInfoSocket;
int maryDataSocket;
// set configuration parameters
// get host information
hostInfo = gethostbyname (server_host.c_str());
if (hostInfo == NULL)
{
return -2;
}
// create a tcp connection to the mary server
maryInfoSocket = socket (AF_INET, SOCK_STREAM, 0);
// verify that the socket could be opened successfully
if (maryInfoSocket == -1)
{
return -2;
}
else
// autoflush stdout, bind and connect
{
maryClient.sin_family = AF_INET;
maryClient.sin_port = htons (0);
maryClient.sin_addr.s_addr = INADDR_ANY;
int status = bind (maryInfoSocket, (struct sockaddr*) &maryClient, sizeof (maryClient));
if (status != 0)
{
return -2;
}
maryServer.sin_family = AF_INET;
maryServer.sin_port = htons (server_port);
memcpy ((char*) &maryServer.sin_addr.s_addr, hostInfo->h_addr_list [0], hostInfo->h_length);
status = connect (maryInfoSocket, (struct sockaddr*) &maryServer, sizeof (maryServer));
if (status != 0)
{
return -2;
}
}
// send request to the Mary server
if (send (maryInfoSocket, query.c_str (), query.size (), 0) == -1)
{
return -2;
}
// receive the request id
char id [32] = "";
if (recv (maryInfoSocket, id, 32, 0) == -1)
{
return -2;
}
//cout << "Read id: " << id << endl;
// create a tcp connection to the mary server
maryDataSocket = socket (AF_INET, SOCK_STREAM, 0);
// verify that the socket could be opened successfully
if (maryDataSocket == -1)
{
return -2;
}
else
// autoflush stdout, bind and connect
{
maryClient.sin_family = AF_INET;
maryClient.sin_port = htons (0);
maryClient.sin_addr.s_addr = INADDR_ANY;
int status = bind (maryDataSocket, (struct sockaddr*) &maryClient, sizeof (maryClient));
if (status != 0)
{
return -2;
}
maryServer.sin_family = AF_INET;
maryServer.sin_port = htons (server_port);
memcpy ((char*) &maryServer.sin_addr.s_addr, hostInfo->h_addr_list [0], hostInfo->h_length);
status = connect (maryDataSocket, (struct sockaddr*) &maryServer, sizeof (maryServer));
if (status != 0)
{
return -2;
}
}
// send the request id to the Mary server
if (send (maryDataSocket, id, strlen (id), 0) == -1)
{
return -2;
}
//cout << "Sending request: " << inputText << endl;
// send the query to the Mary server
if (send (maryDataSocket, inputText.c_str (), inputText.size (), 0) == -1)
{
return -2;
}
if (send (maryDataSocket, "\012\015", 2, 0) == -1)
{
return -2;
}
// shutdown data socket
shutdown (maryDataSocket, 1);
//cout << "Reading result" << endl;
unsigned int total_bytes = 0;
int recv_bytes = 0;
char data [1024] = "";
result [0] = '\0';
// receive the request result
do
{
data [0] = '\0';
recv_bytes = recv (maryDataSocket, data, 1024, 0);
if (recv_bytes == -1)
{
return -2;
}
else if (recv_bytes > 0)
{
//cout << "("<<recv_bytes<<")" << endl;
total_bytes += recv_bytes;
data [recv_bytes] = '\0';
if (maryOutFormat == "AUDIO")
{
for (unsigned int i=0; i<recv_bytes; i++)
{
result += data [i];
}
}
else
{
result += data;
}
}
} while (recv_bytes != 0);
if (result.size () != total_bytes)
{
cerr << "error: total bytes received != result bytes!" << endl;
cerr << " total bytes received = " << total_bytes << endl;
cerr << " result bytes = " << result.size () << endl;
}
// receive the request error
do
{
data [0] = '\0';
recv_bytes = recv (maryInfoSocket, data, 1024, 0);
if (recv_bytes == -1)
{
return -2;
}
else if (recv_bytes > 0)
{
cerr << endl << "Mary error code: " << data << endl;
return -3;
}
} while (recv_bytes != 0);
// close all open sockets
close (maryInfoSocket);
close (maryDataSocket);
return 0;
}

View file

@ -1,290 +0,0 @@
/**
* Copyright 2000-2006 DFKI GmbH.
* All Rights Reserved. Use is subject to license terms.
*
* Permission is hereby granted, free of charge, to use and distribute
* this software and its documentation without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of this work, and to
* permit persons to whom this work is furnished to do so, subject to
* the following conditions:
*
* 1. The code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Any modifications must be clearly marked as such.
* 3. Original authors' names are not deleted.
* 4. The authors' names are not used to endorse or promote products
* derived from this software without specific prior written
* permission.
*
* DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE
* CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifdef _WIN32
// use compiler option -L/<path to>/libwsock32.a
#include <winsock.h>
#else
#include <netdb.h>
#endif
#include <stdlib.h>
#include <iostream>
#include <string.h>
#include "MaryClient.h"
using namespace std;
/**
* A C++ implementation of a simple client to the MARY TTS system.
* result: an empty string serving as the container for the output.
* It will return text or audio data; text data will be encoded as UTF-8.
* inputText: the UTF-8 encoded text (or XML document) to send as a request
* maryInFormat: the input type of the data in inputText, e.g. TEXT
* maryOutFormat: the output type to produce, e.g. MBROLA, AUDIO
* locale: the language of the input, e.g. EN-US, DE
* audioType: for AUDIO output, the type of audio data to produce,
* e.g. WAVE or MP3.
* voice: the voice to be used, e.g. cmu-slt-hsmm, bits3.
* effects: the list of effects to be generated.
* return value: 0 on success, negative on failure.
*/
int
MaryClient::maryQuery( int server_port,
string server_host,
string& result,
string inputText,
string maryInFormat,
string maryOutFormat,
string locale,
string audioType,
string voice,
string effects ) {
// prepare the request
string query = "MARY";
query += " IN=" + maryInFormat;
query += " OUT=" + maryOutFormat;
query += " LOCALE=" + locale; // remove this line, if using an older version than MARY 4.0
query += " AUDIO=" + audioType;
query += " VOICE=" + voice;
if (effects != "") {
query += " EFFECTS=" + effects;
}
query += "\012\015";
//cout << "Constructed query: " << query << endl;
// declare connection stuff
struct sockaddr_in maryServer;
struct sockaddr_in maryClient;
struct hostent* hostInfo;
// declare variables
int maryInfoSocket;
int maryDataSocket;
// set configuration parameters
// get host information
hostInfo = gethostbyname (server_host.c_str());
if (hostInfo == NULL)
{
return -2;
}
// create a tcp connection to the mary server
maryInfoSocket = socket (AF_INET, SOCK_STREAM, 0);
// verify that the socket could be opened successfully
if (maryInfoSocket == -1)
{
return -2;
}
else
// autoflush stdout, bind and connect
{
maryClient.sin_family = AF_INET;
maryClient.sin_port = htons (0);
maryClient.sin_addr.s_addr = INADDR_ANY;
int status = bind (maryInfoSocket, (struct sockaddr*) &maryClient, sizeof (maryClient));
if (status != 0)
{
return -2;
}
maryServer.sin_family = AF_INET;
maryServer.sin_port = htons (server_port);
memcpy ((char*) &maryServer.sin_addr.s_addr, hostInfo->h_addr_list [0], hostInfo->h_length);
status = connect (maryInfoSocket, (struct sockaddr*) &maryServer, sizeof (maryServer));
if (status != 0)
{
return -2;
}
}
// send request to the Mary server
if (send (maryInfoSocket, query.c_str (), query.size (), 0) == -1)
{
return -2;
}
// receive the request id
char id [32] = "";
if (recv (maryInfoSocket, id, 32, 0) == -1)
{
return -2;
}
//cout << "Read id: " << id << endl;
// create a tcp connection to the mary server
maryDataSocket = socket (AF_INET, SOCK_STREAM, 0);
// verify that the socket could be opened successfully
if (maryDataSocket == -1)
{
return -2;
}
else
// autoflush stdout, bind and connect
{
maryClient.sin_family = AF_INET;
maryClient.sin_port = htons (0);
maryClient.sin_addr.s_addr = INADDR_ANY;
int status = bind (maryDataSocket, (struct sockaddr*) &maryClient, sizeof (maryClient));
if (status != 0)
{
return -2;
}
maryServer.sin_family = AF_INET;
maryServer.sin_port = htons (server_port);
memcpy ((char*) &maryServer.sin_addr.s_addr, hostInfo->h_addr_list [0], hostInfo->h_length);
status = connect (maryDataSocket, (struct sockaddr*) &maryServer, sizeof (maryServer));
if (status != 0)
{
return -2;
}
}
// send the request id to the Mary server
if (send (maryDataSocket, id, strlen (id), 0) == -1)
{
return -2;
}
//cout << "Sending request: " << inputText << endl;
// send the query to the Mary server
if (send (maryDataSocket, inputText.c_str (), inputText.size (), 0) == -1)
{
return -2;
}
if (send (maryDataSocket, "\012\015", 2, 0) == -1)
{
return -2;
}
// shutdown data socket
shutdown (maryDataSocket, 1);
//cout << "Reading result" << endl;
unsigned int total_bytes = 0;
int recv_bytes = 0;
char data [1024] = "";
result [0] = '\0';
// receive the request result
do
{
data [0] = '\0';
recv_bytes = recv (maryDataSocket, data, 1024, 0);
if (recv_bytes == -1)
{
return -2;
}
else if (recv_bytes > 0)
{
//cout << "("<<recv_bytes<<")" << endl;
total_bytes += recv_bytes;
data [recv_bytes] = '\0';
if (maryOutFormat == "AUDIO")
{
for (unsigned int i=0; i<recv_bytes; i++)
{
result += data [i];
}
}
else
{
result += data;
}
}
} while (recv_bytes != 0);
if (result.size () != total_bytes)
{
cerr << "error: total bytes received != result bytes!" << endl;
cerr << " total bytes received = " << total_bytes << endl;
cerr << " result bytes = " << result.size () << endl;
}
// receive the request error
do
{
data [0] = '\0';
recv_bytes = recv (maryInfoSocket, data, 1024, 0);
if (recv_bytes == -1)
{
return -2;
}
else if (recv_bytes > 0)
{
cerr << endl << "Mary error code: " << data << endl;
return -3;
}
} while (recv_bytes != 0);
#ifdef _WIN32
// close all open sockets Windows
closesocket (maryInfoSocket);
closesocket (maryDataSocket);
#else
// close all open sockets UNIX
close (maryInfoSocket);
close (maryDataSocket);
#endif
return 0;
}

View file

@ -1,49 +0,0 @@
/**
* Copyright 2000-2006 DFKI GmbH.
* All Rights Reserved. Use is subject to license terms.
*
* Permission is hereby granted, free of charge, to use and distribute
* this software and its documentation without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of this work, and to
* permit persons to whom this work is furnished to do so, subject to
* the following conditions:
*
* 1. The code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Any modifications must be clearly marked as such.
* 3. Original authors' names are not deleted.
* 4. The authors' names are not used to endorse or promote products
* derived from this software without specific prior written
* permission.
*
* DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE
* CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef __MARYCLIENT_H_
#define __MARYCLIENT_H_
class MaryClient {
public:
// send query to the MaryServer
int maryQuery( int server_port,
std::string server_host,
std::string& result,
std::string inputText,
std::string maryInFormat,
std::string maryOutFormat,
std::string locale,
std::string audioType,
std::string voice,
std::string effects = "" );
};
#endif

View file

@ -1,87 +0,0 @@
/**
* Copyright 2000-2006 DFKI GmbH.
* All Rights Reserved. Use is subject to license terms.
*
* Permission is hereby granted, free of charge, to use and distribute
* this software and its documentation without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of this work, and to
* permit persons to whom this work is furnished to do so, subject to
* the following conditions:
*
* 1. The code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Any modifications must be clearly marked as such.
* 3. Original authors' names are not deleted.
* 4. The authors' names are not used to endorse or promote products
* derived from this software without specific prior written
* permission.
*
* DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE
* CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
// This version, adapted to MARY 4.0, provided by Sebastian Ptock.
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include "MaryClient.h"
using namespace std;
/**
* Demonstration code for using the MaryClient.
+ Call this as:
* ./MaryDemo
* or
* ./MaryDemo > output.wav
*/
int main() {
int server_port = 59125;
string server_host = "localhost";
string inputText = "Welcome to the world of speech synthesis!";
string maryInFormat = "TEXT";
string maryOutFormat = "AUDIO";
//string maryOutFormat = "REALISED_DURATIONS";
string locale = "en-US";
string audioType = "WAV_FILE";
string voice = "cmu-slt-hsmm";
string effects;
// effects += "Volume(amount:5.0;)+";
// effects += "TractScaler(amount:1.5;)+";
// effects += "F0Scale(f0Scale:2.0;)+";
// effects += "F0Add(f0Add:50.0;)+";
// effects += "Rate(durScale:1.5;)+";
// effects += "Robot(amount:100.0;)+";
// effects += "Whisper(amount:100.0;)+";
// effects += "Stadium(amount:100.0)+";
// effects += "Chorus(delay1:466;amp1:0.54;delay2:600;amp2:-0.10;delay3:250;amp3:0.30)+";
// effects += "FIRFilter(type:3;fc1:500.0;fc2:2000.0)+";
// effects += "JetPilot";
string result;
MaryClient maryClient;
maryClient.maryQuery( server_port, server_host, result, inputText, maryInFormat, maryOutFormat, locale, audioType, voice, effects);
if (maryOutFormat == "AUDIO") {
// write result into a file
const char *filename = "output.wav";
ofstream file( filename );
file << result;
// play output
//system("play output.wav");
} else {
cout << "RESULT: " << endl << result << endl;
}
return 0;
}

View file

@ -1,4 +0,0 @@
Start MARY as a socket server:
maryserver -Dserver=socket
(or change entry 'server' in conf/marybase.config)

View file

@ -1,185 +0,0 @@
#!/usr/bin/env python
import httplib, urllib
# A basic mary client in Python,
# kindly donated to the MARY TTS project
# by Hugh Sasse. Thanks Hugh!
# A very basic Python class for accessing
# the MARY TTS system using the modern
# HTTP server.
# Warning, this is probably ghastly Python,
# most of my time of late has been with
# other languages, so I'm not up to date
# with all the stylistic conventions of
# modern Python.
# This does seem to work OK though.
class maryclient:
"""A basic handler for MARY-TTS HTTP clients
At present, there is no checking for
allowed voices, locales, and so on.
Most of the useful parameters can be
accessed by get_ and set_ methods.
Relying on winsound, this is Windows
specific.
"""
def __init__(self):
"""Set up useful defaults (for
people in England, anyway)"""
self.host = "127.0.0.1"
self.port = 59125
self.input_type = "TEXT"
self.output_type = "AUDIO"
self.audio = "WAVE_FILE"
self.locale = "en_GB"
self.voice = "dfki-prudence-hsmm"
def set_host(self, a_host):
"""Set the host for the TTS server."""
self.host = a_host
def get_host(self):
"""Get the host for the TTS server."""
self.host
def set_port(self, a_port):
"""Set the port for the TTS server."""
self.port = a_port
def get_port(self):
"""Get the port for the TTS server."""
self.port
def set_input_type(self, type):
"""Set the type of input being
supplied to the TTS server
(such as 'TEXT')."""
self.input_type = type
def get_input_type(self):
"""Get the type of input being
supplied to the TTS server
(such as 'TEXT')."""
self.input_type
def set_output_type(self, type):
"""Set the type of input being
supplied to the TTS server
(such as 'AUDIO')."""
self.output_type = type
def get_output_type(self):
"""Get the type of input being
supplied to the TTS server
(such as "AUDIO")."""
self.output_type
def set_locale(self, a_locale):
"""Set the locale
(such as "en_GB")."""
self.locale = a_locale
def get_locale(self):
"""Get the locale
(such as "en_GB")."""
self.locale
def set_audio(self, audio_type):
"""Set the audio type for playback
(such as "WAVE_FILE")."""
self.audio = audio_type
def get_audio(self):
"""Get the audio type for playback
(such as "WAVE_FILE")."""
self.audio
def set_voice(self, a_voice):
"""Set the voice to speak with
(such as "dfki-prudence-hsmm")."""
self.voice = a_voice
def get_voice(self):
"""Get the voice to speak with
(such as "dfki-prudence-hsmm")."""
self.voice
def generate(self, message):
"""Given a message in message,
return a response in the appropriate
format."""
raw_params = {"INPUT_TEXT": message,
"INPUT_TYPE": self.input_type,
"OUTPUT_TYPE": self.output_type,
"LOCALE": self.locale,
"AUDIO": self.audio,
"VOICE": self.voice,
}
params = urllib.urlencode(raw_params)
headers = {}
# Open connection to self.host, self.port.
conn = httplib.HTTPConnection(self.host, self.port)
# conn.set_debuglevel(5)
conn.request("POST", "/process", params, headers)
response = conn.getresponse()
if response.status != 200:
print response.getheaders()
raise RuntimeError("{0}: {1}".format(response.status,
response.reason))
return response.read()
# If this is invoked as a program, just give
# a greeting to show it is working.
# The platform specific code is moved to this
# part so that this file may be imported without
# bringing platform specific code in.
if __name__ == "__main__":
# For handling command line arguments:
import sys
import platform
# check we are on Windows:
system = platform.system().lower()
if (system == "windows"):
import winsound
class Player:
def __init__(self):
pass
def play(self, a_sound):
winsound.PlaySound(a_sound, winsound.SND_MEMORY)
#if ("cygwin" in system):
else:
# Not sure how to do audio on cygwin,
# portably for python. So have a sound
# player class that doesn't play sounds.
# A null object, if you like.
class Player:
def __init__(self):
pass
def play(self, a_sound):
print("Here I would play a sound if I knew how")
pass
# Probably want to parse arguments to
# set the voice, etc., here
client = maryclient()
client.set_audio("WAVE_FILE") # for example
player = Player()
the_sound = client.generate("hello from Mary Text to Speech, with Python.")
if client.output_type == "AUDIO":
player.play(the_sound)
# vi:set sw=4 et:

View file

@ -1,177 +0,0 @@
#!/usr/bin/perl -T
# -*- Mode: Perl -*-
# MARY Text-to-Speech System
# CGI Script implementing a simple mary client,
# can be used for web pages.
##########################################################################
# Copyright (C) 2000-2006 DFKI GmbH.
# All rights reserved. Use is subject to license terms.
#
# Permission is hereby granted, free of charge, to use and distribute
# this software and its documentation without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of this work, and to
# permit persons to whom this work is furnished to do so, subject to
# the following conditions:
#
# 1. The code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
# 2. Any modifications must be clearly marked as such.
# 3. Original authors' names are not deleted.
# 4. The authors' names are not used to endorse or promote products
# derived from this software without specific prior written
# permission.
#
# DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE
# CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
# THIS SOFTWARE.
##########################################################################
# Author: Marc Schroeder
use strict;
use IO::Socket;
use CGI;
# variables getting their values from form:
my ($inputtext, $in, $out, $audiotype, $voice);
# little helpers:
my ($var, $tmp);
# contacting the mary server:
my ($host, $port, $maryInfoSocket, $maryDataSocket, $id);
# helping with audio output:
my ($save_to_disk, $audiosubtype, $filename);
my $cgi = new CGI;
my @param = $cgi->param();
$inputtext = $cgi->param('inputtext');
$in = $cgi->param('in');
$out = $cgi->param('out');
$audiotype = $cgi->param('audiotype');
$save_to_disk = $cgi->param('save_to_disk');
$voice = $cgi->param('voice');
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$year += 1900;
printf STDERR "[%04i-%02i-%02i %02i:%02i:%02i] ", $year, $mon, $mday, $hour, $min, $sec;
print STDERR "Request from ",$cgi->remote_user(),"@",$cgi->remote_host(),": \n";
print STDERR " in=",$in;
print STDERR " out=",$out;
print STDERR " audiotype=",$audiotype;
print STDERR " voice=",$voice;
print STDERR " save_to_disk=",$save_to_disk,"\n";
print STDERR " inputtext: ";
print STDERR $inputtext,"\n";
# Limit inputtext length to 5000 bytes:
if (length $inputtext > 5000) {
$inputtext = substr $inputtext, 0, 5000;
}
# set audio subtype
if ($out eq "AUDIO") {
if ($audiotype eq "AU") {
$audiosubtype = "basic";
$filename = "mary.au";
} elsif ($audiotype eq "AIFF") {
$audiosubtype = "x-aiff";
$filename = "mary.aiff";
} elsif ($audiotype eq "WAVE") {
$audiosubtype = "x-wav";
$filename = "mary.wav";
} elsif ($audiotype eq "MP3") {
$audiosubtype = "mp3";
$filename = "mary.mp3";
} else {
$audiosubtype = "x-wav";
$filename = "mary.wav";
}
}
# announce data type on stdout
if ($save_to_disk) {
print "Content-Type: application/octet-stream";
} else {
print "Content-Type: audio/$audiosubtype";
}
print "\nContent-Disposition: filename=\"$filename\"\n\n";
# contact mary server
$host = "cling.dfki.uni-sb.de";
$port = 59125;
# create a tcp connection to the specified host and port
$maryInfoSocket = IO::Socket::INET->new(Proto => "tcp",
PeerAddr => $host,
PeerPort => $port)
or die "can't connect to port $port on $host: $!";
# avoid buffering when writing to server:
$maryInfoSocket->autoflush(1); # so output gets there right away
########## Write input to server: ##########
# formulate the request:
print $maryInfoSocket "MARY IN=$in OUT=$out AUDIO=$audiotype";
if ($voice && $voice ne 'v') { print $maryInfoSocket " VOICE=$voice"; }
print $maryInfoSocket " LOG=\"REMOTE_HOST=$ENV{'REMOTE_HOST'}",
", REMOTE_ADDR=$ENV{'REMOTE_ADDR'}\"";
print $maryInfoSocket "\015\012";
# receive a request ID:
$id = <$maryInfoSocket>;
# open second socket for the data:
$maryDataSocket = IO::Socket::INET->new(Proto => "tcp",
PeerAddr => $host,
PeerPort => $port)
or die "can't connect to port $port on $host: $!";
# identify with request number:
print $maryDataSocket $id; # $id contains a newline character
# copy $inputtext to mary data socket
print $maryDataSocket $inputtext;
# mark end-of-request:
print $maryDataSocket "\015\012"; # that is a \n, actually
$maryDataSocket->shutdown(1); # we have stopped writing data
########## Read output from server: ##########
# copy the data socket to standard output
if ($out ne "AUDIO") { # text output
my $line;
while (defined ($line = <$maryDataSocket>)) {
print STDOUT $line;
}
} else { # audio data output
my $nr; # number of bytes read
my $buf; # buffer to read into
my $outnr; # number of bytes written
while($nr = read($maryDataSocket, $buf, 8192)) {
# (read returns no. of bytes read, 0 at eof)
print STDOUT $buf
or die "Write error on stdout";
} # while read something from socket
} # audio output
### Read complaints from server:
my $line;
while (defined ($line = <$maryInfoSocket>)) {
print STDERR $line;
}

View file

@ -1,136 +0,0 @@
#!/usr/bin/env perl
#
# MARY Text-to-Speech System
# Minimal Socket client (for demonstration)
##########################################################################
# Copyright (C) 2000-2006 DFKI GmbH.
# All rights reserved. Use is subject to license terms.
#
# Permission is hereby granted, free of charge, to use and distribute
# this software and its documentation without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of this work, and to
# permit persons to whom this work is furnished to do so, subject to
# the following conditions:
#
# 1. The code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
# 2. Any modifications must be clearly marked as such.
# 3. Original authors' names are not deleted.
# 4. The authors' names are not used to endorse or promote products
# derived from this software without specific prior written
# permission.
#
# DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE
# CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
# THIS SOFTWARE.
##########################################################################
# Author: Marc Schroeder
# This is a minimal version of a socket client for the mary TtS system.
# It is intended to be used as a model for writing socket clients for
# particular applications. All input verification, command line options,
# and other luxury have been omitted.
#
# Usage:
# maryclient.pl infile.txt > outfile.wav
#
# Input/output formats and other options must be set in the perl code directly.
# See also Protocol.html for a description of the Protocol.
#
use strict;
use IO::Socket;
############################
# Package-global variables #
############################
# global settings:
my $maryInfoSocket; # handle to socket server
my $maryDataSocket; # handle to socket server
my $host; # string containing host address
my $port; # socket port on which we listen
my ($in, $out, $audiotype); # requested input / output format
my $voice; # default voice
my $id; # request ID
######################################################################
################################ main ################################
######################################################################
STDOUT->autoflush(1);
$host = "cling.dfki.uni-sb.de";
$port = 59125;
$in = "TEXT_DE";
$out = "AUDIO";
$audiotype = "MP3";
#$audiotype = "WAVE";
#$voice = "male";
$voice = "de3";
# create a tcp connection to the specified host and port
$maryInfoSocket = IO::Socket::INET->new(Proto => "tcp",
PeerAddr => $host,
PeerPort => $port)
or die "can't connect to port $port on $host: $!";
# avoid buffering when writing to server:
$maryInfoSocket->autoflush(1); # so output gets there right away
########## Write input to server: ##########
# formulate the request:
print $maryInfoSocket "MARY IN=$in OUT=$out AUDIO=$audiotype";
if ($voice) { print $maryInfoSocket " VOICE=$voice"; }
print $maryInfoSocket "\015\012";
# receive a request ID:
$id = <$maryInfoSocket>;
chomp $id; chomp $id;
# open second socket for the data:
$maryDataSocket = IO::Socket::INET->new(Proto => "tcp",
PeerAddr => $host,
PeerPort => $port)
or die "can't connect to port $port on $host: $!";
# identify with request number:
print $maryDataSocket $id, "\015\012";
# copy standard input and/or files given on the command line to the socket
while (defined (my $line = <>)) {
print $maryDataSocket $line;
}
# mark end-of-request:
print $maryDataSocket "\015\012"; # that is a \n, actually
shutdown($maryDataSocket, 1); # we have stopped writing data
########## Read output from server: ##########
# copy the data socket to standard output
if ($out ne "AUDIO") { # text output
my $line;
while (defined ($line = <$maryDataSocket>)) {
print STDOUT $line;
}
} else { # audio data output
my $nr; # number of bytes read
my $buf; # buffer to read into
my $outnr; # number of bytes written
while($nr = read($maryDataSocket, $buf, 100000)) {
# (read returns no. of bytes read, 0 at eof)
print STDOUT $buf
or die "Write error on stdout";
} # while read something from socket
} # audio output
### Read complaints from server:
my $line;
while (defined ($line = <$maryInfoSocket>)) {
print STDERR $line;
}

View file

@ -1,261 +0,0 @@
#!/usr/bin/env ruby
#
# A basic mary client in Ruby,
# kindly donated to the MARY TTS project
# by Hugh Sasse. Thanks Hugh!
# Ruby client for the MARY TTS HTTP server.
# This is for Windows only, and relies on
# the Win32-Sound gem to access the audio.
#
#
require 'rubygems'
require 'net/http'
require 'uri'
# A fairly minimal client class for the
# MARY TTS system. This uses the modern
# HTTP interface to access the server.
# At present, this doesn't wrap the methods
# which provide documentation or lists of
# voices or features.
class MaryClient
attr_accessor :host, :port
attr_accessor :input_type, :output_type
attr_accessor :locale, :audio, :voice
# Set up the defaults for the MARY TTS
# server, which is assumed to be running
# on the local host, with British voices
# installed. These may be modified with
# the appropriate methods.
# host = 127.0.0.1)
# port = 59125
# input_type = "TEXT"
# output_type = "AUDIO"
# audio = "WAVE_FILE"
# locale = "en_GB"
# voice = "dfki-prudence-hsmm"
def initialize
@host = "127.0.0.1" # The local machine
@port = 59125
@input_type = "TEXT"
@output_type = "AUDIO"
@locale = "en_GB"
@audio = "WAVE_FILE"
@voice = "dfki-prudence-hsmm"
end
# Process a text message, which with a
# new client, will return the audio.
# This is so that platform dependent parts
# are kept separate.
def generate(message)
raw_params = {"INPUT_TEXT" => message,
"INPUT_TYPE" => @input_type,
"OUTPUT_TYPE" => @output_type,
"LOCALE" => @locale,
"AUDIO" => @audio,
"VOICE" => @voice,
}
res = Net::HTTP.post_form(URI.parse("http://#{@host}:#{@port}/process"), raw_params)
res.value # Throw an exception on failure
#puts res.body
return res.body
end
end
# If this invoked as a program with no
# argumens, just give a greeting to show
# that it is working. If arguments are
# supplied, process options to work out
# what to do with the arguments.
if __FILE__ == $0
# These files are only loaded when this is
# invoked as a program.
require 'rbconfig'
require 'getoptlong'
# PLATFORM SPECIFIC CODE.
# Needs more work [!]
case Config::CONFIG['host_os']
when /darwin/i
raise NotImplementedError.new("Don't know how to play audio on a Mac")
when /linux/i
raise NotImplementedError.new("Far too many ways to play audio on Linux, you'll need to choose something")
when /sunos|solaris/i
raise NotImplementedError.new("Have not played audio on Suns for too long to implement this.")
when /java/i
raise NotImplementedError.new("Don't know how to play audio from Java ")
when /win32|cygwin|mingw32/i
# The various things that can use the Win32
# sound gem
require 'win32/sound'
# Create a player class that will play the
# sound that the Mary TTS system returns
class Player
# Play the audio passed in.
# Possibly this should receive the audio
# type so we can check that we can play it,
# but at the moment that is the
# responsibility of the user.
def self.play(sound)
Win32::Sound.play(sound, Win32::Sound::MEMORY)
end
end
else
raise NotImplementedError.new("Haven't thought how to support this OS yet")
end
client = nil
split = ""
if ARGV.size.zero?
client = MaryClient.new()
sound = client.generate("Hello from Mary Text to Speech with Ruby.")
Player.play(sound)
else
args_mode = :words
stdout_mode = :absorb
opts = GetoptLong::new(
["--audio", "-a", GetoptLong::REQUIRED_ARGUMENT],
["--echo", "-e", GetoptLong::NO_ARGUMENT],
["--help", "-h", GetoptLong::NO_ARGUMENT],
["--host", "-H", GetoptLong::REQUIRED_ARGUMENT],
["--input-type", "-i", GetoptLong::REQUIRED_ARGUMENT],
["--locale", "-l", GetoptLong::REQUIRED_ARGUMENT],
["--read", "-r", GetoptLong::NO_ARGUMENT],
["--split", "-s", GetoptLong::REQUIRED_ARGUMENT],
["--output-type", "-o", GetoptLong::REQUIRED_ARGUMENT],
["--port", "-P", GetoptLong::REQUIRED_ARGUMENT],
["--tee", "-t", GetoptLong::NO_ARGUMENT],
["--voice", "-v", GetoptLong::REQUIRED_ARGUMENT]
)
opts.each do |opt, arg|
unless ["--help", "-h"].include?(opt)
# skip if we are only getting help
client ||= MaryClient.new()
end
case opt
when "--help", "-h"
puts <<-EOHELP
Usage: #{$0} [options] [arguments]
--audio -a
Audio format. Defualt: WAVE_FILE
--echo -e
Act as an echo command and send output
arguments to the synthesizer only (not
to standard output.
Turns off --read|-r
--help -h
Print this help, then exit.
--host -H
The host which is the server.
Default: 127.0.0.1
--input-type -i
The type of the input supplied to the
TTS system. Default: TEXT
--locale -l
The locale of the input. Default: en_GB
--output-type -o
The output type from the TTS system.
Default: AUDIO
--port -P
The port for the TTS server
Default: 59125
--read -r
Read the files passed as arguments.
Turns off --echo|-e
--split -s (lines|paragraphs)
When reading files, split the input
into lines or paragraphs. Paragraphs
mean reading up to the next double
newline. Note, the argument is literally
"lines" or "paragraphs" (or some
abbreviation of those) without the
quotes.
Default is paragraphs.
--tee -t
Act as tee: send the output to the TTS
system, and to standard output.
--voice -v
The voice to use.
Default: dfki-prudence-hsmm
EOHELP
exit(0)
when "--audio", "-a"
client.audio = arg
when "--echo", "-e"
args_mode = :words
when "--host", "-H"
client.host = arg
when "--input-type", "-i"
client.input_type = arg
when "--locale", "-l"
client.locale = arg
when "--output-type", "-o"
client.output_type = arg
when "--port", "-P"
client.port = arg.to_i
when "--read", "-r"
args_mode = :files
when "--split", "-s"
case arg
when /^p/i
split = ""
when /^l/i
split = $/
end
when "--tee", "-t"
stdout_mode = :emit
when "--voice", "-v"
client.voice = arg
end
end
client ||= MaryClient.new()
case args_mode
when :words
input_text = ARGV.join(" ")
unless input_text =~ /\A\s*\Z/m
sound = client.generate(input_text)
if client.output_type == "AUDIO"
Player.play(sound)
end
end
if stdout_mode == :emit
puts input_text
end
when :files
# Slurp in paragraphs so sentences
# don't get broken in stupid places.
$/ = split # paragraph mode
ARGF.each do |paragraph|
begin
unless paragraph =~ /\A\s*\Z/m
sound = client.generate(paragraph)
if client.output_type == "AUDIO"
# and client.audio == "WAVE_FILE"
Player.play(sound)
end
end
rescue Exception => e
puts "got error #{e} while trying to say #{paragraph.inspect}"
raise
end
if stdout_mode == :emit
puts paragraph
end # end if
end # end ARGF.each
end # end case
end # if ARGV.size.zero?
end

View file

@ -1,705 +0,0 @@
# Tcl/Tk MARY TTS client.
# This has been tested on Windows, and because
# of the use of sound there will be portability
# issues. However, there should be enough here
# for a reasonable start at a client, for any
# platform that supports Tcl/Tk. The platform
# specific code has, as far as possible, been
# isolated in the part of the code that detects
# whether this is being run as a program.
# Notes:
# More work will need to be done with this,
# in order to make the code clean. It should
# probably be wrapped in a package, to solve
# any namespace issues. There are a lot of
# global variables. It seems that some of
# these are necessary for the menus to work.
# Handling of temporary files could be improved.
# TODO:
# Create modifier sliders, for the effects.
# Extend the query proc to make use of them.
# Turn the Help menu into something more useful.
# Debug the actions for the Edit menu.
# Provide a means of getting example inputs
# from the server.
# Provide a means of re-loading all the
# dynamically collected information when the
# server is changed from the menu. This means
# that we need to delete the existing menu
# entries in order to add them correctly.
# How do we ensure temporary files are removed
# in the event of a problem? if {catch {}} ...?
# Maybe leaving them around is diagnostic info?
# Make that an option?
# Add error handling code for network and disk
# failures likely to beset such clients.
# Add sensible defaults for things the user must
# always set at startup, but these will be
# platform spacific. Always default to Audio
# output for example, or is it possible that
# people have no voices installed?
# This is a GUI, so:
package require Tk
# We are communicating with the Mary server
# with HTTP.
package require http
# Use the local machine in preference to the
# one in Germany.
set mary_tts_default_host "127.0.0.1"
set mary_tts_default_port 59125
# Actual host and port, and global old
# copies to allow revert on cancel in the
# dialogues. Apparently upvar #0 is the
# norm for that sort of thing [Tcl Wiki]
set mary_tts_host $mary_tts_default_host
set old_mary_tts_host $mary_tts_host
set mary_tts_port $mary_tts_default_port
set old_mary_tts_port $mary_tts_port
# Informational URLs
set informational_urls [ list \
version datatypes voices \
audioformats audioeffects ]
#######
# Obtain a static page from the server, i.e.
# no parameters are needed to get it.
proc get_page { relative_url } {
global mary_tts_host mary_tts_port
set url http://$mary_tts_host:$mary_tts_port/$relative_url
set result [::http::geturl $url]
return [::http::data $result]
}
proc list_of_lines {str} {
return [ split $str "\n" ]
}
# We will need to collect this information
# when we have the server and port chosen.
proc get_audioeffects {} {
return [list_of_lines [get_page audioeffects] ]
}
proc get_audioformats {} {
return [list_of_lines [get_page audioformats] ]
}
proc get_datatypes {} {
return [ list_of_lines [get_page datatypes] ]
}
proc get_voices {} {
return [list_of_lines [get_page voices] ]
}
# Handling post queries.
# Submit the query to the server, using the
# http POST method.
proc make_query {url encoded_params} {
set http [::http::geturl $url -query $encoded_params]
set result [::http::data $http]
return $result
}
# Get the text from the input text area
proc get_input_text {} {
return [.io.inp.input_area get 1.0 end]
}
# Get the text from the output text area
proc get_output_text {} {
return [.io.out.output_area get 1.0 end]
}
# Collect the audio data from the server.
proc collect_audio_data {text_to_process} {
global mary_tts_host mary_tts_port
global inputtype outputtype locales
global audioformat voice
set url "http://$mary_tts_host:$mary_tts_port/process"
# ::http::formatQuery converts a list of
# key value pairs into the correct format
# for http POST.
set params [::http::formatQuery INPUT_TEXT $text_to_process INPUT_TYPE $inputtype OUTPUT_TYPE $outputtype LOCALE $locales($voice) AUDIO $audioformat VOICE $voice ]
set result [make_query $url $params]
return $result
}
# Pushes the query to the server and gets
# the results back, displaying or playing
# them.
proc generate_output {text_to_process} {
global outputtype
set result [collect_audio_data $text_to_process]
if {$outputtype eq "AUDIO"} {
# call the platform dependent implementation.
play $result
} else {
clear_output
add_message $result
}
# Return the result so we can save it if
# the user requires it.
return $result
}
# These next procs are for handling the
# lists of data one gets back from the server
# which possibly have several words per line,
# separated by spaces.
# If the first word of each listed line is
# significant, extract the list of first words.
proc collect_first_words_of_phrase_list {a_list} {
for {set i 0} {$i < [llength $a_list]} {incr i} {
set data [lindex $a_list $i ]
set word [ lindex [split $data " "] 0 ]
lappend words $word
}
return $words
}
# If the second word of each listed line is
# significant, extract the list of second words.
proc collect_second_words_of_phrase_list {a_list} {
for {set i 0} {$i < [llength $a_list]} {incr i} {
set data [lindex $a_list $i ]
set word [ lindex [split $data " "] 1 ]
lappend words $word
}
return $words
}
# The list of datatypes must be separated into
# input data types and output data types so that
# interactions with the server make sense.
# This handles the inputs.
proc collect_first_words_of_input_types {a_list} {
for {set i 0} {$i < [llength $a_list]} {incr i} {
set data [lindex $a_list $i ]
if {[ string match -nocase "*input*" $data ]} {
set word [ lindex [split $data " "] 0 ]
lappend words $word
}
}
return $words
}
# The list of datatypes must be separated into
# input data types and output data types so that
# interactions with the server make sense.
# This handles the outputs.
proc collect_first_words_of_output_types {a_list} {
for {set i 0} {$i < [llength $a_list]} {incr i} {
set data [lindex $a_list $i ]
if {[string match -nocase "*output*" $data]} {
set word [ lindex [split $data " "] 0 ]
lappend words $word
}
}
return $words
}
# setup all the variables to hold voices,
# audio options, etc., based on what the
# server can do.
proc setup_globals {} {
global audioeffects audioformats voices
global inputtypes outputtypes audioformat voice
global inputtype outputtype locales
set audioeffects [get_audioeffects]
set audioformats [get_audioformats]
set audioformat [lindex $audioformats 0 ]
set datatypes_data [get_datatypes]
set inputtypes [collect_first_words_of_input_types $datatypes_data]
set inputtype [lindex $inputtypes 0]
set outputtypes [collect_first_words_of_output_types $datatypes_data]
set outputtype [lindex $outputtypes 0]
set voices_data [get_voices]
set voices [collect_first_words_of_phrase_list $voices_data]
set locales_list [collect_second_words_of_phrase_list $voices_data ]
for {set i 0} {$i < [llength $voices]} {incr i} {
set locales([lindex $voices $i]) [lindex $locales_list $i]
}
set voice [lindex $voices 0]
}
# A general procedure for filling in the
# elements of a listbox from a list.
# At present this is unused, but it could
# be useful later. [It took a while to
# figure out so I'm not ready to kill it
# with YAGNI.]
proc add_listbox_items {a_var a_widget} {
upvar $a_var var
foreach item $var {
$a_widget insert end $item
}
}
# Create the menubuttons along the top.
# Usual File, Edit and Help menus plus
# those to set attributes.
proc create_menubuttons {} {
set buttons [ list file File edit Edit \
server "Server" \
inputtype "Input type" outputtype "Output type" \
voice Voice \
audioformat "Audio format" \
textstyle "Text style" help Help ]
set count 1
foreach { menu_tag string_tag} $buttons {
menubutton .menus.$menu_tag -text $string_tag \
-menu .menus.${menu_tag}.menu -underline 0 -font ClientFont
menu .menus.${menu_tag}.menu -tearoff true
grid .menus.$menu_tag -in .menus -row 1 -column $count -sticky w
incr count
}
}
# Get the contents of a text file for reading
# or loading into a text widget, etc.
proc text_file_contents {what_for} {
set a_file [tk_getOpenFile -title $what_for ]
set the_text ""
if {$a_file != ""} {
set a_stream [open $a_file r ]
set the_text [read $a_stream]
close $a_stream
}
return $the_text
}
# Save the_text to a text file specified
# by the user, for the given reason (what_for).
# At the moment there is no error handling
# for this (disk full, write protected, etc).
proc save_text_file {the_text what_for} {
set a_file [tk_getSaveFile -title $what_for -parent .]
if {$a_file != ""} {
set a_stream [open $a_file w ]
puts $a_stream $the_text
close $a_stream
}
}
# Save the_data to a binary file specified
# by the user, for the given reason (what_for),
# a text string.
# At the moment there is no error handling
# for this (disk full, write protected, etc).
proc save_binary_file {the_data what_for} {
set a_file [tk_getSaveFile -title $what_for -parent .]
if {$a_file != ""} {
set a_stream [open $a_file w ]
fconfigure $a_stream -translation binary
puts -nonewline $a_stream $the_data
close $a_stream
}
}
# Create the menu for File operations
proc create_menu_file {} {
set fmenu .menus.file.menu
$fmenu add command -label "New" \
-font ClientFont -command {
.io.inp.input_area delete 1.0 end
}
# Replace the contents of the input text
# widget by the data from the open file.
# <FIXME>YAGNI, but is there any reason
# to allow inserting a file, rather than
# replacing the text with file contents?
# </FIXME>
$fmenu add command -label "Open" \
-font ClientFont -command {
set the_text [text_file_contents "File to load"]
if {$the_text != ""} {
.io.inp.input_area delete 1.0 end
.io.inp.input_area insert end $the_text
}
}
$fmenu add command -label "Read" \
-font ClientFont -command {
generate_output [text_file_contents "File to read"]
}
# How to make these disabled for now?
$fmenu add command -label "Save Input" \
-font ClientFont -command {
set the_text [get_input_text]
save_text_file $the_text "Save Input"
}
$fmenu add command -label "Save Output" \
-font ClientFont -command {
set the_text [get_output_text]
save_text_file $the_text "Save Output"
}
}
# Create the menu for edit operations
proc create_menu_edit {} {
set emenu .menus.edit.menu
$emenu add command -label "Select All from Input Area" \
-font ClientFont -command {
# This code says copy the selection as well.
# May be wrong for some platforms, but is
# it more useful?
.io.inp.input_area tag add sel 1.0 end
event generate .io.inp.input_area <<copy>>
}
$emenu add command -label "Select All from Output Area" \
-font ClientFont -command {
# This code says copy the selection as well.
# May be wrong for some platforms, but is
# it more useful?
.io.out.output_area tag add sel 1.0 end
event generate .io.out.output_area <<Copy>>
}
$emenu add command -label "Copy from Input Area" \
-font ClientFont -command {
# this appears not to work. FIXME
event generate .io.inp.input_area <<Copy>>
}
$emenu add command -label "Copy from Output Area" \
-font ClientFont -command {
# this appears not to work. FIXME
event generate .io.out.output_area <<copy>>
}
$emenu add command -label "Paste into Input Area" \
-font ClientFont -command {
# this appears not to work. FIXME
event generate .io.inp.input_area <<Paste>>
}
$emenu add command \
-font ClientFont -label "Insert example text into Input Area"\
-command {
}
# Add specific editing commands here later.
# For example, we would like to be able to
# add whole tags to the XML based formats,
# wrap matching tags around selected text.
# Also we need to find out what happens with
# copy cut and paste, given that X Windows
# is different from MS Windows.
# Allow example text to be inserted.
# However, my thinking is that this should not
# overwrite as it is in the Java application,
# because this rubs out edits when switching
# voices, and this can be annoying when
# exploring the system.
}
# Set the server properties, mostly just
# host and port. Maybe later protocol will
# be possible for https connections?
proc create_menu_server {} {
set smenu .menus.server.menu
$smenu add command -label "host" -font ClientFont -command {
create_entry_dialog "MARY TTS server name" "hostname/IP Address" mary_tts_host
}
$smenu add command -label "port" -font ClientFont -command {
create_entry_dialog "MARY TTS server port" "pott number" mary_tts_port
}
}
# setup the fonts for the various areas on the dipslay.
proc setup_font {family size} {
foreach win {.io .controls .entry.dialogue } {
font configure ClientFont -family $family -size $size
}
}
# Create the menu for changing the text size.
proc create_menu_textstyle {} {
set tmenu .menus.textstyle.menu
$tmenu add cascade -label "Courier" -underline 0 -menu \
$tmenu.courier -font ClientFont
$tmenu add cascade -label "Times" -underline 0 -menu \
$tmenu.times -font ClientFont
$tmenu add cascade -label "Helvetica" -underline 0 -menu \
$tmenu.helvetica -font ClientFont
foreach {name family} [list $tmenu.courier Courier \
$tmenu.times Times $tmenu.helvetica Helvetica ] {
set m1 [menu $name]
foreach pts {6 7 8 9 10 12 14 16 18 20 24 28 32 36} {
$m1 add command -label "$pts" -font ClientFont\
-command [list setup_font $family $pts ]
}
}
}
# Create the menu for Help
proc create_menu_help {} {
# This is all pretty much "wet paint"
# Is there enough to merit separate menus?
set hmenu .menus.help.menu
$hmenu add command -label "Introduction" -font ClientFont\
-command {
tk_messageBox -message "This is a basic Tcl/Tk
client for the MARY TTS system. Most of the options
are reached through the menus on the top. Some
facilities are presently lacking.
Most of the interface should be self-explanatory.
In the File menu, Read will read a given file aloud
(or at least take it as input for the present
form of processing), whereas Open will load it
into the input area. Save input and Save output
refer to the contents of the text windows. The
save button next to the play button will save
the output to a file; this is assumed to be a
text file, unless the output is audio, in which
case it is a binary file.
The Edit menu has cut and paste facilities,
but these don't seem to work reliably. The
default key bindings for text areas should
be useable.
You will need to set the input and output types
and the audio format before pressing play.
Code does not yet exist to figure out sensible
defaults for your platform.
This does not have support for the effects, yet.
Contributions from developers welcome." -type ok
}
$hmenu add command -label "About" -command {} -font ClientFont
}
# We need to create menus for the available
# voices and audio formats, etc.
# When we have the data for these menus from
# the server, create them by using the global
# lists of information.
proc create_radio_menu_from_list {what} {
global $what
set plural "${what}s"
upvar 1 $plural var
foreach item $var {
.menus.${what}.menu add radiobutton -label $item -variable $what \
-value $item -font ClientFont
}
}
proc reset_entry_and_var {a_variable} {
upvar #0 $a_variable var
upvar #0 old_$a_variable old_var
set var $old_var
destroy .entry_dialogue
}
# Create the toplevel for choosing a host
# or port, something taken from an entry.
proc create_entry_dialog {a_message a_label a_variable} {
upvar #0 $a_variable var
upvar #0 old_$a_variable old_var
toplevel .entry_dialogue
label .entry_dialogue.the_message -text $a_message \
-font ClientFont
label .entry_dialogue.the_label -text $a_label -font ClientFont
entry .entry_dialogue.the_entry -textvariable $a_variable \
-font ClientFont
button .entry_dialogue.ok -text "OK" -font ClientFont -command {
destroy .entry_dialogue
}
button .entry_dialogue.cancel -text "Cancel" -font ClientFont \
-command "reset_entry_and_var $a_variable"
grid .entry_dialogue.the_message -row 1 -column 1
grid .entry_dialogue.the_label -row 2 -column 1
grid .entry_dialogue.the_entry -row 2 -column 2
grid .entry_dialogue.ok -row 3 -column 1
grid .entry_dialogue.cancel -row 3 -column 2
}
# Add a message to the end of the output
# text widget.
proc add_message {a_message} {
.io.out.output_area configure -state normal
.io.out.output_area insert end $a_message
.io.out.output_area configure -state disabled
}
# Clear the text in the output text widget.
proc clear_output {} {
.io.out.output_area configure -state normal
.io.out.output_area delete 1.0 end
.io.out.output_area configure -state disabled
}
# Sound generation is platform dependent.
# This provides an "abstract" function to
# be overridden by the platform dependent
# code. In this case it alerts the user
# in the output window that nothing is going
# to happen.
proc play {sound} {
add_message \
"play sound not implemented on this platform apparently"
}
# Graphical stuff.
# In order to be able to scale the font, define a font.
font create ClientFont -family [font actual TkDefaultFont -family] \
-size [font actual TkDefaultFont -size]
frame .menus
create_menubuttons
create_menu_file
create_menu_edit
create_menu_server
create_menu_textstyle
create_menu_help
# Fill in the other menus at runtime.
# .io communicates text with the user,
# through an input and output window.
frame .io
frame .io.inp
frame .io.out
# .controls will hold the play button and
# the effects controls.
frame .controls
# Draw the controls in .io
label .io.inp.input_label -text "Input Area" -font ClientFont
text .io.inp.input_area -height 10 -width 40 \
-xscrollcommand ".io.inp.input_x set" \
-yscrollcommand ".io.inp.input_y set" -font ClientFont
scrollbar .io.inp.input_x -orient horizontal \
-command ".io.inp.input_area xview"
scrollbar .io.inp.input_y -orient vertical \
-command ".io.inp.input_area yview"
label .io.out.output_label -text "Output Area" -font ClientFont
text .io.out.output_area -height 10 -width 40 -state disabled \
-xscrollcommand ".io.out.output_x set" \
-yscrollcommand ".io.out.output_y set" -font ClientFont
scrollbar .io.out.output_x -orient horizontal \
-command ".io.out.output_area xview"
scrollbar .io.out.output_y -orient vertical \
-command ".io.out.output_area yview"
grid .io.inp -in .io -row 1 -column 1
grid .io.out -in .io -row 1 -column 2
grid .io.inp.input_label -in .io.inp -row 1 -column 1
grid .io.inp.input_area -in .io.inp -row 2 -column 1
grid .io.inp.input_y -in .io.inp -row 2 -column 2 -sticky ns
grid .io.inp.input_x -in .io.inp -row 3 -column 1 -sticky ew
grid .io.out.output_label -in .io.out -row 1 -column 1
grid .io.out.output_area -in .io.out -row 2 -column 1
grid .io.out.output_y -in .io.out -row 2 -column 2 -sticky ns
grid .io.out.output_x -in .io.out -row 3 -column 1 -sticky ew
button .controls.play -text "play" -font ClientFont -command {
generate_output [get_input_text]
}
grid .controls.play -in .controls -row 1 -column 1
button .controls.save -text "save" -font ClientFont -command {
global outputtype
set input_text [get_input_text]
if { $outputtype eq "AUDIO" } {
save_binary_file [collect_audio_data $input_text ] "Save audio file"
} else {
save_text_file [collect_audio_data $input_text ] "Save output to file"
}
}
grid .controls.save -in .controls -row 1 -column 2
pack .menus .io .controls -in . -side top
# Detect whether this is the main program
# This test was taken from the Tcl Wiki, and
# seems to work OK.
if {[info exists argv0] && [file tail [info script]] eq [file tail $argv0]} {
# Try to find the temporary files directory.
catch { set tmpdir "/tmp" }
catch { set tmpdir $::env(TRASH_FOLDER) }
catch { set tmpdir $::env(TMP) }
catch { set tmpdir $::env(TEMP) }
# <FIXME>This needs better handling of
# possible alternatives</FIXME>
# This is needed for Windows sound only.
# Do the platform dependent things.
if {$tcl_platform(platform) eq "windows"} {
package require twapi
proc play {sound} {
global tmpdir
# Write sound to a temporary file
set sndfile [file join $tmpdir "MARYTTS_sound.[pid].wav" ]
set stream [open $sndfile w]
# Make sure the file is binary:
fconfigure $stream -translation binary
puts -nonewline $stream $sound
close $stream
# Play the file.
::twapi::play_sound $sndfile
# Remove the file.
file delete $sndfile
}
}
# Put other platforms here.
# Setup the globals with reference to the
# server, which is assumed to be working.
# Since we have options to alter this with
# menu items, there probably needs to be
# some way to reload all this. But we need
# to know how to delete the existing menu
# entries to do that.
setup_globals
create_radio_menu_from_list inputtype
create_radio_menu_from_list outputtype
create_radio_menu_from_list voice
create_radio_menu_from_list audioformat
# Note, at the moment voices holds locales,
# gender, and voice type
# At the moment this is just diagnostic:
## add_message [ join $voices "\n" ]
# it tells us we have a basically working
# system and the list of voices has been
# picked up and manipulated correctly.
# So it is commented out now.
}

View file

@ -1,81 +0,0 @@
<html>
<!--
Copyright 2000-2006 DFKI GmbH.
All Rights Reserved. Use is subject to license terms.
Permission is hereby granted, free of charge, to use and distribute
this software and its documentation without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of this work, and to
permit persons to whom this work is furnished to do so, subject to
the following conditions:
1. The code must retain the above copyright notice, this list of
conditions and the following disclaimer.
2. Any modifications must be clearly marked as such.
3. Original authors' names are not deleted.
4. The authors' names are not used to endorse or promote products
derived from this software without specific prior written
permission.
DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE
CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
-->
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel=stylesheet type="text/css" href="mary.css">
<script type="text/javascript">
</head>
<body>
<h1 align="center">The MARY Text-to-Speech System: Online Demo</h1>
<div align="center">
<p>Synthesise any text online (max. 5000 characters):
</p>
<form name="InputForm" method="get" action="maryclient.cgi">
<!-- Set the language of your input here: TEXT_DE=German, TEXT_EN=English... -->
<input type="hidden" name="in" value="TEXT"/>
<input type="hidden" name="out" value="AUDIO"/>
<p>Input text:</p>
<textarea name="inputtext" rows=8 cols=50 wrap=virtual>
Welcome to the world of speech synthesis!
</textarea><br>
<table align="center">
<tr>
<td>
Voice:
<select name="voice">
<option value="us1">us1 (American English, female)</option>
<option value="us2">us2 (American English, male)</option>
</select>
</td><td>
Audio format:
<select name="audiotype">
<option value="AU">Sun Audio, 16 bit</option>
<option value="AIFF">AIFF, 16 bit</option>
<option value="WAVE" selected>WAV, 16 bit</option>
<option value="MP3">mp3</option>
</select>
</td>
</tr>
<tr>
<td align="right">
<input type=submit value="Speak">
</td><td align="left">
<input type=reset value="Reset">
</td>
</tr>
</table>
<p>
<input type=radio name="save_to_disk" value="0" checked>Hear directly
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=radio name="save_to_disk" value="1">Save to disk
</form>
</div>
</body>
</html>

View file

@ -1,20 +0,0 @@
<HTML>
<HEAD>
<TITLE>EmoSpeak Applet</TITLE>
</HEAD>
<BODY>
<H3><HR WIDTH="100%">EmoSpeak Applet<HR WIDTH="100%"></H3>
To properly run the emospeak applet, the following conditions must be fulfilled:
<br>
1. The emospeakapplet.jar and maryclient.jar files must be in the same directory as this html file.
<br>
2. On the server machine from which the html file is loaded, a MARY server with German voices must be running.
<br>
<P>
<APPLET archive="emospeakapplet.jar, maryclient.jar" code="marytts.tools.emospeak.EmoSpeakApplet.class" width=550 height=600></APPLET>
</P>
</BODY>
</HTML>

View file

@ -1,94 +0,0 @@
#!/bin/sh -e
#
# marytts This init.d script is used to start a MARY TTS server.
# Run process as same user as this script:
SUDO=""
# Run process as user 'mary':
#SUDO="sudo -u mary"
JAVA=/usr/bin/java
MARY_BASE="/usr/local/MARY TTS"
MARY_PIDFILE=/var/run/marytts.pid
pidof_marytts() {
PIDOF=`which pidof` || true
if [ -x "$PIDOF" ]; then # command exists
PIDS=`pidof java` || true
else # no pidof command
PIDS=`ps axc|awk "{if (\\$5==\\"java\\") print \\$1}"`
fi
[ -e $MARY_PIDFILE ] && PIDS2=`cat $MARY_PIDFILE`
# if there is a pid we need to verify that belongs to MARY
# for real
for i in $PIDS; do
if [ "$i" = "$PIDS2" ]; then
# in this case the pid stored in the
# pidfile matches one of the pidof java
# so a simple kill will make it
echo $i
return 0
fi
done
return 1
}
marytts_start() {
CLASSPATH="$MARY_BASE/java/mary-common.jar:$MARY_BASE/java/log4j-1.2.15.jar"
$SUDO $JAVA -ea -Xms40m -Xmx1g -cp "$CLASSPATH" -Dmary.base="$MARY_BASE" marytts.server.Mary &
PID="$!"
echo $PID > $MARY_PIDFILE
}
marytts_stop() {
PID=$(pidof_marytts)
if [ "${PID}" ]; then
kill $PID
fi
}
case $1 in
start)
echo "Starting TTS server"
if marytts_start; then
exit 0
else
exit 1
fi
;;
stop)
echo "Stopping TTS server"
if marytts_stop; then
exit 0
else
exit 1
fi
;;
restart)
echo "Restarting TTS server"
marytts_stop
sleep 10
if marytts_start; then
exit 0
else
exit 1
fi
;;
status)
PID=$(pidof_marytts) || true
if [ "${PID}" ]; then
echo "MARY TTS is running (pid $PID)"
else
echo "MARY TTS is not running"
fi
exit 0
;;
*)
echo "Usage: /etc/init.d/marytts {start|stop|restart|status}"
exit 1
;;
esac

View file

@ -1,242 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?><marytts-install xmlns="http://mary.dfki.de/installer">
<voice locale="de" name="bits1-hsmm" gender="female" type="hsmm" version="5.1">
<description>A female German hidden semi-Markov model voice, built from voice recordings provided by the BITS project at the Bavarian Archive of Speech Signals</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="69aeb40bc27492d887f7d60bd8afc2aa" filename="voice-bits1-hsmm-5.1.zip" size="1360761">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="de" version="5.1"/>
</voice>
<voice locale="de" name="bits3" gender="male" type="unit selection" version="5.1">
<description>A male German unit selection voice, built from voice recordings provided by the BITS project at the Bavarian Archive of Speech Signals</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="e11f0d1057dd80d5ab307eaf3c2a2e81" filename="voice-bits3-5.1.zip" size="278237075">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="de" version="5.1"/>
</voice>
<voice locale="de" name="bits3-hsmm" gender="male" type="hsmm" version="5.1">
<description>A male German hidden semi-Markov model voice, built from voice recordings provided by the BITS project at the Bavarian Archive of Speech Signals</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="d535206d88da7f5b066a4624c321ee73" filename="voice-bits3-hsmm-5.1.zip" size="1557124">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="de" version="5.1"/>
</voice>
<voice locale="de" name="dfki-pavoque-neutral" gender="male" type="unit selection" version="5.1">
<description>A male German unit selection voice</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="b2067addeb337de0e31c1e0057ccaf93" filename="voice-dfki-pavoque-neutral-5.1.zip" size="446054145">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="de" version="5.1"/>
</voice>
<voice locale="de" name="dfki-pavoque-neutral-hsmm" gender="male" type="hsmm" version="5.1">
<description>A male German hidden semi-Markov model voice</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="c064426f03689cc0681514818495b347" filename="voice-dfki-pavoque-neutral-hsmm-5.1.zip" size="2835023">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="de" version="5.1"/>
</voice>
<voice locale="de" name="dfki-pavoque-styles" gender="male" type="unit selection" version="5.1">
<description>A male German unit selection voice with expressive styles "happy", "sad", "angry", and "poker"</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="f497dd93f78fa4a2350adea1196ccd7a" filename="voice-dfki-pavoque-styles-5.1.zip" size="692113207">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="de" version="5.1"/>
</voice>
<voice locale="en_GB" name="dfki-poppy" gender="female" type="unit selection" version="5.1">
<description>A female British English expressive unit selection voice: Cheerful Poppy</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="8a9bd4c4c888e99f8c367cdac614af9c" filename="voice-dfki-poppy-5.1.zip" size="99318417">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-GB" version="5.1"/>
</voice>
<voice locale="en_GB" name="dfki-poppy-hsmm" gender="female" type="hsmm" version="5.1">
<description>A female British English hidden semi-Markov model voice</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="04f1b36ee7113b13e01d3b131c6af75f" filename="voice-dfki-poppy-hsmm-5.1.zip" size="1015901">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-GB" version="5.1"/>
</voice>
<voice locale="en_GB" name="dfki-prudence" gender="female" type="unit selection" version="5.1">
<description>A female British English expressive unit selection voice: Pragmatic Prudence</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="7c81cbc736450219ea1597b217ea9b8f" filename="voice-dfki-prudence-5.1.zip" size="250841190">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-GB" version="5.1"/>
</voice>
<voice locale="en_GB" name="dfki-prudence-hsmm" gender="female" type="hsmm" version="5.1">
<description>A female British English hidden semi-Markov model voice</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="87a27d0ae3eed71d1d34bd3337f06501" filename="voice-dfki-prudence-hsmm-5.1.zip" size="1560473">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-GB" version="5.1"/>
</voice>
<voice locale="en_GB" name="dfki-obadiah" gender="male" type="unit selection" version="5.1">
<description>A male British English expressive unit selection voice: Gloomy Obadiah</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="dde06a7a4849b922bc45b123a5b7b504" filename="voice-dfki-obadiah-5.1.zip" size="146431509">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-GB" version="5.1"/>
</voice>
<voice locale="en_GB" name="dfki-obadiah-hsmm" gender="male" type="hsmm" version="5.1">
<description>A male British English hidden semi-Markov model voice</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="eb9872af54a1f944f191b2b7237f8d25" filename="voice-dfki-obadiah-hsmm-5.1.zip" size="1216409">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-GB" version="5.1"/>
</voice>
<voice locale="en_GB" name="dfki-spike" gender="male" type="unit selection" version="5.1">
<description>A male British English expressive unit selection voice: Aggressive Spike</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="f1161fd1da6306cc65d054cd8ff75f4e" filename="voice-dfki-spike-5.1.zip" size="136165028">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-GB" version="5.1"/>
</voice>
<voice locale="en_GB" name="dfki-spike-hsmm" gender="male" type="hsmm" version="5.1">
<description>A male British English hidden semi-Markov model voice</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="a0bfd497423bf504dc3c985476b4e669" filename="voice-dfki-spike-hsmm-5.1.zip" size="1083544">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-GB" version="5.1"/>
</voice>
<voice locale="en_US" name="cmu-slt" gender="female" type="unit selection" version="5.1">
<description>A female US English unit selection voice, built from recordings provided by Carnegie Mellon University</description>
<license href="http://mary.dfki.de/download/arctic-license.html"/>
<package md5sum="0fe2293ba1f9a0e373b54d79f0a701cc" filename="voice-cmu-slt-5.1.zip" size="105909149">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-US" version="5.1"/>
</voice>
<voice locale="en_US" name="cmu-bdl-hsmm" gender="male" type="hsmm" version="5.1">
<description>A male US English hidden semi-Markov model voice, built from recordings provided by Carnegie Mellon University</description>
<license href="http://mary.dfki.de/download/arctic-license.html"/>
<package md5sum="b192a878fb782b48c2ea37deed769c28" filename="voice-cmu-bdl-hsmm-5.1.zip" size="1017477">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-US" version="5.1"/>
</voice>
<voice locale="en_US" name="cmu-rms-hsmm" gender="male" type="hsmm" version="5.1">
<description>A male US English hidden semi-Markov model voice, built from recordings provided by Carnegie Mellon University</description>
<license href="http://mary.dfki.de/download/arctic-license.html"/>
<package md5sum="fc06214cf245ecba0c2ddf437149bd89" filename="voice-cmu-rms-hsmm-5.1.zip" size="1028060">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="en-US" version="5.1"/>
</voice>
<voice locale="fr" name="enst-camille" gender="female" type="unit selection" version="5.1">
<description>A female French unit selection voice, built at Télécom ParisTech (ENST) using data recorded by Camille Dianoux</description>
<license href="http://mary.dfki.de/download/by-sa-3.0.html"/>
<package md5sum="ba18cb28526de107a9b6b8c76d5404ff" filename="voice-enst-camille-5.1.zip" size="183466604">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="fr" version="5.1"/>
</voice>
<voice locale="fr" name="enst-camille-hsmm" gender="female" type="hsmm" version="5.1">
<description>A female French hidden semi-Markov model voice, built at Télécom ParisTech (ENST) using data recorded by Camille Dianoux</description>
<license href="http://mary.dfki.de/download/by-sa-3.0.html"/>
<package md5sum="19cb43b7fed60b732aa1c2e0e86dff03" filename="voice-enst-camille-hsmm-5.1.zip" size="1518635">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="fr" version="5.1"/>
</voice>
<voice locale="fr" name="upmc-jessica" gender="female" type="unit selection" version="5.1">
<description>A female French unit selection voice, built at ISIR (UPMC) using data recorded by Jessica Durand</description>
<license href="http://mary.dfki.de/download/by-sa-3.0.html"/>
<package md5sum="ba2daa2a0c69164932ff833817fa4b0e" filename="voice-upmc-jessica-5.1.zip" size="126834351">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="fr" version="5.1"/>
</voice>
<voice locale="fr" name="upmc-jessica-hsmm" gender="female" type="hsmm" version="5.1">
<description>A female French hidden semi-Markov model voice, built at ISIR (UPMC) using data recorded by Jessica Durand</description>
<license href="http://mary.dfki.de/download/by-sa-3.0.html"/>
<package md5sum="0e95f86b9297f2c60fa6286432d20d84" filename="voice-upmc-jessica-hsmm-5.1.zip" size="1118972">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="fr" version="5.1"/>
</voice>
<voice locale="fr" name="enst-dennys-hsmm" gender="male" type="hsmm" version="5.1">
<description>A male Québécois French hidden semi-Markov model voice, built at Télécom ParisTech (ENST)</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="ee95a5257ea4aba46591cfe7c4429d84" filename="voice-enst-dennys-hsmm-5.1.zip" size="1676376">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="fr" version="5.1"/>
</voice>
<voice locale="fr" name="upmc-pierre" gender="male" type="unit selection" version="5.1">
<description>A male French unit selection voice, built at ISIR (UPMC) using data recorded by Pierre Chauvin</description>
<license href="http://mary.dfki.de/download/by-sa-3.0.html"/>
<package md5sum="3120b9dadfb56046e86e64c124d1fa82" filename="voice-upmc-pierre-5.1.zip" size="171764059">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="fr" version="5.1"/>
</voice>
<voice locale="fr" name="upmc-pierre-hsmm" gender="male" type="hsmm" version="5.1">
<description>A male French hidden semi-Markov model voice, built at ISIR (UPMC) using data recorded by Pierre Chauvin</description>
<license href="http://mary.dfki.de/download/by-sa-3.0.html"/>
<package md5sum="064e272e3e3283134b44df8eb768dd71" filename="voice-upmc-pierre-hsmm-5.1.zip" size="1557436">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="fr" version="5.1"/>
</voice>
<voice locale="it" name="istc-lucia-hsmm" gender="female" type="hsmm" version="5.1">
<description>Italian female Hidden semi-Markov model voice kindly made available by Fabio Tesser</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="68258f5b94c596ac961e9bc45be0e521" filename="voice-istc-lucia-hsmm-5.1.zip" size="1466943">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="it" version="5.1"/>
</voice>
<voice locale="ru" name="voxforge-ru-nsh" gender="male" type="unit selection" version="5.1">
<description>Russian male voice kindly made available by Nickolay V. Shmyrev</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="b0ec23e41a2e9c2485b55e640ef32fb3" filename="voice-voxforge-ru-nsh-5.1.zip" size="175120753">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="ru" version="5.1"/>
</voice>
<voice locale="te" name="cmu-nk" gender="female" type="unit selection" version="5.1">
<description>A female Telugu unit selection voice built from voice recordings provided by IIIT Hyderabad and Carnegie Mellon University</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="2fb7b6b6c9e9eb12ea2ebcba4f356505" filename="voice-cmu-nk-5.1.zip" size="495885808">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="te" version="5.1"/>
</voice>
<voice locale="te" name="cmu-nk-hsmm" gender="female" type="hsmm" version="5.1">
<description>A female Telugu hidden semi-Markov model voice built from voice recordings provided by IIIT Hyderabad and Carnegie Mellon University</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="8dd7545a096dd87275b51028bc7623c3" filename="voice-cmu-nk-hsmm-5.1.zip" size="3397557">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="te" version="5.1"/>
</voice>
<voice locale="tr" name="dfki-ot" gender="male" type="unit selection" version="5.1">
<description>A male Turkish unit selection voice</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="c9940e0a58578fc02113b61ac86a6ebf" filename="voice-dfki-ot-5.1.zip" size="157783972">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="tr" version="5.1"/>
</voice>
<voice locale="tr" name="dfki-ot-hsmm" gender="male" type="hsmm" version="5.1">
<description>A male Turkish hidden semi-Markov model voice</description>
<license href="http://mary.dfki.de/download/by-nd-3.0.html"/>
<package md5sum="211f3d322f19295b5a7671020d76552e" filename="voice-dfki-ot-hsmm-5.1.zip" size="1366536">
<location folder="true" href="http://mary.dfki.de/download/5.1/"/>
</package>
<depends language="tr" version="5.1"/>
</voice>
</marytts-install>

View file

@ -1,675 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View file

@ -1,10 +0,0 @@
<marytts-install xmlns="http://mary.dfki.de/installer">
<language locale="en-US" name="en-US" version="5.1.2">
<description>en-US language component</description>
<license href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"/>
<package filename="marytts-lang-en-US-5.1.2.zip" md5sum="dummy" size="0">
<location href="http://mary.dfki.de/download/5.1.2/"/>
</package>
<files>lib/marytts-lang-en-US-5.1.2.jar</files>
</language>
</marytts-install>

View file

@ -1,10 +0,0 @@
<marytts-install xmlns="http://mary.dfki.de/installer">
<language locale="sv" name="sv" version="5.1.2">
<description>sv language component</description>
<license href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"/>
<package filename="marytts-lang-sv-5.1.2.zip" md5sum="dummy" size="0">
<location href="http://mary.dfki.de/download/5.1.2/"/>
</package>
<files>lib/marytts-lang-sv-5.1.2.jar</files>
</language>
</marytts-install>

View file

@ -1,166 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

Binary file not shown.

View file

@ -1,10 +0,0 @@
Sathish | ' s A - t I S
Eire | ' E - r @
speech | ' s p i tS
hasnt | ' h { z n t
havent | ' h { v n t
mustnt | ' m V s n t
isnt | ' I z n t
Greta | ' g r { - t A
minute | ' m I - n I t
does | ' d V z

View file

@ -1 +0,0 @@
kyrka | C ,Y r - k %a

7
external/tellstick-core/AUTHORS.txt vendored Normal file
View file

@ -0,0 +1,7 @@
telldus-core has been developed by :
Micke Prag <micke.prag@telldus.se>
Fredrik Jacobsson <fredrik.jacobsson@telldus.se>
Stefan Persson <stefan.persson@telldus.se>
The package is maintained by Micke Prag <micke.prag@telldus.se>

502
external/tellstick-core/LICENSE.txt vendored Normal file
View file

@ -0,0 +1,502 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

0
external/tellstick-core/Protocol.cpp vendored Executable file → Normal file
View file

0
external/tellstick-core/Protocol.h vendored Executable file → Normal file
View file

0
external/tellstick-core/ProtocolBrateck.cpp vendored Executable file → Normal file
View file

0
external/tellstick-core/ProtocolBrateck.h vendored Executable file → Normal file
View file

Some files were not shown because too many files have changed in this diff Show more