Skip to content

Commit

Permalink
added README and MIT license
Browse files Browse the repository at this point in the history
  • Loading branch information
dnet committed Jan 4, 2015
1 parent 188759d commit f1066b2
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2015 Andras Veres-Szentkiralyi

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.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Spark.io Alarm Clock
====================

An alarm clock with a mood light based on Spark Core and Spark Button.

Implementations
---------------

- The Spark.io firmware can be found in the `firmware` directory.
- An Android app can be found in the `android` directory.

Protocol design
---------------

UDP is used over IP, the base port is 42620 (the meaning of life + 620 for
default time), discovery happens on 42621.

### Discovery ###

The app can only be used on the local network (LAN), the app sends a packet
on the discovery port (42621) to the broadcast address, and waits for three
seconds for at most 30 replies. Replies must be sent to the same port and
must contain an ASCII encoded nick name as the sole payload. In case of
Spark.io devices, this is the unique ID.

### Setting the alarm ###

An alarm contains two properties, a 24-bit color in the RGB space, and the
time of the alarm with minute precision. It is up to the device to interpret
the time of the alarm (default on Spark Core is UTC). The packet is sent to
the base port (42620) and contains a five byte payload:

- red component (0-255)
- green component (0-255)
- blue component (0-255)
- hour of alarm (0-23)
- minute of alarm (0-59)

The reply must be a packet with the ASCII encoded `ACK` as its payload on
the same port, the Android app tries to send the set alarm packet 4 times,
with 500 ms timeout.

Dependencies
------------

The AmbilWarna color picker (see below) is included in the source tree,
you'll need to get the Spark Button driver from [its GitHub repository][1].

License
-------

The whole project is available under MIT license, see `LICENSE.txt`.

The color picker dialog is [AmbilWarna by Pascal Cans and Justin Warner][2]
available under Apache License 2.0.

[1]: https://github.com/jenesaisdiq/SparkButton
[2]: https://code.google.com/p/android-color-picker/

0 comments on commit f1066b2

Please sign in to comment.