#LyX 1.6.2 created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\textclass article
\begin_preamble

% Include the proper LaTeX packages:
%----------------------------------------------------------------------------------------------------
\usepackage{graphicx}
\usepackage{titling}
\usepackage{ifthen}
\usepackage[absolute]{textpos}
\usepackage[colorlinks=true,
                       pagecolor=black,
                       menucolor=black,
                       linkcolor=black,
                       citecolor=blue,
                       pagebordercolor=1 1 1,
                       urlcolor=red,
                       plainpages=false,
                       pdfpagelabels=true,
                       bookmarksnumbered=true]{hyperref}
\usepackage{lastpage}

\newcommand{\reportTopic}{<reportTopic>}
\newcommand{\revisionNumber}{<rev. no.>}
\newcommand{\documentNumber}{<doc. no.>}


% Setup the right-hand header to display the current doc section:
%----------------------------------------------------------------------------------------------------
\renewcommand{\sectionmark}[1]{\markright{#1}}
\renewcommand{\subsectionmark}[1]{\markright{#1}}

% Setup for roman numeral page numbers until TOC:
%----------------------------------------------------------------------------------------------------
\newboolean{romanpn}

\pagenumbering{roman}
\setboolean{romanpn}{true}
\let\myTOC\tableofcontents

\renewcommand\tableofcontents{%
\myTOC
\clearpage
\pagenumbering{arabic}
\setboolean{romanpn}{false}
}

% Modify titlepage format:
%----------------------------------------------------------------------------------------------------
\setlength{\TPHorizModule}{1in}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{3.25in}{1in}

\pretitle
 {
    \begin{flushright}\LARGE\sffamily 
    \thispagestyle{empty}
    \begin{textblock}{4}(0,0)
    \includegraphics[width=4in,keepaspectratio=true]{/Users/Shared/LyX/Templates/Images/logo.png}
    \end{textblock}
    \vspace{2in}
  }

\posttitle{\par\end{flushright}}

\preauthor{\begin{flushright} \large \sffamily \lineskip 0.5em 
\begin{tabular}[t]{c}}
\postauthor{\end{tabular} \par\end{flushright}}

\predate{\begin{flushright}\large \sffamily Document Number: \documentNumber \\ Revision Number: \revisionNumber \\}

\postdate{
\vspace{2in}
\\Pandora Products.
\\215 Uschak Road
\\Derry, PA  15627
\par\end{flushright}}

% Setup "fancy" page layout:
%----------------------------------------------------------------------------------------------------
\fancyhf{}
\setlength{\topmargin}{-1in}
\setlength{\headheight}{1in}
\setlength{\headsep}{0.5in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{6in}
\setlength{\headwidth}{\textwidth}
\setlength{\textheight}{8.375in}
\setlength{\footskip}{0.5in}

% Setup header:
%------------------------------------------------------------------------------------------
\fancyhead[L]{\sffamily \bfseries \large Pandora Products.\\\mdseries \reportTopic}
\fancyhead[R]{\sffamily \bfseries \large Program Manual\\ \mdseries \nouppercase{\rightmark}}

% Setup footer:
%------------------------------------------------------------------------------------------
\renewcommand{\footrulewidth}{0.4pt}
\fancyfoot[L]{\sffamily \bfseries \documentNumber \\ \mdseries Revision:  \revisionNumber}
\fancyfoot[C]{\sffamily \bfseries\thedate \\ \mdseries Firing Box Manual}
\fancyfoot[R]{\ifthenelse{\boolean{romanpn}}{\sffamily  \thepage}{\sffamily \bfseries Page \thepage\ of \pageref{LastPage}}}
\end_preamble
\use_default_options false
\language english
\inputencoding auto
\font_roman times
\font_sans helvet
\font_typewriter courier
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\paperfontsize 11
\spacing single
\use_hyperref false
\papersize letterpaper
\use_geometry false
\use_amsmath 1
\use_esint 0
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 4
\tocdepth 4
\paragraph_separation skip
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle fancy
\tracking_changes false
\output_changes false
\author "" 
\author "" 
\end_header

\begin_body

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
renewcommand{
\backslash
documentNumber}{PAN-200908001}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
renewcommand{
\backslash
reportTopic}{Network Firing Box}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
renewcommand{
\backslash
revisionNumber}{3.0}
\end_layout

\end_inset


\end_layout

\begin_layout Title
Pandora Products Manual
\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash

\backslash
 
\backslash
reportTopic
\end_layout

\end_inset


\end_layout

\begin_layout Author
Jim Schimpf
\end_layout

\begin_layout Date
31 December 2011
\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
thispagestyle{empty}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Newpage newpage
\end_inset


\begin_inset ERT
status collapsed

\begin_layout Plain Layout


\backslash
copyright
\end_layout

\end_inset

2009-2011 Pandora Products.
 All rights reserved.
 Pandora product and company names, as well as their respective logos are
 trademarks or registered trademarks of Pandora Products.
 All other product names mentioned herein are trademarks or registered trademark
s of their respective owners.
 
\end_layout

\begin_layout Standard
\begin_inset VSpace medskip
\end_inset

Pandora Products.
 
\end_layout

\begin_layout Standard
215 Uschak Road 
\end_layout

\begin_layout Standard
Derry, PA 15627 
\end_layout

\begin_layout Standard
\begin_inset VSpace medskip
\end_inset

Phone: 724.539.1276 
\end_layout

\begin_layout Standard
Web: http://pandora.dyn-o-saur.com:8080/cgi-bin/Firenet.cgi
\end_layout

\begin_layout Standard
Email: vze35xda@verizon.net 
\end_layout

\begin_layout Standard
\begin_inset VSpace medskip
\end_inset

Pandora Products.
 has carefully checked the information in this document and believes it
 to be accurate.
 However, Pandora Products assumes no responsibility for any inaccuracies
 that this document may contain.
 In no event will Pandora Products.
 be liable for direct, indirect, special, exemplary, incidental, or consequentia
l damages resulting from any defect or omission in this document, even if
 advised of the possibility of such damages.
 
\end_layout

\begin_layout Standard
In the interest of product development, Pandora Products reserves the right
 to make improvements to the information in this document and the products
 that it describes at any time, without notice or obligation.
 
\end_layout

\begin_layout Standard
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Section*
Document Revision History
\end_layout

\begin_layout Standard

\shape italic
Use the following table to track a history of this document's revisions.
 An entry should be made into this table for each version of the document
\shape default
.
\end_layout

\begin_layout Standard
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="32" columns="4">
<features>
<column alignment="center" valignment="top" width="0.5in">
<column alignment="center" valignment="top" width="0.5in">
<column alignment="block" valignment="top" width="3in">
<column alignment="center" valignment="top" width="1in">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Version
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Author
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Description
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Date
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Initial Version
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
6-Aug-2009
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add application layer commands
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
8-Aug-2009
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.3
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add sync clocks in nodes and sync firing
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
12-Aug-2009
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.4
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add in information about scripting support
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
4-Sep-2009
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.5
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add in information about firenet_sup.lua
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
13-Sep-2009
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.6
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Scripting operations and play_file_stop() routine0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
21-Sep-2009
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.7
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Rewrite packet protocol [d26a3ab0e9]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
11-May-2010
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.8
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add set address command [4faba11f43]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
15-May-2010
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0.9
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Update document for NEWNET [de1bb57002]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
19-May-2010
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Update document with RESTful interface in Lua
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
31-Oct-2010
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Show RESTful command structure
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
14-Nov-2010
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add Login commands
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
18-Dec-2020
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.3
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add set fire time command
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
9-Jan-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.4
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[e4208b8f56] Add ACK message
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
16-Jan-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.5
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[dcb5f4c816] Add VERSION message
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
20-Jan-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.5
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[4fd91ac4c2] Add Channel message
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
24-Jan-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.6
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Web interface
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
16-Apr-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.7
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Update REST interface information
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
22-Apr-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.8
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add Backoff & Reset commands
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1-May-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1.9
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add docs on commands returning values
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1-May-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2.0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Allow status command to clear map
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
8-May-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2.1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Apply Chip Maguire corrections
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
31-May-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2.2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add Get Data command
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
16-Jul-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2.3
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[9e81c1a523] Adaptive firing operation
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
16-Oct-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2.4
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[156fc0f116d] Node design information
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
6-Nov-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2.5
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[fd8800dae4] Add firing queue mode
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
12-Nov-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2.6
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[9eae8bcde5] Add PROGRAM to rest commands
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
20-Nov-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2.7
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[349529d41d] Add AUTO run to web interface
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
10-Dec-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2.8
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Updated information about SYNC
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
26-Dec-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2.9
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Add AUTO show images
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
26-Dec-2011
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
3.0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
js
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[7e720cf520] Fix head end of network
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
31-Dec-2011
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Newpage newpage
\end_inset


\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\end_layout

\begin_layout Standard
\begin_inset FloatList figure

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Section
System Design
\end_layout

\begin_layout Subsection
Introduction
\end_layout

\begin_layout Standard
The FIRENET system is shown in 
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:FIRENET-System"

\end_inset

.
 There are two computers in addition to the FIRENET firing boards.
 The Control Computer is directly connected to the RS-485 FIRENET network
 and interacts with the FIRENET boards.
 The second computer is running a web browser where it has the FIRENET user
 interface.
 
\end_layout

\begin_layout Standard
The control computer is running the FIRENET Web Server/REST software.
 Representational State Transfer or REST is a simple protocol on top of
 HTTP that uses GET/PUT/POST and DELETE HTTP messages to allow control of
 a system.
 
\begin_inset CommandInset citation
LatexCommand cite
key "REST"

\end_inset

.
 For FIRENET a User Interface for the system is running in a browser on
 the Interface computer.
 It uses REST style interaction to send commands which the Control Computer
 sends out on the FIRENET network to the nodes which then run the fireworks
 show.
 Each FIRENET node controls up to 6 pieces and can read out their status
 and and fire these pieces on command.
\end_layout

\begin_layout Standard
The connection between the two computers is over TCP/IP and in practice
 would use a WPA encrypted WiFi connection allowing the Interface Computer
 to be at a safe distance from the pieces and mortars firing the show.
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename /Users/jschimpf/Public/Firenet/Docs/Images/system.eps
	scale 50

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
FIRENET System
\begin_inset CommandInset label
LatexCommand label
name "fig:FIRENET-System"

\end_inset


\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Software Design
\end_layout

\begin_layout Standard
The software consists of a number of parts.
 At the lowest level Arduino
\begin_inset CommandInset citation
LatexCommand cite
key "Arduino"

\end_inset

 code is written for each FIRENET node.
 This allows it to communicate over the FIRENET RS-485 network and to have
 commands to read status and fire pieces.
 Above that we have the program running on the control computer which is
 a modified Lua interperter
\begin_inset CommandInset citation
LatexCommand cite
key "Lua"

\end_inset

with extensions to support FIRENET and HTTP webserving 
\begin_inset CommandInset citation
LatexCommand cite
key "libmicrohttpd"

\end_inset

.
 This latter acts as a Web Server and transports the REST protocol commands.
 Finally an HTML and Javascript application that runs on the browser in
 the Interface Computer, this is used supply an OS agnostic user interface
 to the system.
\end_layout

\begin_layout Subsection
User Interface
\end_layout

\begin_layout Standard
The user interface is an AJAX web application consisting of HTML pages and
 Javascript application code.
 In this case only a single HTML page is used and the Javascript is used
 to replace parts of the page with different parts of the user interface.
 In this case the HTML/Javascript combination is acting like an application
 but is running in the browser.
 the advantage of this method is that the interface is independent of the
 operating system and to a large extent the browser used.
 As long as the browser is current (i.e.
 Firefox, Safari, Chrome or IE 7) then it will support this interface on
 Windows, OS X or Linux.
\end_layout

\begin_layout Subsubsection
Interface Operation
\end_layout

\begin_layout Standard
When the user opens the index.html page on the server he gets:
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/index.png
	scale 30

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Index page
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Standard
This instructs the user to log into the system, picking the Login control
 item you get:
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/login.png
	scale 30

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Login page
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
The user then has to enter a response to the challenge value.
 These challenge/response pairs are random 16 bit Hex values and the user
 must have this list to log in.
 The challenge value is found in the table and corresponding response 16
 bit value is typed into the response field.
 If the choice is correct you then get:
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/main.png
	scale 30

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Main Screen
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
From here the user can pick any of the Control values on the left.
 Picking Debug gets this:
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/debug.png
	scale 30

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Debug Screen
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
The user can type any RESTful command (see 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:RESTful-Interface"

\end_inset

), press Submit and the results are returned.
 This is useful in debugging system problems.
 Picking Show Manual allows manual operation of the firing boxes as:
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/man1.png
	scale 30

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Manual Screen
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
Here the user is shown all the available firing nodes and their state.
 In this case all are not ARMed so the status of the channels are unknown.
 Picking the ARM button will turn all the boxes to ARMed and then show the
 channel status (i.e.
 is there something connected).
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/main_arm.png
	scale 30

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Arm Screen
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
This now shows pieces connected on all channels and all are ready to fire.
 You then can pick the pices to fire (note only 1/node) and they then show
 ready to fire.
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/man_ready.png
	scale 30

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Ready Screen
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
If you press the FIRE button these pieces will be fired and their status
 will change:
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/man_fire.png
	scale 30

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Fire Screen
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
An inventory screen is avaliable to show the firing boxes in the network,
 their software version and status of EEPROM values.
 This is useful to see make sure all boxes have the same settings for a
 show.
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/inventory.png
	scale 65

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Inventory display
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
When the Automated show choice is entered the user can pick the store show.
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename Images/Auto_Start.png
	scale 35

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Automated Show
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
Once the show is picked then the nodes are shown like the Manual show view.
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename Images/AutoUnArmed.png
	scale 35

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Automated Show Node Unarmed
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
After arming the show is ready to start
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename Images/Auto_Armed.png
	scale 35

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Armed Show ready to run
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
once the show is running then an indicator shows how much has been run
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename Images/Auto_Running.png
	scale 35

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Running Show
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
Note the large ABORT button that will stop the show instantly.
\end_layout

\begin_layout Subsection
RESTful Interface
\begin_inset CommandInset label
LatexCommand label
name "sub:RESTful-Interface"

\end_inset


\end_layout

\begin_layout Standard
The web server running on the Control Computer actally has two functions,
 it can just serve up web pages and second under control of Lua scripting
 it can interact in a RESTful manner.
 Serving up web pages allows the system when contacted by the interface
 computer to serve up Login pages or the Javascript application.
 On the application is running the interface computer browser it then interacts
 with the web browser in a RESTful manner.
\end_layout

\begin_layout Subsubsection
REST use
\end_layout

\begin_layout Standard
In the system used here we restrict ourselves to just two commands GET and
 POST.
 The HTTP get command is used to query the system for information and the
 POST command is used cause the system to do some action.
 There is a wide latitude in how RESTful commands are done, you can either
 put command parameters (in a POST) in a JSON
\begin_inset CommandInset citation
LatexCommand cite
key "JSON"

\end_inset

 encoded data block sent with the POST or encode it into the URL of the
 command.
 
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/rest_cmds.eps
	scale 30

\end_inset


\end_layout

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Caption

\begin_layout Plain Layout
REST command structure
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Standard
In the FIRENET system we have encoded most of the command syntax into the
 URI.
 As you can see from the base node (which is programmable see: 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:http.start()"

\end_inset

) we then have nodes to get the administrative or FIRENET functions.
 Doing GETs will return data from a node and doing a POST will cause some
 action.
\end_layout

\begin_layout Standard
For the following examples we will assume the web server (Control computer)
 is at http://192.168.1.100:8080 and that the base of the RESTful tree is at
 REST.
\end_layout

\begin_layout Standard
So a full FIRENET system status is done with an HTTP GET to:
\end_layout

\begin_layout LyX-Code
http://192.168.1.100:8080/rest/firenet/status
\end_layout

\begin_layout Standard
The response from this query is a JSON data block.
\end_layout

\begin_layout Standard
Status of a single node is found via
\end_layout

\begin_layout LyX-Code
http://192.168.1.100:8080/rest/firenet/status/5
\end_layout

\begin_layout Standard
where 5 is the selected node number.
\end_layout

\begin_layout Standard
Firing a node is done by a POST to:
\end_layout

\begin_layout LyX-Code
http://192.168.1.100:8080/rest/firenet/fire/5/3
\end_layout

\begin_layout Standard
would fire channel 3 on node 5
\end_layout

\begin_layout Subsubsection
Startup
\end_layout

\begin_layout Standard
The REST operation is controlled by both HTTP pages (html & javascript)
 and a set of Lua scripts.
 When started the Firenet main program reads both of these sets of files
 to produce the desired actions.
 The command line options are:
\end_layout

\begin_layout Description
CommandLine Options
\end_layout

\begin_layout Description
-p # Port # of serial port connected to Firenet
\end_layout

\begin_layout Description
-c <REST Lua main code>
\end_layout

\begin_layout Description
-rest <Directory of Lua REST code>
\end_layout

\begin_layout Description
-http <Directory of HTML & Javascript code, location of index.html>
\end_layout

\begin_layout Description
-show <Directory of Automated show files>
\end_layout

\begin_layout Description
-log <File> [Optional] Log file of Firenet operations during the run
\end_layout

\begin_layout Paragraph
Example
\end_layout

\begin_layout LyX-Code

\size footnotesize
./Firenet -p 1 -c Site/Rest/main.lua -http Site/Site_J -show Shows -log log.txt
\end_layout

\begin_layout Standard
Here the Firenet is started using device 1 as the Firenet network connection.
 The Lua file main.lua is run as the initial script, the HTML is stored in
 Site/Site_J and the show files are stored in the directory Shows.
 The initial connection to the server would be:
\end_layout

\begin_layout LyX-Code
http://<server IP>:8081/Site_J/index.html
\end_layout

\begin_layout Subsubsection
REST API
\end_layout

\begin_layout Standard
The REST API consists of a number of URI's and specifications for the data
 sent or received with the requests.
 We will specify the URI as http://<server>/<rest>/...
 Where <server> stands for the TCP/IP address and port of the server and
 <rest> stands for the path link set up for REST interactions (see 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:http.start()"

\end_inset

).
\end_layout

\begin_layout Subsubsection
ADMIN
\end_layout

\begin_layout Standard
These are overall control functions for the server and are not concerned
 with the FIRENET nodes or network.
\end_layout

\begin_layout Paragraph
ADMIN/TIME
\begin_inset Index
status open

\begin_layout Plain Layout
TIME
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is used to read out the server system clock.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/admin/time
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GET
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The returned data is the current server system time.
\end_layout

\begin_layout LyX-Code
{ "TIME" : "Sun Nov 14 16:46:21 2010" }
\end_layout

\begin_layout Paragraph
ADMIN/POWER
\begin_inset Index
status open

\begin_layout Plain Layout
POWER
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This URI is used to check for system running and to shutdown the system
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="4">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
ACTION
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/admin/power
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GET
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Return status
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/admin/power/on
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Return status
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/admin/power/off
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Return status and shutdown
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The returns status for the GET and first POST is:
\end_layout

\begin_layout LyX-Code
{ "SYSTEM" : "ON" }
\end_layout

\begin_layout Standard
For the second POST shutdown the response is:
\end_layout

\begin_layout LyX-Code
{ "SYSTEM" : "OFF" }
\end_layout

\begin_layout Paragraph
ADMIN/LOGIN
\end_layout

\begin_layout Standard
Multiple sub commands used for logging in.
 A client is logged in no other IP address can access the web server (see
 the http.lock() command 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:http.lock()"

\end_inset

).
 It is a simple challenge/response system.
 When a request is made to log in the system supplies a challenge value,
 a 16 bit value.
 The user responds with 16 bit (i.e.
 4 digit) value.
 If this matches that client is logged in and no other IP address is allowed
 by the server.
\end_layout

\begin_layout Standard
The challenge is one of these 4 byte values:
\end_layout

\begin_layout LyX-Code
"50A0","F748","95B1","8D8B","4F34","52C7","85B6","EA03",
\end_layout

\begin_layout LyX-Code
"E6B8","D37F","4FE1","5215","A868","9336","2885","6F15"
\end_layout

\begin_layout Standard
The correct response is the value following the challenge value (with the
 last value 6F15, looping back to the first 50A0).
\end_layout

\begin_layout Standard

\series bold
ADMIN/LOGIN/REQUEST
\begin_inset Index
status open

\begin_layout Plain Layout

\series bold
REQUEST
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Used to request a challenge value.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/admin/login/request
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GET
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
{ 
\begin_inset Quotes eld
\end_inset

CHAL
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

<Chal value>
\begin_inset Quotes erd
\end_inset

 }
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard

\series bold
ADMIN/LOGIN/RESPONSE
\series default

\begin_inset Index
status open

\begin_layout Plain Layout
RESPONSE
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is used to return the response to the challenge.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/admin/login/response/<resp hex>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
{ 
\begin_inset Quotes eld
\end_inset

LOGIN
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

OK
\begin_inset Quotes erd
\end_inset

 }
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard

\series bold
ADMIN/LOGIN/STATUS
\begin_inset Index
status open

\begin_layout Plain Layout

\series bold
STATUS
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is used to query the server on the login status
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/admin/login/status
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GET
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
{ 
\begin_inset Quotes eld
\end_inset

LOGIN
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

OK
\begin_inset Quotes erd
\end_inset

 } or { 
\begin_inset Quotes eld
\end_inset

LOGIN
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

NO
\begin_inset Quotes erd
\end_inset

 }
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard

\series bold
ADMIN/LOGIN/LOGOUT
\begin_inset Index
status open

\begin_layout Plain Layout

\series bold
LOGOUT
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/admin/login/logout
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
{ 
\begin_inset Quotes eld
\end_inset

LOGOUT
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

OK
\begin_inset Quotes erd
\end_inset

 }
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
FIRENET
\end_layout

\begin_layout Standard
This URI us connected to the FIRENET network and will control and return
 status of the operating FIRENET boards.
 
\end_layout

\begin_layout Paragraph
FIRENET/STATUS
\begin_inset Index
status open

\begin_layout Plain Layout
STATUS
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This URI is used to read the status of the entire network or a single node
 status.
 The entire network status is useful when starting the system or to recover
 from a restart.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/status
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GET
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Entire network status
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/status/C
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GET
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Entire network status & clear network map
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/status/<node#>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GET
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Single node status
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The entire network status is:
\end_layout

\begin_layout LyX-Code
{ "STATUS" : "SUCCESS" 
\end_layout

\begin_deeper
\begin_layout LyX-Code
{ 
\end_layout

\begin_deeper
\begin_layout LyX-Code
"1" : { 
\end_layout

\begin_deeper
\begin_layout LyX-Code
"ARMED" : "0"
\end_layout

\begin_layout LyX-Code
"UNFIRED" : { 
\end_layout

\begin_deeper
\begin_layout LyX-Code
"1" : "1"
\end_layout

\begin_layout LyX-Code
"2" : "1"
\end_layout

\begin_layout LyX-Code
"3" : "1"
\end_layout

\begin_layout LyX-Code
"4" : "1"
\end_layout

\begin_layout LyX-Code
"5" : "1"
\end_layout

\begin_layout LyX-Code
"6" : "1"
\end_layout

\end_deeper
\begin_layout LyX-Code
 }
\end_layout

\begin_layout LyX-Code
"FIRED" : { 
\end_layout

\begin_deeper
\begin_layout LyX-Code
"1" : "0"
\end_layout

\begin_layout LyX-Code
"2" : "0"
\end_layout

\begin_layout LyX-Code
"3" : "0"
\end_layout

\begin_layout LyX-Code
"4" : "0"
\end_layout

\begin_layout LyX-Code
"5" : "0"
\end_layout

\begin_layout LyX-Code
"6" : "0"
\end_layout

\end_deeper
\begin_layout LyX-Code
 }
\end_layout

\end_deeper
\end_deeper
\begin_layout LyX-Code
}
\end_layout

\begin_layout LyX-Code
{
\end_layout

\begin_deeper
\begin_layout LyX-Code
\begin_inset Quotes eld
\end_inset

2
\begin_inset Quotes erd
\end_inset

 : {
\end_layout

\begin_layout LyX-Code
:
\end_layout

\begin_layout LyX-Code
:
\end_layout

\end_deeper
\end_deeper
\begin_layout LyX-Code
}
\end_layout

\begin_layout Standard
Each node is grouped separately and 
\begin_inset Quotes eld
\end_inset

1
\begin_inset Quotes erd
\end_inset

 node is shown fully here.
 As you can see each node has its ARMED status (see below) and the status
 of each firing channel listed.
 The UNFIRED values with a 1 means there is ignitor connected to that channel
 and it has not been fired.
 A 0 means there is nothing connected to that channel.
 The FIRED value, 0 means it has not been fired yet and 1 means it has.
\end_layout

\begin_layout Standard
The 
\begin_inset Quotes eld
\end_inset

C
\begin_inset Quotes erd
\end_inset

 command will do the same network status for all the nodes but in additon
 will clear the map of any previous entries and build a new map.
 If a node had changed address it will still be in the old map.
 This 
\begin_inset Quotes eld
\end_inset

C
\begin_inset Quotes erd
\end_inset

 will ensure that none of the phantom entries will be present.
\end_layout

\begin_layout Standard
When a single node status is read you get the following JSON.
 This is almost the same as the full status but the node number is not given
 in this case since you requested a particular node in the URI that value
 is not returned with the data.
\end_layout

\begin_layout LyX-Code
{ "STATUS" : "SUCCESS" 
\end_layout

\begin_deeper
\begin_layout LyX-Code
{ 
\end_layout

\begin_deeper
\begin_layout LyX-Code
"ARMED" : "0"
\end_layout

\begin_layout LyX-Code
"UNFIRED" : { 
\end_layout

\begin_deeper
\begin_layout LyX-Code
"1" : "1"
\end_layout

\begin_layout LyX-Code
"2" : "1"
\end_layout

\begin_layout LyX-Code
"3" : "1"
\end_layout

\begin_layout LyX-Code
"4" : "1"
\end_layout

\begin_layout LyX-Code
"5" : "1"
\end_layout

\begin_layout LyX-Code
"6" : "1"
\end_layout

\end_deeper
\begin_layout LyX-Code
 }
\end_layout

\begin_layout LyX-Code
"FIRED" : { 
\end_layout

\begin_deeper
\begin_layout LyX-Code
"1" : "0"
\end_layout

\begin_layout LyX-Code
"2" : "0"
\end_layout

\begin_layout LyX-Code
"3" : "0"
\end_layout

\begin_layout LyX-Code
"4" : "0"
\end_layout

\begin_layout LyX-Code
"5" : "0"
\end_layout

\begin_layout LyX-Code
"6" : "0"
\end_layout

\end_deeper
\begin_layout LyX-Code
 }
\end_layout

\end_deeper
\begin_layout LyX-Code
 }
\end_layout

\end_deeper
\begin_layout LyX-Code
}
\end_layout

\begin_layout Paragraph
FIRENET/ARM
\begin_inset Index
status open

\begin_layout Plain Layout
ARM
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This command is used to ARM, i.e.
 turn on firing power in a FIRENET node.
 The unit will not fire an ignitor unless it is armed.
 
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/arm/<node #>/A
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Node # is the particular node to be armed
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/arm/<node #>/D
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Node # is the particular node to be disarmed
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The ARMED or DISARMED state will be reflected in the node status.
\end_layout

\begin_layout Paragraph
FIRENET/FIRE
\begin_inset Index
status open

\begin_layout Plain Layout
FIRE
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This command is used to fire a ignitor on a node.
 The data includes the node # and channel (1-6) on the node.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/fire/<node #>/<Channel #>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Node # and Channel # must be supplied
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
After a ignitor is fired the status will be changed for that channel.
 The FIRED value will go to 1 and the UNFIRED will go to 0 if the firing
 was successful.
\end_layout

\begin_layout Paragraph
FIRENET/SYNC
\begin_inset Index
status open

\begin_layout Plain Layout
SYNC
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This message is sent to all FIRENET nodes and synchronizes their millisecond
 clocks.
 This will be needed to support delayed firing commands.
 The optional P node on the end will start the program 
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/sync/[P]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
All node millisecond clocks are set to 0, iP added program is started
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Paragraph
FIRENET/PGM
\begin_inset Index
status open

\begin_layout Plain Layout
PGM
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is similar to the DELAY command but in this case the delay command
 will be stored.
 All FIRENET nodes have a 32 bit millisecond timer.
 The SYNC command zeros the timers on all nodes.
 Sending a PROGRAM command will store up a FIRE command to occur at a specific
 32 bit millisecond time.
 Thus a number of nodes can fire pieces as precisely the same time.When the
 Sync is set with a P node then the sequence of stored commands will be
 started
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
...firenet/pgm/<node #>/<Channel #>/<MS time>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Fire channel on specified node at 32 bit ms time
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Paragraph
FIRENET/DELAY
\begin_inset Index
status open

\begin_layout Plain Layout
DELAY
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is similar to the FIRE command but in this case the firing command
 will be executed at a set time.
 All FIRENET nodes have a 32 bit millisecond timer.
 The SYNC command zeros the timers on all nodes.
 Sending a DELAY command will queue up a FIRE command to occur at a specific
 32 bit millisecond time.
 Thus a number of nodes can fire pieces as precisely the same time.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
...firenet/delay/<node #>/<Channel #>/<MS time>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Fire channel on specified node at 32 bit ms time
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Paragraph
FIRENET/VERSION
\end_layout

\begin_layout Standard
This message is used to get the version information on a Firenet node.
 When set to a specific node it returns the date time of the software version
 in the node.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/version/<node #>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GET
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Node # must be supplied
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
This then returns the JSON:
\end_layout

\begin_layout LyX-Code
{ "STATUS" : "XMIT", "VERSION" : "RVMar  6 2011 16-23-19"  } 
\end_layout

\begin_layout Standard
The software was loaded on the node 6 March 2011 at 16:23:19 local time.
\end_layout

\begin_layout Paragraph
FIRENET/CHANNEL
\end_layout

\begin_layout Standard
This command is used to read out the A/D value on a particular channle of
 a node.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/channel/<node #>/<Channel #>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GET
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Node # and Channel # must be supplied
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
This returns the JSON:
\end_layout

\begin_layout LyX-Code
{ "STATUS" : "XMIT", "AD" : "0039", "DATA" : "RC00039", "FIRED" : "0" }
 
\end_layout

\begin_layout Standard
This says the AD value is 0039 (with 1023 MAX) and the data shows the message
 received back (see message section) and FIRED shows the status of the fired
 bit (this channel is not fired).
\end_layout

\begin_layout Paragraph
FIRENET/LITERAL
\end_layout

\begin_layout Standard
This command allows any FIRENET network message to be sent and the response
 received.
 The message is sent only to the node (0 address not allowed).
 The Firenet response is returned.
 
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/literal/<node #>/<MSG>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Node # must be supplied
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
For example sending the command V (version) you send:
\end_layout

\begin_layout Standard

\series bold
...firenet/literal/1/v
\series default
 Sends the command V to node 1 you get the JSON:
\end_layout

\begin_layout LyX-Code
{ "STATUS" : "XMIT", "FROM" : "1", "DATA" : "RVMar 6 2011 16-23-19" } 
\end_layout

\begin_layout Subsubsection
PROGRAM
\end_layout

\begin_layout Paragraph
Introduction
\end_layout

\begin_layout Standard
These are a set of command used to start and run an automated show.
 In this case the nodes are programmed with the firing sequences see (
\begin_inset CommandInset ref
LatexCommand vref
reference "par:PGM"

\end_inset

) and then run.
 These commands allow selection of a show (music and firing sequence files),
 loading of the nodes and running the show.
\end_layout

\begin_layout Description
ProgramCommands 
\end_layout

\begin_deeper
\begin_layout Description
list Return a list of available shows
\end_layout

\begin_layout Description
set Select an available show
\end_layout

\begin_layout Description
pgm Program nodes with selected show
\end_layout

\begin_layout Description
start Start selected show with both firing actions and music
\end_layout

\begin_layout Description
status Readout of fired pieces during show
\end_layout

\begin_layout Description
abort Stop show as an emergency action
\end_layout

\end_deeper
\begin_layout Paragraph
Show Directory
\end_layout

\begin_layout Standard
The FIRENET program has been given the directory of the available shows
 with the -shows <directory> command line flag.
 In this directory are music files and corresponding firing sequence files.
 Also there is a file called 
\series bold
shows.json
\series default
 which lists the available shows in the following form:
\end_layout

\begin_layout LyX-Code
{
\end_layout

\begin_deeper
\begin_layout LyX-Code
"shows" : [
\end_layout

\end_deeper
\begin_layout LyX-Code
		{ "show"		:	"La Mariseillaise",
\end_layout

\begin_layout LyX-Code
		  "file"		:	"mariseillaise.json",
\end_layout

\begin_layout LyX-Code
		  "nodes"		:	"6",
\end_layout

\begin_layout LyX-Code
		  "time"		:	"1:26"
\end_layout

\begin_layout LyX-Code
		  },
\end_layout

\begin_layout LyX-Code
		  
\end_layout

\begin_layout LyX-Code
		  {
\end_layout

\begin_layout LyX-Code
		  	"show"		:	"Stars & Stripes Forever",
\end_layout

\begin_layout LyX-Code
		  	"file"		:	"ss_forever.json",
\end_layout

\begin_layout LyX-Code
		  	"nodes"		:	"10",
\end_layout

\begin_layout LyX-Code
		  	"time"		:	"3:38"
\end_layout

\begin_layout LyX-Code
		  }
\end_layout

\begin_layout LyX-Code
		]
\end_layout

\begin_layout LyX-Code
}
\end_layout

\begin_layout LyX-Code

\end_layout

\begin_layout Standard
Where each set of KVP's corresponds to a particular show detailing the name,
 show description file, # nodes required and the time of the show.
\end_layout

\begin_layout Standard
The show (e.g ss_forever.json) file for any particular show looks as follows:
\end_layout

\begin_layout LyX-Code
{
\end_layout

\begin_deeper
\begin_layout LyX-Code
"show"       :	"Stars & Stripes Forever",
\end_layout

\begin_layout LyX-Code
"music"      :	"stars_stripes_forever.mp3",
\end_layout

\begin_layout LyX-Code
"time"       :	"3:38",
\end_layout

\begin_layout LyX-Code
"nodes"      :	"10",
\end_layout

\begin_layout LyX-Code
\begin_inset Quotes eld
\end_inset

program
\begin_inset Quotes erd
\end_inset

    : [
\end_layout

\end_deeper
\begin_layout LyX-Code
				{ "node"  :  " 1",  "ch"  :  "1",  "delay"  :  "1000"},
\end_layout

\begin_layout LyX-Code
				{ "node"  :  " 1",  "ch"  :  "2",  "delay"  :  "2000"},
\end_layout

\begin_layout LyX-Code
				{ "node"  :  " 1",  "ch"  :  "3",  "delay"  :  "3000"},
\end_layout

\begin_layout LyX-Code
                       :
\end_layout

\begin_layout LyX-Code
                       :
\end_layout

\begin_deeper
\begin_layout LyX-Code
]
\end_layout

\end_deeper
\begin_layout LyX-Code
}
\end_layout

\begin_layout Standard
Where the music file (in the same directory) and the programming commands
 for the show are stored.
\end_layout

\begin_layout Paragraph
FIRENET/PROGRAM/LIST
\begin_inset Index
status open

\begin_layout Plain Layout
LIST
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This command is used to return a list of available shows to the user.
 The FIRENET program has been given the directory containing the show files
 and it reads a file 
\begin_inset Quotes eld
\end_inset

shows.json
\begin_inset Quotes erd
\end_inset

 and returns that data to the requestor.
 It returns the JSON from the shows.json file (see above)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/program/list
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
No data, only one referant
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The returned JSON data will exactly match the 
\series bold
shows.json
\series default
 file from the designated shows directory.
\end_layout

\begin_layout Paragraph
FIRENET/PROGRAM/SET
\begin_inset Index
status open

\begin_layout Plain Layout
SET
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This command is used to select the show to be run.
 After receiving the list the user sends back a name from the list of available
 shows and that show's data is read.
 This will also program all the nodes with the show's data and queue up
 the music file.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/program/set/#
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Show position in the list
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The response is a JSON status response:
\end_layout

\begin_layout LyX-Code

\size footnotesize
{
\end_layout

\begin_deeper
\begin_layout LyX-Code

\size footnotesize
\begin_inset Quotes eld
\end_inset

STATUS
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

OK
\begin_inset Quotes erd
\end_inset

   <-- If successful, other responses if the number is not correct
\end_layout

\end_deeper
\begin_layout LyX-Code

\size footnotesize
}
\end_layout

\begin_layout Paragraph
FIRENET/PROGRAM/PGM
\begin_inset Index
status open

\begin_layout Plain Layout
PGM
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This command will program all the connected firenet nodes with the show
 times as given in the particular show file.
 This will also check that all nodes have been programmed correctly.
 
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/program/set/#
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Show position in the list
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The response is a JSON status response:
\end_layout

\begin_layout LyX-Code

\size footnotesize
{
\end_layout

\begin_deeper
\begin_layout LyX-Code

\size footnotesize
\begin_inset Quotes eld
\end_inset

STATUS
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

OK
\begin_inset Quotes erd
\end_inset

   <-- If successful, other responses nodes were not programmed
\end_layout

\end_deeper
\begin_layout LyX-Code

\size footnotesize
}
\end_layout

\begin_layout Paragraph
FIRENET/PROGRAM/START
\begin_inset Index
status open

\begin_layout Plain Layout
START
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is the command to start the show.
 If the show has been SET then this will start the sync the nodes, start
 the music file and the programmed sequence in the nodes.
 The user has to have armed the nodes before sending this command.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/program/PGM
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Will return status message
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout LyX-Code

\size footnotesize
{
\end_layout

\begin_deeper
\begin_layout LyX-Code

\size footnotesize
\begin_inset Quotes eld
\end_inset

STATUS
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

OK
\begin_inset Quotes erd
\end_inset

   <-- If successful, other responses if the number is not correct
\end_layout

\end_deeper
\begin_layout LyX-Code

\size footnotesize
}
\end_layout

\begin_layout Paragraph
FIRENET/PROGRAM/STATUS
\begin_inset Index
status open

\begin_layout Plain Layout
STATUS
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This command is used to return status during the show.
 It will tell if the show is still running and what nodes have fired since
 the last status message.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/program/status
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Will return status message
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout LyX-Code

\size footnotesize
{
\end_layout

\begin_layout LyX-Code

\size footnotesize
   
\begin_inset Quotes eld
\end_inset

STATUS
\begin_inset Quotes erd
\end_inset

  : 
\begin_inset Quotes eld
\end_inset

OK
\begin_inset Quotes erd
\end_inset

,     <-- Other values 
\begin_inset Quotes eld
\end_inset

eos
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset Quotes eld
\end_inset

abort
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_deeper
\begin_layout LyX-Code

\size footnotesize
 
\begin_inset Quotes eld
\end_inset

FIRED
\begin_inset Quotes erd
\end_inset

 : [
\end_layout

\begin_deeper
\begin_layout LyX-Code

\size footnotesize
{ 
\begin_inset Quotes eld
\end_inset

FROM
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

<Node #>
\begin_inset Quotes erd
\end_inset

, 
\begin_inset Quotes eld
\end_inset

CH
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

<Fired Channel>
\begin_inset Quotes erd
\end_inset

 },<-- There will be 1 or more
\end_layout

\end_deeper
\begin_layout LyX-Code

\size footnotesize
       :
\end_layout

\begin_layout LyX-Code

\size footnotesize
       :
\end_layout

\begin_layout LyX-Code

\size footnotesize
]
\end_layout

\end_deeper
\begin_layout LyX-Code

\size footnotesize
}
\end_layout

\begin_layout Paragraph
FIRENET/PROGRAM/ABORT
\begin_inset Index
status open

\begin_layout Plain Layout
ABORT
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This command is used to immediately stop a show.
 All nodes are reset and the music stopped.
 It returns a status message.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Request URI
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
TYPE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
DATA
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http://<server>/<rest>/firenet/program/status
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Will return status message
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout LyX-Code

\size footnotesize
{
\end_layout

\begin_deeper
\begin_layout LyX-Code

\size footnotesize
\begin_inset Quotes eld
\end_inset

STATUS
\begin_inset Quotes erd
\end_inset

 : 
\begin_inset Quotes eld
\end_inset

OK
\begin_inset Quotes erd
\end_inset

   <-- If successful, other responses if problem
\end_layout

\end_deeper
\begin_layout LyX-Code

\size footnotesize
}
\end_layout

\begin_layout Section
Lua Extension Classes
\end_layout

\begin_layout Standard
Firenet the firing system is controlled by Lua scripts run on the 
\series bold
FIRENET
\series default
 program.
 There are a number of extension classes written to support these scripts.
 First there are extensions allowing FIRENET communication with the nodes.
 There is a class layered over the libmicrohttpd Web server library allow
 Lua access to web data for the RESTful operation.
 In addition there are support extension classes added for timers, JSON
 parsing and keyboard control.
 
\end_layout

\begin_layout Standard
Following this will be a discussion of the scripts written with these extensions
 to support both the RESTful interface and interfacing with the FIRENET
 network.
\end_layout

\begin_layout Subsection
RESTful Interface CLASS
\end_layout

\begin_layout Subsubsection
Introduction
\end_layout

\begin_layout Standard
The 
\series bold
FIRENET
\series default
 Lua system has a built in Web server so it can be used in conjunction with
 a browser based client application.
 This allows a rather full GUI application on any OS using the same JavaScript/B
rowser application.
 In order for this to work an HTTP support library has been added.
 The library GNU libmicrohttpd (
\begin_inset Flex URL
status open

\begin_layout Plain Layout

http://www.gnu.org/software/libmicrohttpd/
\end_layout

\end_inset

)
\begin_inset CommandInset citation
LatexCommand cite
key "HTTP"

\end_inset

 is very well suited for this task.
 It is small, selfcontained and is designed to be added into applications.
 
\end_layout

\begin_layout Standard
In addition a JSON parser has been added to support data sent in this form.
 JSON messages out are easily generated using formatted write statements
 in Lua.
\end_layout

\begin_layout Subsubsection
Class Operation
\end_layout

\begin_layout Standard
The Web server/RESTful class has three major parts.
 The first is used to stop and start the server.
 The start command requires parameters to tell it the TCP/IP port to use
 for the HTTP transfer, data where standard web pages are located and a
 location base for the RESTful request URIs.
 The system can be used as a normal web server serving up pages, in fact
 this is used to load up the Javascript application to the client's browser.
\end_layout

\begin_layout Standard
The second part is a simple open/close set of calls to accept a request
 and return a response.
 Each request is an opaque Lua user object that is generated on receipt
 of a request and is automatically destroyed when the response is returned.
\end_layout

\begin_layout Standard
The third section of the class is used to extract information from the request,
 this includes the request URL and any data included in the request.
 
\end_layout

\begin_layout Subsubsection
Class Methods - Server Control
\end_layout

\begin_layout Paragraph
http.start()
\begin_inset Index
status open

\begin_layout Plain Layout
http.start()
\end_layout

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "par:http.start()"

\end_inset


\end_layout

\begin_layout Standard
This will start the HTTP server running.
\end_layout

\begin_layout LyX-Code
status = http.start(port,http_base,rest_base)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="5" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
port
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
TCP/IP used for HTTP messages
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
http_base
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Absolute path to standard html files served
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
rest_base
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Base path for RESTful actions of server
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
status
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1 if server started OK, nil if failure
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
If the port was set to 8080 and the server's address was say 192.168.1.100
 then the following URI would access index.html stored at the http_base path.
\end_layout

\begin_layout LyX-Code
http://192.168.1.100:8080/index.html
\end_layout

\begin_layout Standard
If rest_base was set to REST then following URI would access some RESTful
 action on the path action/node-1/fire/1
\end_layout

\begin_layout LyX-Code
http://192.168.1.100:8080/REST/action/node-1/fire/1
\end_layout

\begin_layout Standard
More details on the data and path information will be found in the http.url()
 method.
\end_layout

\begin_layout Paragraph
http.stop()
\begin_inset Index
status open

\begin_layout Plain Layout
http.stop()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This will stop the HTTP server.
\end_layout

\begin_layout LyX-Code
http.stop()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
This code can be used at any time after the http.start() command is given
 and you can then restart the server without shutting down the program.
\end_layout

\begin_layout Paragraph
\begin_inset CommandInset label
LatexCommand label
name "par:http.lock()"

\end_inset

http.lock()
\begin_inset Index
status open

\begin_layout Plain Layout
http.lock()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This command is used to lock or unlock the server to only speak to one IP
 address.
 It is run in the context of handling a request and if locked, the request
 client's IP address will be saved and only requests from that IP address
 will be accepted till the server is unlocked.
 All other requesters will get a 404.
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
h
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HTTP RESTful request handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
flag
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
If <> nil then lock is done, if nil then unlock
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
In the context of a request from IP=192.168.1.103 then:
\end_layout

\begin_layout LyX-Code
h:lock(1)
\end_layout

\begin_layout Standard
Would lock the server to 192.168.1.103 any other client would get a 404 on
 any request.
\end_layout

\begin_layout Paragraph
http.open()
\begin_inset Index
status open

\begin_layout Plain Layout
http.open()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This code is a 
\series bold
non-blocking
\series default
 call to receive a request.
 If a request is present you will be returned a handle to the request, if
 none you will get nil.
\end_layout

\begin_layout LyX-Code
h = http.open()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
h
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HTTP RESTful request handle.
 nil if no request pending
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
You can use this call to poll for requests, note the requests are queued
 so any pending requests are held till you retrieve them.
 You can have multiple outstanding requests.
\end_layout

\begin_layout Paragraph
http.close()
\begin_inset Index
status open

\begin_layout Plain Layout
http.close()
\end_layout

\end_inset


\end_layout

\begin_layout LyX-Code
http.close(h,data) or h:close(data)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
h
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HTTP RESTful request handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Data to be returned to client
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
As you can see this is an instance class and you may use the request handle
 as the selector to pick the method (close()).
 Either form is acceptable.
 This is used to return the result of a RESTful request to the client.
 The data is usually encoded as JSON and will available to the client.
\end_layout

\begin_layout Paragraph
http.url(h)
\begin_inset Index
status open

\begin_layout Plain Layout
http.url()
\end_layout

\end_inset

 
\end_layout

\begin_layout Standard
This method is used to get the URI of the request.
\end_layout

\begin_layout LyX-Code
http.url(h) or h:url()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
h
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HTTP RESTful request handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
url
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
URL returned as a numeric index list of the path parts [1] = rest_base
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
htty_type
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Numeric value of HTTP request type, see below for list
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
This class like close may be used either as a class method or an instance
 method.
 In addition it returns two parameters the url of the request and the HTTP
 request type.
\end_layout

\begin_layout Standard
The List returned for the example REST request http://192.168.1.100:8080/REST/actio
n/node #/fire/1 would be:
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="6" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INDEX
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
VALUE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
REST
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
action
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
3
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
node #
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
4
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
fire
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
5
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The http_type value returned is a number with the following meanings.
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="10" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Value
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Meaning
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HTTP_NONE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HTTP_CONNECT
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
HTTP_DELETE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
3
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
HTTP_GET
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
4
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HTTP_HEAD
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
5
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HTTP_OPTIONS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
6
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
HTTP_POST
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
7
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
HTTP_PUT
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
8
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HTTP_TRACE
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The highlighted items are the only ones normally used in the RESTful protocol.
\end_layout

\begin_layout Paragraph
http.data()
\begin_inset Index
status open

\begin_layout Plain Layout
http.data()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is used to get the data on a POST request.
\end_layout

\begin_layout LyX-Code
post_data = http.data(h) or h:data()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
h
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HTTP RESTful request handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
POST data from request, all other types return nil
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
This method is used to get the POST data on a request.
 This is returned as a string.
 In most cases in FIRENET it will be a JSON string which can be processed
 using the JSON parser.
\end_layout

\begin_layout Paragraph
parsers.json()
\begin_inset Index
status open

\begin_layout Plain Layout
parsers.json()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is used to turn a JSON string into a Lua list structure.
\end_layout

\begin_layout LyX-Code
json_list = parsers.json(json_string)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
json_string
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Valid JSON string
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
json_list
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
List version of JSON structure or nil if invalid JSON
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
This will turn a JSON string structure for example:
\end_layout

\begin_layout LyX-Code
json_string = 
\begin_inset Quotes eld
\end_inset

{ 
\backslash

\begin_inset Quotes eld
\end_inset

key
\backslash

\begin_inset Quotes erd
\end_inset

 : 
\backslash

\begin_inset Quotes eld
\end_inset

value
\backslash

\begin_inset Quotes erd
\end_inset

 
\backslash

\begin_inset Quotes eld
\end_inset

key1
\backslash

\begin_inset Quotes erd
\end_inset

 : 
\backslash

\begin_inset Quotes eld
\end_inset

value1
\backslash

\begin_inset Quotes erd
\end_inset

 }
\begin_inset Quotes erd
\end_inset


\end_layout

\begin_layout LyX-Code
list = parsers.json(json_string)
\end_layout

\begin_layout LyX-Code
print(list)
\end_layout

\begin_layout LyX-Code

\series bold
table: 0x100108bd0
\end_layout

\begin_layout LyX-Code
table.foreach(list,print)
\end_layout

\begin_layout LyX-Code

\series bold
JOBJ table: 0x100108c10
\end_layout

\begin_layout LyX-Code
table.foreach(list.JOBJ,print)
\end_layout

\begin_layout LyX-Code

\series bold
key value
\end_layout

\begin_layout LyX-Code

\series bold
key1 value1
\end_layout

\begin_layout Standard
See the JSON references for an idea of what sort of structures you can expect.
\end_layout

\begin_layout Subsection
Timer CLASS
\end_layout

\begin_layout Standard
This class is used for millisecond timing of events.
 It can be used to delay actions or time actions to millisecond accuracy.
 The general sequence is one creates a timer object with new() (which also
 starts the timer) and then can query to determine if a fixed time has passed
 with the done() method.
 The time period can be re-started with the start() method.
 
\end_layout

\begin_layout Standard
There is one class method (sleep()) that can be used without creating a
 timer object.
 The other methods work from a specific timer object.
\end_layout

\begin_layout Subsubsection
Timer Class Methods
\end_layout

\begin_layout Paragraph
timer.sleep()
\begin_inset Index
status open

\begin_layout Plain Layout
timer.sleep()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Will cause Lua to idle for a set number of milliseconds.
 
\end_layout

\begin_layout LyX-Code
handle:sleep(ms)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
ms
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Time to sleep in milliseconds
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
Timer Constructors/Destructors
\end_layout

\begin_layout Paragraph
timer.new()
\begin_inset Index
status open

\begin_layout Plain Layout
timer.new()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This creates a timer object that Lua can use for periodic operations and
 to check for elapsed time.
 Each timer has an individual handle and there is no limit to the number
 a script can have.
 Note all timers should be closed when they are no longer needed.
\end_layout

\begin_layout LyX-Code
handle = timer.new()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
No input needed
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
handle
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Handle to open timer, nil if failure
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The handle is opened and timer is started at 0.
 
\end_layout

\begin_layout Paragraph
timer.delete()
\begin_inset Index
status open

\begin_layout Plain Layout
timer.delete()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This will dispose of a timer when it is no longer needed.
\end_layout

\begin_layout LyX-Code
handle:delete()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
handle
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Open timer handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1 if deleted, nil if failure
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
Timer Methods
\end_layout

\begin_layout Paragraph
timer.start()
\begin_inset Index
status open

\begin_layout Plain Layout
timer.start()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is used to reset an active timer to 0.
 Useful to reset elapsed time to 0.
\end_layout

\begin_layout LyX-Code
result = timer.start(handle) or handle:start()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
handle
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Open timer handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1 if reset, nil if failure
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Paragraph
timer.done()
\begin_inset Index
status open

\begin_layout Plain Layout
timer.done()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is used to check for timer done, returns true when interval passed
 or nil if not
\end_layout

\begin_layout LyX-Code
handle:done(delay)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
handle
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Open timer handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
delay
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Delay time in ms
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1 if => delay time, nil if not
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Paragraph
timer.read()
\begin_inset Index
status open

\begin_layout Plain Layout
timer.read()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This is used to return the current elapsed time for a particular timer
\end_layout

\begin_layout LyX-Code
handle:read()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
handle
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Open timer handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Current elapsed time in ms or nil if error
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsection
Firenet Class
\end_layout

\begin_layout Standard
This is the interface to the Firenet network.
 This class will be able to sent and receive messages with the firing boxes
 on the net.
 This will send raw packets and receive raw packets.
\end_layout

\begin_layout Subsubsection
Data Format
\end_layout

\begin_layout Standard
Packets transmitted or received on the Firenet interface are in the form
 of Lua lists.
 There are three elements, the TO field where the destination address is
 specified, the FROM field where the source is specified and the DATA field
 for the packet data.
 All of these fields are present for a received packet, while the transmit
 packet does not need a FROM field.
\end_layout

\begin_layout Subsubsection
Creators/Destructors
\end_layout

\begin_layout Paragraph
firenet.new()
\begin_inset Index
status open

\begin_layout Plain Layout
firenet.new()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This creates a new network interface object.
 You must call this before starting a run.
\end_layout

\begin_layout LyX-Code
handle = firenet.new()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
No input needed
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
handle
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Handle to open firenet interface, nil if failure
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The object is created and the map is initialized for nodes present at this
 time.
\end_layout

\begin_layout Paragraph
firenet.delete()
\begin_inset Index
status open

\begin_layout Plain Layout
firenet.delete()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This will dispose of a network interface and map when no longer needed.
\end_layout

\begin_layout LyX-Code
handle:delete()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
handle
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Open firenet handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1 if deleted, nil if failure
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
Methods
\end_layout

\begin_layout Paragraph
firenet.read()
\begin_inset Index
status open

\begin_layout Plain Layout
firenet.read()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This returns the next message from the network.
 
\end_layout

\begin_layout LyX-Code
msg = handle:read()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
handle
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Open firenet handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
nil if no message or message list if found
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
When read the retuned message is a list with the following fields:
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Field
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Use
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Example
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
TO
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Destination node
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Usually your node but can be broadcast address
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
FROM
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Source Node
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
msg.from = Returns physical address
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
DATA
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Message Dependent Data fields
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Message dependent data (see Section 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Commands"

\end_inset

)
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Paragraph
firenet.write()
\begin_inset Index
status open

\begin_layout Plain Layout
firenet.write()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This writes a message to the network
\end_layout

\begin_layout LyX-Code
handle:write(msg)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
handle
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Open firenet handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1 if sent, nil if problem
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The send message is a Lua list with the following format
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Field
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Use
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Example
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
TO
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Message destination
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
msg.TO = 2 Send to node 3
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
DATA
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Message Dependent Data fields
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Message dependent data (see Section 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Commands"

\end_inset

)
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsection
Keyboard Class
\end_layout

\begin_layout Standard
This class which has no methods is used to query the keyboard while a script
 is running.
 This can be used to allow the user to hit keys to modify the script actions
 without halting script loops.
\end_layout

\begin_layout Subsubsection
Class Methods
\end_layout

\begin_layout Paragraph
kbd.prep()
\begin_inset Index
status open

\begin_layout Plain Layout
kbd.prep()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Prepares the keyboard for async input
\end_layout

\begin_layout LyX-Code
kbd.prep()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1 if prep OK, nil if not
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Paragraph
kbd.close()
\begin_inset Index
status open

\begin_layout Plain Layout
kbd.close()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Called to shut down the async processing of input.
 (See 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Use"

\end_inset

)
\end_layout

\begin_layout LyX-Code
kbd.close()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1 if close OK, nil if not
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Paragraph
kbd.getc()
\begin_inset Index
status open

\begin_layout Plain Layout
kbd.getc()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Reads the keyboard without stopping
\end_layout

\begin_layout LyX-Code
ch = kbd.getc()
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Keyboard character as a string or nil if none
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
Use
\begin_inset CommandInset label
LatexCommand label
name "sub:Use"

\end_inset


\end_layout

\begin_layout Standard
This code is used so the script can stay in a loop and query the keyboard
 in passing.
 This query does not halt the loop and allows characters to be input while
 the loop proceeds.
 Code example
\end_layout

\begin_layout LyX-Code

\series bold
kbd.prep()
\series default
 -- Get read for user input
\end_layout

\begin_layout LyX-Code
while( flag )
\end_layout

\begin_layout LyX-Code
do
\end_layout

\begin_deeper
\begin_layout LyX-Code
-- Do real work here....
\end_layout

\begin_layout LyX-Code
work_routine()
\end_layout

\begin_layout LyX-Code
-- User input ?
\end_layout

\begin_layout LyX-Code
ch = 
\series bold
kbd.getc()
\end_layout

\begin_layout LyX-Code
if( ch ~= nil and ch == 
\begin_inset Quotes eld
\end_inset

Q
\begin_inset Quotes erd
\end_inset

) 
\end_layout

\begin_layout LyX-Code
then
\end_layout

\begin_deeper
\begin_layout LyX-Code
-- User asked to quit
\end_layout

\begin_layout LyX-Code
print(
\begin_inset Quotes eld
\end_inset

** QUIT ENTERED **
\begin_inset Quotes erd
\end_inset

)
\end_layout

\begin_layout LyX-Code
break
\end_layout

\end_deeper
\begin_layout LyX-Code
end
\end_layout

\end_deeper
\begin_layout LyX-Code
end
\end_layout

\begin_layout LyX-Code
-- Remember to close on exit
\end_layout

\begin_layout LyX-Code

\series bold
kdb.close()
\end_layout

\begin_layout Section
Lua Support Code (firenet_sup.lua)
\end_layout

\begin_layout Subsection
Introduction
\end_layout

\begin_layout Standard
It was a design decision to put the minimum number and most basic functions
 in the system as C extensions to Lua.
 Then build on those using Lua to make a useful API for system operation.
 Thus functions like timers and Firenet I/O were added as Lua extensions.
 But other functions like playing a music file or managing the network status
 were built on these extensions and written in Lua.
 In consequence a set of support functions were written and would be included
 into user written scripts.
\end_layout

\begin_layout Subsection
Lua Globals
\end_layout

\begin_layout Subsubsection
\begin_inset Index
status open

\begin_layout Plain Layout
BCAST_ADDR
\end_layout

\end_inset

BCAST_ADDR
\end_layout

\begin_layout Standard
This variable contains the Firenet broadcast address.
 This can be used to set the destination address of a packet as follows:
\end_layout

\begin_layout LyX-Code
packet = {}
\end_layout

\begin_layout LyX-Code
packet.DATA = 
\begin_inset Quotes eld
\end_inset

S
\begin_inset Quotes erd
\end_inset

         -- Send a STATUS command
\end_layout

\begin_layout LyX-Code
packet.TO = BCAST_ADDR   -- Send to everyone
\end_layout

\begin_layout LyX-Code
h:write(packet)          -- Send to the network
\end_layout

\begin_layout Subsubsection
\begin_inset Index
status open

\begin_layout Plain Layout
FNET_MAP
\end_layout

\end_inset

FNET_MAP
\end_layout

\begin_layout Standard
This variable holds the current table of nodes on the network and their
 status.
 See 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:build_fnet_status()"

\end_inset

) on how these variables are filled but when they are set the have the following
 fields:
\end_layout

\begin_layout LyX-Code
FNET_MAP[<node number>]   -- Information on <node number>
\end_layout

\begin_deeper
\begin_layout LyX-Code
FNET_MAP[<node number>].ARMED    -- 1 if armed 0 if not
\end_layout

\begin_layout LyX-Code
FNET_MAP[<node number>].FIRED    -- 1-6 Array with 1 == Fired channels
\end_layout

\begin_layout LyX-Code
FIRE_MAP[<node number>].UNFIRED  -- 1-6 Array with 1 == Unfired ch
\end_layout

\end_deeper
\begin_layout Subsubsection
OS_MUSIC_PLAYER
\end_layout

\begin_layout Standard
This is the string name of the OS dependent command line music player program.
 In the case of OS X it is 
\begin_inset Quotes eld
\end_inset

afplay
\begin_inset Quotes erd
\end_inset

.
 
\end_layout

\begin_layout Subsection
Network Support Routines
\end_layout

\begin_layout Subsubsection
build_fnet_status()
\begin_inset CommandInset label
LatexCommand label
name "sub:build_fnet_status()"

\end_inset


\begin_inset Index
status open

\begin_layout Plain Layout
build_fnet_status()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This will fill the FNET_MAP variable with the current network node status.
 This will update the Arm/Disarm values plus the fired and unfired channels.
\end_layout

\begin_layout LyX-Code
h = firenet.new()
\end_layout

\begin_layout LyX-Code
build_fnet_status(h)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
addr
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
If present query only one node, if nil do broadcast
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
h
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Open firenet handle
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1 if status OK, nil if not
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsection
Misc Support Routines
\end_layout

\begin_layout Subsubsection
play_file()
\begin_inset Index
status open

\begin_layout Plain Layout
play_file()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This will use an operating system dependent program that can play a sound
 file.
 It will be used to play the music file associated with a fireworks display
\end_layout

\begin_layout LyX-Code
result = play_file(file)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
file
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
File name string (OS dependent)
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
result
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
pid of music player
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
play_file_stop()
\begin_inset Index
status open

\begin_layout Plain Layout
play_file_stop()
\end_layout

\end_inset


\end_layout

\begin_layout Standard
This will use an operating system dependent pid value from the play_file()
 routine to stop the music player.
\end_layout

\begin_layout LyX-Code
play_file_stop(pid)
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="3">
<features>
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<column alignment="center" valignment="top" width="0sp">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
INPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
USE
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
pid
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Pid return from play_file()
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
OUTPUT
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Music player stops
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Section
FIRENET Node Design
\end_layout

\begin_layout Standard
This is a networked Fireworks controller system that uses a RS-485 two wire
 network.
 Each firing box or node in the network has 6 firing circuits and up to
 30 of these boxes can be networked together.
 Each box has fixed network address.
 The node address is programmed into the EEPROM of the processor and each
 node box has the address marked on the outside in 
\series bold
large
\series default
 numbers.
\end_layout

\begin_layout Standard
The nodes are controlled by a laptop on the network running software that
 allows either manual or scripting firing sequences.
 The controlling software can also monitor the health and connectivity of
 the nodes and the network.
\end_layout

\begin_layout Section
Firenet Network Design
\end_layout

\begin_layout Subsection
Physical Layer
\begin_inset CommandInset label
LatexCommand label
name "sub:Physical-Layer"

\end_inset


\end_layout

\begin_layout Standard
The physical layer of the network uses the RS-485 standard interface with
 a two wire circuit.
 RS-485 uses a balanced circuit where the signal is one wire and the inverse
 is on the other wire.
 This gives greater noise immunity and a range of about 300 meters for the
 wiring.
 Since only two wires are used we both transmit and receive on the same
 pair.
 This means that a sender must enable the transmitter outputs then send
 the data, and when done disable the transmitter outputs.
 This is very similar (but much slower) that the original ethernet where
 all the signals were on a single coaxial cable.
 
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename /Users/jschimpf/Public/Firenet/Docs/Images/485network.eps
	scale 80

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
RS-485 Network
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Standard
In this design we will be using the Linear Technology chip LTC485
\begin_inset CommandInset citation
LatexCommand cite
key "LTC485"

\end_inset

 chip that is RS-485 compliant and is low power.
\end_layout

\begin_layout Subsection
Data Link Layer
\end_layout

\begin_layout Subsubsection
Packet Format
\end_layout

\begin_layout Standard
This layer handles the carrier sense multiple access and addressing of the
 data packets exchanged.
 The data packet on the network looks like this:
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename /Users/jschimpf/Public/Firenet/Docs/Images/packet.eps

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Packet Format
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Standard
The data in a packet is as follows:
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="7" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="left" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Name
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Example
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
HDR
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
:
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The ':' character
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
TO
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
ASCII two digit number
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
01 - 32 with 00 -> Broadcast
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
FROM
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
ASCII two digit number
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
01 - 32 with 00 -> Broadcast
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
DATA
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Up to 32 bytes of command data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
F1
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
EOP
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
;
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The ';' character
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CKSUM
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
ASCII two digit number cksum
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Mod 100 sum of all fields except : and ;
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The data is sent as ASCII strings and multiple commands can be sent in the
 same data packet by using , separators between commands.
 The entire packet is a printable ASCII string.
\end_layout

\begin_layout Subsubsection
Addressing
\begin_inset CommandInset label
LatexCommand label
name "sub:Addressing"

\end_inset


\end_layout

\begin_layout Standard
There are up to 32 devices in the network which have addresses ranging from
 1 to 30.
 The addresses are fixed in the devices and there should be no duplicate
 addresses in the network.
 The address 30 is the command node.
 The address 0 is the broadcast address and all devices will receive messages
 sent to this address.
\end_layout

\begin_layout Subsection
Application Layer
\begin_inset CommandInset label
LatexCommand label
name "sub:Application-Layer"

\end_inset


\end_layout

\begin_layout Standard
In this very simple network we will skip the Transport and Network layers
 of the OSI model.
 
\begin_inset CommandInset citation
LatexCommand cite
key "OSI"

\end_inset

The messages will be restricted to one packet and will be stand alone.
 Also the model here is with a controller (i.e.
 a laptop) controlling a number of firing boxes.
 This simplifies things as the nodes will not be talking to each other and
 will be driven by messages from the controller.
\end_layout

\begin_layout Standard
The unit of data to/from the network is a packet of the form:
\end_layout

\begin_layout LyX-Code
#define PHY_DATA_SIZE	32
\end_layout

\begin_layout LyX-Code
typedef struct {
\end_layout

\begin_deeper
\begin_layout LyX-Code
unsigned char type;
\end_layout

\begin_layout LyX-Code
unsigned char from;
\end_layout

\begin_layout LyX-Code
int len;
\end_layout

\begin_layout LyX-Code
unsigned char data[PHY_DATA_SIZE]; // Packet data
\end_layout

\end_deeper
\begin_layout LyX-Code
} PACKET;
\end_layout

\begin_layout Subsubsection
Commands
\begin_inset CommandInset label
LatexCommand label
name "sub:Commands"

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="16" columns="4">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="left" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Command
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
NAME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Information
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
A
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
ARM
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[D/A]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Disarm (D), Arm (A) firing circuits
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
F
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
FIRE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
<Ckt #>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Fire this circuit
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
D
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
DELAY_FIRE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
<Ckt #><Ms to fire>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Delay fire, fire at or at Time ms
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
S
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
STATUS
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Status (see below for resp msg)
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
W
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
WHO
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
# new address
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Changes address of node
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
T
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
TIME
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
# New firing time (ms)
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Change the firing time
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Z
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
SYNC
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[P]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Sync all node clocks, if P start firing queue
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
R
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
REPLY
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
R+ Last cmd letter
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Used to ACK no-reply messages
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
V
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
VERSION
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RV__DATE__ __TIME__
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Creation time of Node code
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
C
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CHANNEL
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
<Ckt #>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Return firing status & A/D of channel
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
M
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
TEST
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0/1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Turn test mode ON (1)/OFF (0)
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
B
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
BACKOFF
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
# Backoff time (0-255)
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Modify backoff time
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
X
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RESTART
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
NONE
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Restart noad software
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
R
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GET_DATA
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[<Data request>]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Return requested data
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
P
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
PGM
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
<Ckt #><Ms to fire>
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Put event into firing queue
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Node Command Table
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Paragraph
ARM
\begin_inset Index
status open

\begin_layout Plain Layout
ARM
\end_layout

\end_inset

 Command
\begin_inset CommandInset label
LatexCommand label
name "par:ARM"

\end_inset


\end_layout

\begin_layout Standard
This command is issued to enable/disable the firing circuits.
 If node is not armed then all firing commands are ignored.
 The node light will blink when box is armed.
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000

\series bold
AD
\series default
 Disarm node
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000

\series bold
AA
\series default
 Arm node
\end_layout

\begin_layout Paragraph
FIRE
\begin_inset Index
status open

\begin_layout Plain Layout
FIRE
\end_layout

\end_inset

 Command
\begin_inset CommandInset label
LatexCommand label
name "par:FIRE"

\end_inset


\end_layout

\begin_layout Standard
This command will fire a selected circuit in the node immediatly.
 The node will be out of communication till the firing cycle is over.
 The available firing channels are numbered from 0-5.
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000

\series bold
F3
\series default
 Fire circuit # 3
\end_layout

\begin_layout Standard
This command is ignored if sent to the broadcast address.
 There is no response.
\end_layout

\begin_layout Paragraph
DELAY FIRE
\begin_inset Index
status open

\begin_layout Plain Layout
DELAY FIRE
\end_layout

\end_inset

 Command
\begin_inset CommandInset label
LatexCommand label
name "par:DELAY"

\end_inset


\end_layout

\begin_layout Standard
This is similar to the firing command but will fire the selected ciruit
 at the specified time.
 All nodes keep a 32 bit millisecond counter.
 The Z command (see 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:SYNC"

\end_inset

) will sync the time for all the nodes.
 Thus you can send in a number of firing commands for different nodes and
 they will all fire at the same time.
 The available firing channels are numbered from 0-5.
 The command takes a single byte firing circuit value and 32 bit  time value.
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000

\series bold
D316384 
\series default
Fire circuit 3 after at 16,384 ms into the run.
\end_layout

\begin_layout Standard
This command is ignored if sent to the broadcast address.
 There is no response.
\end_layout

\begin_layout Paragraph
PGM EVENT
\begin_inset Index
status open

\begin_layout Plain Layout
EVENTCommand
\end_layout

\end_inset

 Command
\begin_inset CommandInset label
LatexCommand label
name "par:PGM"

\end_inset


\end_layout

\begin_layout Standard
This is similar to the DELAY FIRE but stores the command into a 6 element
 queue.
 All nodes keep a 32 bit millisecond counter.
 The ZP command (see 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:SYNC"

\end_inset

) will sync the time for all the nodes, also it will start the node cycling
 through the queue firing the events in time order.
 The available firing channels are numbered from 0-5.
 The command takes a single byte firing circuit value and 32 bit  time value.
\end_layout

\begin_layout Description
P316543 Store firing command for circuit 3 at 16,543 miliseconds.
\end_layout

\begin_layout Standard
This command is ignored if sent to the broadcast address.
 There is no response immediately
\end_layout

\begin_layout Standard
When the node fires it returns RP<ch #> allowing tracking of the autofiring.
 
\end_layout

\begin_layout Paragraph
STATUS
\begin_inset Index
status open

\begin_layout Plain Layout
STATUS
\end_layout

\end_inset

 Command
\begin_inset CommandInset label
LatexCommand label
name "par:STATUS"

\end_inset


\end_layout

\begin_layout Standard
This command generates a response message showing the node status
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000

\series bold
S
\series default
 Return status of node
\end_layout

\begin_layout Standard
The return message looks like this (it is sent to the address of the unit
 that sent the status command
\end_layout

\begin_layout Standard
RS[A/D]<Fired circuits><Unfired circuits>
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="5" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="left" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Field
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Meaning
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RS
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Status response designator
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
[A/D]
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Armed (A) or Disarmed (D) status of node
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Fired circuits
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Number 0-31 with it being the binary representation of fired ckts 03 - ckt,
 0& 1
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Unfired circuits
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Number 0-32 with it being the binary representation of unfired ckts 03 -ckt
 0 & 1
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The status message can be sent as a broadcast.
\end_layout

\begin_layout Paragraph
WHO
\begin_inset Index
status open

\begin_layout Plain Layout
WHO
\end_layout

\end_inset

 (are you) Command
\begin_inset CommandInset label
LatexCommand label
name "par:WHO"

\end_inset


\end_layout

\begin_layout Standard
Is used to set or read the address of a node.
 If the command is sent with a parameter the node's address will be changed.
 If no value is sent, the node's address is not changed.
 In either case the response will contain the current node address.
 A new address will not be accepted if sent to the broadcast address.
 It will also not be accepted is sent to the control node address (32).
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000

\series bold
W04
\series default
 Set address of node to 4
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000

\series bold
W 
\series default
No address change
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="4">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Message
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Response Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Meaning
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Change node address
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
W04
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RW01
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Returns current node address
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Get node address
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
W
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RW01
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Returns current node address
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
The address value must be in the range 1-31 to be accepted.
 NOTE: That after the command is sent the node's address will NOT change
 till it has been restarted.
 (See 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:RESTART-Command"

\end_inset

)
\end_layout

\begin_layout Paragraph
TIME
\begin_inset Index
status open

\begin_layout Plain Layout
TIME
\end_layout

\end_inset

 Command
\begin_inset CommandInset label
LatexCommand label
name "par:TIME"

\end_inset


\begin_inset CommandInset label
LatexCommand label
name "par:TIME-Command"

\end_inset


\end_layout

\begin_layout Standard
This command is used to set the firing time, by default it is 100 ms.
 This is the firing pulse time for any channel.
 This can be changed with this command and will be set in the device till
 changed again.
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000

\series bold
T1000 
\series default
Set firing time to 1000 ms (1 second)
\end_layout

\begin_layout Standard
Any value can be used and will depend on the device being fired.
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="4">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Message
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Response Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Meaning
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Set firing time to 1000 ms
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
T1000
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RT100
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Returns current firing time
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Get firing time
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
T
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RT100
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Returns current firing time
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
NOTE: That after the command is sent the node's firing time will NOT change
 till it has been restarted.
 (See 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:RESTART-Command"

\end_inset

)
\end_layout

\begin_layout Paragraph
SYNCHRONIZE
\begin_inset Index
status open

\begin_layout Plain Layout
SYNCHRONIZE
\end_layout

\end_inset

 Node Clocks
\begin_inset CommandInset label
LatexCommand label
name "par:SYNC"

\end_inset


\end_layout

\begin_layout List
\labelwidthstring 00.00.0000

\series bold
Z[P]
\series default
 Synchronize node clocks
\end_layout

\begin_layout Standard
This command is used to set all node (and controller clocks to zero.
 All nodes in the system have a 32 bit millisecond counter.
 This command when received will set that counter to zero.
 Then this counter can be used to schedule synchronized events in the various
 firing boxes.
 (See Delay fire command 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:DELAY"

\end_inset

).
 If P is present then the node goes into auto mode and beings firing the
 queue
\end_layout

\begin_layout Standard
Testing of the sync command with a script that syncs the nodes then has
 them fire at the same time shows the following spread in 10 runs with 3
 nodes, (4,5 and 6).
 Then monitering the firing time of channel 0 and using that to trigger
 a scope, it captured each of the nodes firing.
 Measuring between the first firing node and the last we get the following
 spreads in 10 trials.
\end_layout

\begin_layout LyX-Code

\series bold
Spread (ms)
\end_layout

\begin_deeper
\begin_layout LyX-Code
0.4
\end_layout

\begin_layout LyX-Code
1.384
\end_layout

\begin_layout LyX-Code
1.542
\end_layout

\begin_layout LyX-Code
1.742
\end_layout

\begin_layout LyX-Code
0.7336
\end_layout

\begin_layout LyX-Code
0.6536
\end_layout

\begin_layout LyX-Code
1.038
\end_layout

\begin_layout LyX-Code
1.334
\end_layout

\begin_layout LyX-Code
1.798
\end_layout

\begin_layout LyX-Code
-------
\end_layout

\end_deeper
\begin_layout LyX-Code

\series bold
Mean 1.181 ms
\end_layout

\begin_layout LyX-Code

\series bold
SD   0.5000
\end_layout

\begin_layout Standard
A capture of the 10th firing run is shown In Figure 
\begin_inset CommandInset ref
LatexCommand vref
reference "fig:Synchronized-Firing"

\end_inset

 Trace 1 = Node 4 channel 0 firing, Trace 2 Node 5 and Trace 3 Node 6
\end_layout

\begin_layout LyX-Code
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/TEK00003.PNG
	scale 50

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Synchronized-Firing"

\end_inset

Synchronized Firing
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Paragraph
VERSION
\begin_inset Index
status open

\begin_layout Plain Layout
VERSION
\end_layout

\end_inset

 of Node code
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000
V Query node code creation date
\end_layout

\begin_layout Standard
This message is used to get the creation date of the code running in a node.
 The message returned is a string of the compiler constants __DATE__ and
 __TIME__ which shows the creation date of the code.
 This is ment to be human interperted and not machine used.
\end_layout

\begin_layout Paragraph
CHANNEL
\begin_inset Index
status open

\begin_layout Plain Layout
CHANNEL
\end_layout

\end_inset

 information
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000
C Query for channel information
\end_layout

\begin_layout Standard
This message is used to inquire about a particular firing channel.
 The return message contains the fired status (0/1) and the A/D reading
 of that channel.
\end_layout

\begin_layout Standard
RC<Fire Status 0-1><A/D Value 0-1024>
\end_layout

\begin_layout Paragraph
TEST MODE
\begin_inset Index
status open

\begin_layout Plain Layout
TEST MODE
\end_layout

\end_inset

 Command
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000
M Turn test mode ON (1) OFF (0)
\end_layout

\begin_layout Standard
This message is designed to enable and disable test mode.
 When the Node is placed in test mode can be used to simulate firing a show
 without having any ignitors attached to the firing channels and will return
 status to the command node as if all channels had ignitors connected.
 It will also show the ignitor going open on a Fire command.
 This allows a system test without using any of the one time use ignitors.
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="4">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Message
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Response Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Meaning
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Enable Test mode
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
M1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RM0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Returns current test mode status
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Get Test mode status
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
M
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RM1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Returns current test mode status
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
NOTE: That after the command is sent the node's test mode will NOT change
 till it has been restarted.
 (See 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:RESTART-Command"

\end_inset

)
\end_layout

\begin_layout Standard
In addition in this mode the Version message will be returned with an X
 in the data.
\end_layout

\begin_layout Standard
Instead of:
\end_layout

\begin_layout LyX-Code
RVMar 6 2011 16-23-19
\end_layout

\begin_layout Standard
you get
\end_layout

\begin_layout LyX-Code
RVXMar 6 2011 16-23-19
\end_layout

\begin_layout LyX-Code

\end_layout

\begin_layout Paragraph
BACKOFF
\begin_inset Index
status open

\begin_layout Plain Layout
BACKOFF
\end_layout

\end_inset

 Command
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000
B Modify backoff time
\end_layout

\begin_layout Standard
This message is used to change the timing of response messages to a broadcast
 message.
 Each node calculates when it will send its response with the forumula:
\end_layout

\begin_layout LyX-Code
wait = (node addr - 1) * backoff time
\end_layout

\begin_layout Standard
Thus node 1 would wait 0 ms, node 2 would wait one backoff time and so on.
 This command is used to set the backoff time in ms.
 The number following the command (0-255) is stored and used as the new
 back off time.
 This allows tuning for differing networks.
\end_layout

\begin_layout LyX-Code
B50 Set backoff time to 50 ms
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000
\begin_inset Tabular
<lyxtabular version="3" rows="3" columns="4">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Message
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Response Data
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Meaning
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Set backoff to 50 ms
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
B50
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RB30
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Returns current backoff time
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Get backoff time
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
B
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
RB30
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Returns current backoff time
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
NOTE: That after the command is sent the node's backoff time will NOT change
 till it has been restarted.
 (See 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:RESTART-Command"

\end_inset

)
\end_layout

\begin_layout Paragraph
RESTART
\begin_inset Index
status open

\begin_layout Plain Layout
RESTART
\end_layout

\end_inset

 Command
\begin_inset CommandInset label
LatexCommand label
name "par:RESTART-Command"

\end_inset


\end_layout

\begin_layout List
\labelwidthstring 00.00.0000
X Restart node software
\end_layout

\begin_layout Standard
A number of commands like BACKOFF, TEST and TIME reset parameters in EEPROM
 but those don't immediately take effect.
 They only work after the node has been restarted.
 This command is used to do that without cycling power.
\end_layout

\begin_layout Paragraph
REQUEST
\begin_inset Index
status open

\begin_layout Plain Layout
REQUEST
\end_layout

\end_inset

 Data Command
\end_layout

\begin_layout List
\labelwidthstring 00.00.0000
RF Request firing data
\end_layout

\begin_layout Standard
This command is used to extract data from a node.
 At present there is only one request, return the firing times after a run
 but further commands will be added.
\end_layout

\begin_layout Standard

\series bold
RF
\series default
 The response will be the firing times of all 6 channels as decimal numbers
 separated by a space.
\end_layout

\begin_layout Section
Firenet Hardware
\end_layout

\begin_layout Subsection
Introduction
\end_layout

\begin_layout Standard
The Firenet system has two main parts, the controller a standard computer
 running the Firenet program and a number of Firenet nodes which actually
 fire the pieces.
 The Firenet node is a small computer system with 6 firing circuits and
 a network connection.
 The system will look like this.
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/nodes.eps
	scale 60

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Firenet System
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Standard
The Firenet Interface is a USB <-> RS485 interface that allows the Notebook
 onto the Firenet network.
 
\end_layout

\begin_layout Standard
This shows the nodes connected in a daisy-chained network with the laptop.
 Each node is connected to up to 6 firework pieces and can fire them.
 They are also connected to a large 12V battery that supplies the firing
 current and power for the nodes.
\end_layout

\begin_layout Subsection
Node Electronics
\end_layout

\begin_layout Standard
Each node will have a processor running the Arduino kernel and then running
 a custom program that will execute the Firenet commands.
 The network as shown in Section 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Physical-Layer"

\end_inset

 is an RS-485 two wire system.
 The interconnect between each node is a stereo audio cable.
 The in and out connections on each node are a standard audio jack.
 The schematic for the node is:
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/firenet.png
	scale 50

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Node Schematic
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Subsubsection
Power Supply
\end_layout

\begin_layout Standard
The power supply uses two regulators.
 One supplies 5V for the logic and processor circuits and the second is
 a 1 Amp constant current supply (IC5) to supply the firing current.
 In front of the regulators is a full wave bridge, a fuse and a 15 V Zener
 diode.
 These are a protection circuit, to make the wiring of the system simple
 and inexpensive we are using standard 120 outlet strips and 120 V plugs
 to distribute the 12 V battery power.
 These connectors are very inexpensive and readily available.
 Also we can use standard 16 Gauge lamp cord for the power leads to the
 nodes.
 But with standard plugs on the ends of these wires there are two problems:
\end_layout

\begin_layout Enumerate
The plugs are not polarized.
\end_layout

\begin_layout Enumerate
They could be plugged into a 120 V circuit.
\end_layout

\begin_layout Standard
The full wave bridge on the front end solves problem (1) since it will always
 supply the correct polarity no matter which way the plug is inserted.
 The second problem is handled by the Zener diode and fuse.
 The full wave bridge is rated for 120 V so it could handle the high voltage.
 But the Zener conducts at 15 Volts and would short the high voltage to
 ground which would blow the fuse and protect the rest of the circuit.
\end_layout

\begin_layout Subsubsection
Network 
\end_layout

\begin_layout Standard
The network hardware is ISL8483 RS-485 chip.
 The transmit and receive lines are brought out to pads where they will
 be connected to two stereo phone jacks (one in and the other out).
 The network will be like that show in Section 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Physical-Layer"

\end_inset

 .
 RS-485 networks require 120 ohm termination resistors at each end of the
 network.
 The control computer interface has one built in and the user will be responsibl
e for putting a 120 ohm resistor plug in the last box on the daisy chain.
\end_layout

\begin_layout Subsubsection
Network Interface
\end_layout

\begin_layout Standard
The control computer is attached to the Firenet network by a USB serial
 interface.
 This uses an interface chip to convert the serial data from the USB chip
 to RS-485 balanced output.
 One problem that arose is this is a half-duplex system where one node transmits
 at a time.
 The interface chip must be switched to TRANSMIT mode while the message
 is being sent.
 On the control computer (UNIX/LINUX) the serial output data is handled
 via a system driver.
 The TRANSMIT control line was the DTR line in the serial interface.
 It was found that the DTR ON/OFF signal was very deterministic and would
 occur at the exact line of code where it was called.
 Unfortunately this was NOT the case with the serial data.
 It went into the driver and when exactly it came out was highly dependent
 on the OS system loading and other factors.
 So to make the XMIT control ON/OFF properly overlap the actual data the
 code had to:
\end_layout

\begin_layout Itemize
Turn on DTR
\end_layout

\begin_layout Itemize
Delay a bit (5 ms)
\end_layout

\begin_layout Itemize
Send the data
\end_layout

\begin_layout Itemize
Delay a bit more (and make the delay longer on longer messages)
\end_layout

\begin_layout Itemize
Turn off DTR to close the transmit.
\end_layout

\begin_layout Standard
This would work about 90% of the time but occasionally the control program
 would be swapped out or something and the disable of the XMIT would be
 very very late.
 Then the control computer's transmit would be enabled while a node was
 trying to reply.
 This greatly affected actions where there was a lot of message between
 the control computer and nodes (like programming a show).
 
\end_layout

\begin_layout Standard
The solution was to put control of the TRANSMIT ON/OFF in the network interface.
 The board used in the interface is a modified node board so instead of
 just the interface chip the Atmel processor was added also.
 With software that detects the start and end of transmitted packets it
 can exactly control the TRANSMIT line like this:
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/TEK00011.PNG
	scale 50

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Control computer transmission
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
The blue line at the top is the transmitter control signal, the the two
 waveforms are the RS485 signal and compliment signals.
\end_layout

\begin_layout Standard
The Arduino has a library the gives an additional serial port implimented
 in software.
 The only disadvantage is that it cannot run at high speeds so the Firenet
 network is now limited to 9,600 baud.
 
\end_layout

\begin_layout Standard
The only change in the control program is that it no longer switches DTR
 when it transmitts a packet, all that is handled in the network interface.
\end_layout

\begin_layout Subsubsection
Firing Circuit
\end_layout

\begin_layout Standard
The firing circuit includes the 1 Amp constant current regulator, a relay
 and 6 FET drivers.
 IC5 (7812) is wired to produce 1 Amp output for loads down to 0 ohms.
 This current is switched by a relay (RLY1) so the firing circuits are OFF
 except when needed.
 The 6 FETs (QF0-QF5) are wired as simple switches so when the processor
 makes the gate high the FET goes to low resistance.
 The Fireworks ignitor is wired between the CC supply and the FET drain
 so up to 1 A flows firing the piece.
 The resistor divider off the drain is used to feed the voltage value present
 on the drain to the processor A/D.
 If the transistor is OFF this will be the full voltage of the battery.
 The approximately 3:1 divider will give about 4 volts out which the A/D
 can handle.
 This will show which circuits have unfired ignitors and can be used to
 control firing time when the circuit fires an ignitor.
\end_layout

\begin_layout Paragraph
Adpative firing 
\end_layout

\begin_layout Standard
Since the circuit can both fire the ignitor and check it's continunity we
 can set up the software to do adaptive firing.
 Ignitors can vary from lot to lot and from different manufacturers.
 It's simpler to have the software adapt than have the user have to change
 firing times.
 (See 
\begin_inset CommandInset ref
LatexCommand vref
reference "par:TIME-Command"

\end_inset

).
 The firing time can now be set to a maximum that will guarantee that ANYTHING
 will be fired.
 We them monitor the continuity during the firing and turn off the firing
 channel when the ignitor blows.
 
\end_layout

\begin_layout Standard
We cannot measure the continuity while the FET firing transistor is ON so
 while the ignitor is being fired the transitor is switched off for a milisecond.
 The software reads the A/D for that channel and if the ignitor is blown
 it will show a low voltage since the ignitor binding post is no longer
 connected to the firing voltage (HOT1/HOT2).
 If the ignitor is not blow there will be a connection and the A/D will
 read a high voltage.
 Thus as soon as the ignitor is blown we can cut off the FET firing transitor
 and stand down from the firing state.
\end_layout

\begin_layout Standard
There are some considerations for this testing, it should be often enough
 to stop the firing reasonable early.
 That is if the max firing time is 3000 ms testing at 2000 ms intervals
 wouldn't be too useful in ending early.
 On the otherhand testing too often at say 1 ms intervals would not let
 the ignitor heat up as we would be turning off the firing FET at very frequent
 intervals.
 So testing was done to try to determine some reasonable values, testing
 at 100 ms intervals seems to be a good balance between ending early and
 not heating the ignitor enough.
\end_layout

\begin_layout Subsubsection
Processor
\end_layout

\begin_layout Standard
The processor circuit is largely copied from the Arduino board.
 The serial, reset and power leads are brough to a header which fits the
 SparcFun Serial <-> USB board.
 This can be used to talk to the board for testing.
 Also two jumpers are added to allow the USB board to power the board and
 control the network chip JP2,JP3).
 This modified board is used as the control computer interface to the network.
 
\end_layout

\begin_layout Subsection
Node Hardware
\end_layout

\begin_layout Subsubsection
Enclosure
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/node.eps
	scale 40

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Node Layout
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
The node hardware was built into a 4.6
\begin_inset Quotes erd
\end_inset

 square box 2.65
\begin_inset Quotes erd
\end_inset

 high (Polycase DC44C).
 The circuit board was designed so the binding posts used for the ignitor
 connections also bolt the board to the top of the box.
 
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/node_outside.gif
	display false
	scale 25

\end_inset


\end_layout

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Caption

\begin_layout Plain Layout
Node Exterior 
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
The network connections are stereo phone jacks, one in and one out.
 The are electrically identical so either can be used as in or out.
 The Power/Status LED is a single color RED led that comes on when the processor
 is ready and will blink when the node is armed and ready to fire.
 The 6 black binding posts are the 6 firing channels, you would connect
 an ignitor to one of these and the other end to the RED V (or power post).
 Finally the power lead is a standard 16 gauge 2 wire lamp cord leading
 to a regular 120V two wire plug.
 As explained above this is a cost saving measure to allow the use of regular
 120 power cords and extension strips to distribute the 12 battery power.
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/node_inside.gif
	display false
	scale 25

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Node Interior
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
When placed in the box the back of the board is next to the lid of the box
 (see above) and thus all the parts are facing down into the box.
 This is handy taking the lid off the box exposes all the circuit and parts
 for easy debugging.
 As shown a Sparkfun 5V FTDI BASIC USB <-> Serial is connected to the board
 and this allows it to be programmed via the Arduino IDE.
\end_layout

\begin_layout Subsubsection
Printed Circuit board
\end_layout

\begin_layout Standard
The printed circuit board was designed using Eagle CAD from the schematic
 shown above.
 Large pads were used as the bolting points for the binding posts used as
 the ignitor connectors.
 
\end_layout

\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\noindent
\align center
\begin_inset Graphics
	filename Images/Firenet_board.png
	scale 50

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Firenet PC board
\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset CommandInset index_print
LatexCommand printindex

\end_inset


\end_layout

\begin_layout Standard
\begin_inset CommandInset bibtex
LatexCommand bibtex
bibfiles "firenet"
options "plain"

\end_inset


\end_layout

\end_body
\end_document
