-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blink1-tiny-server improvements (#38)
* blink1-tiny-server: Use mongoose cs_time() as a cross-platform granular time(). This reverts most of the Windows compatibility added in commit 937579b, except for turning off stdout buffering. It also allows the cache_flush functions to be simplified and folded into a single function. * blink1-tiny-server: Add support for serving an index file from document_root * blink1-tiny-server: Only seed random number generator once at startup * blink1 URL API demos: Add an index file and simple demo * blink1-demo-party: Fix typo and trailing whitespace * blink1-demo-colorpicker: Add multi device/led and response status support * blink1-demos: Add mobile support
- Loading branch information
Showing
8 changed files
with
180 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | ||
<meta name="viewport" content="width=device-width,maximum-scale=1"> | ||
<title>blink(1) URL API demo simplest </title> | ||
</head> | ||
<body> | ||
<h1>blink(1) URL API demo simplest</h1> | ||
|
||
<p>This demo is for the | ||
<a href="https://blink1.thingm.com">blink(1) USB notification light</a></p> | ||
<p>For more details on URL API, see the | ||
<a href="https://github.com/todbot/blink1/blob/master/docs/app-url-api.md">documentation </a> </p> | ||
<p>For more tools, see <a href="https://github.com/todbot/blink1-tool">blink1-tool</a> | ||
</p> | ||
|
||
<p>Click the links below to turn blink(1) the specified color<p> | ||
|
||
<ul> | ||
<li><a target=api href="/blink1/on">On</a></li> | ||
<li><a target=api href="/blink1/red">Red</a></li> | ||
<li><a target=api href="/blink1/fadeToRGB?rgb=ffff00">Yellow</a></li> | ||
<li><a target=api href="/blink1/green">Green</a></li> | ||
<li><a target=api href="/blink1/fadeToRGB?rgb=00ffff">Cyan</a></li> | ||
<li><a target=api href="/blink1/blue">Blue</a></li> | ||
<li><a target=api href="/blink1/fadeToRGB?rgb=ff00ff">Purple</a></li> | ||
<li><a target=api href="/blink1/random">Random</a></li> | ||
<li><a target=api href="/blink1/off">Off</a></li> | ||
</ul> | ||
<iframe name=api width=390 height=210 src=/blink1/id></iframe> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<meta charset='utf-8'> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,maximum-scale=2"> | ||
<link rel="stylesheet" type="text/css" media="screen" href="https://pages-themes.github.io/slate/assets/css/style.css"> | ||
<title>blink1-tool</title> | ||
</head> | ||
<body> | ||
<!-- HEADER --> | ||
<div id="header_wrap" class="outer"> | ||
<header class="inner"> | ||
<a id="forkme_banner" href="https://github.com/todbot/blink1-tool">View on GitHub</a> | ||
<h1 id="project_title">blink1-tool</h1> | ||
</header> | ||
</div> | ||
|
||
<!-- MAIN CONTENT --> | ||
<div id="main_content_wrap" class="outer"> | ||
<section id="main_content" class="inner"> | ||
<h1 id="blink1-tool">blink(1) URL API examples</h1> | ||
|
||
<p>Example of using the Fetch API to talk to <a href="https://blink1.thingm.com/">blink(1) USB RGB LED notification lights</a>.</p> | ||
|
||
<p>For more details on the URL API, see <a href="https://github.com/todbot/blink1/blob/master/docs/app-url-api.md">documentation</a></p> | ||
|
||
<p>To see the source visit: <a href="https://github.com/todbot/blink1-tool/tree/master/server/html">https://github.com/todbot/blink1-tool/tree/master/server/html</a></p> | ||
|
||
<p>List of examples:</p> | ||
<ul> | ||
<li><a href="./blink1-demo-simplest/">blink1-demo-simplest</a> – bare-bones example of lighting a blink(1)</li> | ||
<li><a href="./blink1-demo-party/">blink1-demo-party</a> – slightly more complex example</li> | ||
<li><a href="./blink1-demo-colorpicker/">blink1-demo-colorpicker</a> – color picker with fast updates to blink(1)</li> | ||
</ul> | ||
|
||
<p>Pre-requisites for these examples, you will need:</p> | ||
<ul> | ||
<li>blink(1) USB LED</li> | ||
<li>A browser that supports <a href="https://caniuse.com/fetch">Fetch</a></li> | ||
<li>Run <code class="language-plaintext highlighter-rouge">blink1-tiny-server -d /path/to/blink1-tool/server/html</code></li> | ||
<li>Visit: <a href="http://localhost:8000">http://localhost:8000</a></li> | ||
</ul> | ||
|
||
</section> | ||
</div> | ||
<div id="footer_wrap" class="outer"> | ||
<footer class="inner"> | ||
<p class="copyright">blink1-tool maintained by <a href="https://github.com/todbot">todbot</a></p> | ||
</footer> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.