123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.8.10"/>
- <title>CoffeePi: main.cpp File Reference</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <script type="text/javascript">
- $(document).ready(function() { init_search(); });
- </script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">CoffeePi
- </div>
- <div id="projectbrief">Coffee machine control for Raspberry Pi</div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.10 -->
- <script type="text/javascript">
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- </script>
- <div id="navrow1" class="tabs">
- <ul class="tablist">
- <li><a href="index.html"><span>Main Page</span></a></li>
- <li><a href="annotated.html"><span>Data Structures</span></a></li>
- <li class="current"><a href="files.html"><span>Files</span></a></li>
- <li>
- <div id="MSearchBox" class="MSearchBoxInactive">
- <span class="left">
- <img id="MSearchSelect" src="search/mag_sel.png"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- alt=""/>
- <input type="text" id="MSearchField" value="Search" accesskey="S"
- onfocus="searchBox.OnSearchFieldFocus(true)"
- onblur="searchBox.OnSearchFieldFocus(false)"
- onkeyup="searchBox.OnSearchFieldChange(event)"/>
- </span><span class="right">
- <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
- </span>
- </div>
- </li>
- </ul>
- </div>
- <div id="navrow2" class="tabs2">
- <ul class="tablist">
- <li><a href="files.html"><span>File List</span></a></li>
- <li><a href="globals.html"><span>Globals</span></a></li>
- </ul>
- </div>
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- </div><!-- top -->
- <div class="header">
- <div class="summary">
- <a href="#func-members">Functions</a> |
- <a href="#var-members">Variables</a> </div>
- <div class="headertitle">
- <div class="title">main.cpp File Reference</div> </div>
- </div><!--header-->
- <div class="contents">
- <div class="textblock"><code>#include <stdio.h></code><br />
- <code>#include <stdlib.h></code><br />
- <code>#include <string.h></code><br />
- <code>#include <errno.h></code><br />
- <code>#include <stdint.h></code><br />
- <code>#include <wiringPi.h></code><br />
- <code>#include <pthread.h></code><br />
- <code>#include <unistd.h></code><br />
- <code>#include <iostream></code><br />
- <code>#include <csignal></code><br />
- <code>#include "<a class="el" href="global_8h_source.html">global.h</a>"</code><br />
- <code>#include "<a class="el" href="timer_8h_source.html">timer.h</a>"</code><br />
- <code>#include "<a class="el" href="database_8h_source.html">database.h</a>"</code><br />
- <code>#include "<a class="el" href="logger_8h_source.html">logger.h</a>"</code><br />
- <code>#include "<a class="el" href="lcd_8h_source.html">lcd.h</a>"</code><br />
- <code>#include "<a class="el" href="hal_8h_source.html">hal.h</a>"</code><br />
- <code>#include "<a class="el" href="stripe_8h_source.html">stripe.h</a>"</code><br />
- <code>#include "<a class="el" href="coffee_8h_source.html">coffee.h</a>"</code><br />
- <code>#include "<a class="el" href="display_8h_source.html">display.h</a>"</code><br />
- <code>#include "buildno"</code><br />
- </div><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
- Functions</h2></td></tr>
- <tr class="memitem:a9a66b873229b4d46cb9f39dddfc1bddb"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a9a66b873229b4d46cb9f39dddfc1bddb">mainLoop</a> (void *threadid)</td></tr>
- <tr class="memdesc:a9a66b873229b4d46cb9f39dddfc1bddb"><td class="mdescLeft"> </td><td class="mdescRight">Main Thread, used for some initializations and error detection. <a href="#a9a66b873229b4d46cb9f39dddfc1bddb">More...</a><br /></td></tr>
- <tr class="separator:a9a66b873229b4d46cb9f39dddfc1bddb"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:acd303e48c6d5b8d8bbf55db887f1e7e8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#acd303e48c6d5b8d8bbf55db887f1e7e8">terminationHandler</a> (int signum)</td></tr>
- <tr class="memdesc:acd303e48c6d5b8d8bbf55db887f1e7e8"><td class="mdescLeft"> </td><td class="mdescRight">Handler for program termination caught via signal. <a href="#acd303e48c6d5b8d8bbf55db887f1e7e8">More...</a><br /></td></tr>
- <tr class="separator:acd303e48c6d5b8d8bbf55db887f1e7e8"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a6b9ec8ce27cbec14222dfd2db55e8bad"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a6b9ec8ce27cbec14222dfd2db55e8bad">usr1Handler</a> (int signum)</td></tr>
- <tr class="memdesc:a6b9ec8ce27cbec14222dfd2db55e8bad"><td class="mdescLeft"> </td><td class="mdescRight">Handles the signal USR2. <a href="#a6b9ec8ce27cbec14222dfd2db55e8bad">More...</a><br /></td></tr>
- <tr class="separator:a6b9ec8ce27cbec14222dfd2db55e8bad"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:aa5f8eab61a77d6d566215bcf12144422"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#aa5f8eab61a77d6d566215bcf12144422">hupHandler</a> (int signum)</td></tr>
- <tr class="memdesc:aa5f8eab61a77d6d566215bcf12144422"><td class="mdescLeft"> </td><td class="mdescRight">Handles the signal HUP and starts a speed test. <a href="#aa5f8eab61a77d6d566215bcf12144422">More...</a><br /></td></tr>
- <tr class="separator:aa5f8eab61a77d6d566215bcf12144422"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a0ddf1224851353fc92bfbff6f499fa97"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97">main</a> (int argc, char *argv[])</td></tr>
- <tr class="separator:a0ddf1224851353fc92bfbff6f499fa97"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ab6e46b0071bb3330546b7f2b601d0a6c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#ab6e46b0071bb3330546b7f2b601d0a6c">killThread</a> (int threadid, int sig)</td></tr>
- <tr class="memdesc:ab6e46b0071bb3330546b7f2b601d0a6c"><td class="mdescLeft"> </td><td class="mdescRight">Sends a signal to a thread. <a href="#ab6e46b0071bb3330546b7f2b601d0a6c">More...</a><br /></td></tr>
- <tr class="separator:ab6e46b0071bb3330546b7f2b601d0a6c"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
- Variables</h2></td></tr>
- <tr class="memitem:ac70430026dcf56f46e5426e1d01d7e89"><td class="memItemLeft" align="right" valign="top">const int </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#ac70430026dcf56f46e5426e1d01d7e89">buildno</a></td></tr>
- <tr class="separator:ac70430026dcf56f46e5426e1d01d7e89"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a0b2caeb4b6f130be43e5a2f0267dd453"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a0b2caeb4b6f130be43e5a2f0267dd453">verbose</a> = 0</td></tr>
- <tr class="separator:a0b2caeb4b6f130be43e5a2f0267dd453"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ae88c926fe2a10f736eb01b1d1e899a1c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#ae88c926fe2a10f736eb01b1d1e899a1c">optDate</a> = false</td></tr>
- <tr class="separator:ae88c926fe2a10f736eb01b1d1e899a1c"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a7bfeade3d2f19e8baecdcddd7f9162fa"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a7bfeade3d2f19e8baecdcddd7f9162fa">optPower</a> = false</td></tr>
- <tr class="separator:a7bfeade3d2f19e8baecdcddd7f9162fa"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a2a24ab7c0142e353c9ce9ca1ee1210bb"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a2a24ab7c0142e353c9ce9ca1ee1210bb">optCold</a> = false</td></tr>
- <tr class="separator:a2a24ab7c0142e353c9ce9ca1ee1210bb"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ad1c21fd320f05c652f120ad167628c14"><td class="memItemLeft" align="right" valign="top">pthread_t </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#ad1c21fd320f05c652f120ad167628c14">thread</a> [4]</td></tr>
- <tr class="separator:ad1c21fd320f05c652f120ad167628c14"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a4acff8232e4aec9cd5c6dc200ac55ef3"><td class="memItemLeft" align="right" valign="top">pthread_mutex_t </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a></td></tr>
- <tr class="separator:a4acff8232e4aec9cd5c6dc200ac55ef3"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <h2 class="groupheader">Function Documentation</h2>
- <a class="anchor" id="aa5f8eab61a77d6d566215bcf12144422"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void hupHandler </td>
- <td>(</td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>signum</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Handles the signal HUP and starts a speed test. </p>
- </div>
- </div>
- <a class="anchor" id="ab6e46b0071bb3330546b7f2b601d0a6c"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void killThread </td>
- <td>(</td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>threadid</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>sig</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Sends a signal to a thread. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">threadid</td><td>ID of the thread </td></tr>
- <tr><td class="paramname">sig</td><td>Signal to send </td></tr>
- </table>
- </dd>
- </dl>
- </div>
- </div>
- <a class="anchor" id="a0ddf1224851353fc92bfbff6f499fa97"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int main </td>
- <td>(</td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>argc</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">char * </td>
- <td class="paramname"><em>argv</em>[] </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- </div>
- </div>
- <a class="anchor" id="a9a66b873229b4d46cb9f39dddfc1bddb"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void * mainLoop </td>
- <td>(</td>
- <td class="paramtype">void * </td>
- <td class="paramname"><em>threadid</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Main Thread, used for some initializations and error detection. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">threadid</td><td>Thread ID </td></tr>
- </table>
- </dd>
- </dl>
- </div>
- </div>
- <a class="anchor" id="acd303e48c6d5b8d8bbf55db887f1e7e8"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void terminationHandler </td>
- <td>(</td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>signum</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Handler for program termination caught via signal. </p>
- </div>
- </div>
- <a class="anchor" id="a6b9ec8ce27cbec14222dfd2db55e8bad"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void usr1Handler </td>
- <td>(</td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>signum</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Handles the signal USR2. </p>
- </div>
- </div>
- <h2 class="groupheader">Variable Documentation</h2>
- <a class="anchor" id="ac70430026dcf56f46e5426e1d01d7e89"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">const int buildno</td>
- </tr>
- </table>
- </div><div class="memdoc">
- <b>Initial value:</b><div class="fragment"><div class="line">= (1+(int)(</div>
- <div class="line"># 29 <span class="stringliteral">"/home/sebastian/CoffeePi/CoffeeCode/main.cpp"</span> 2</div>
- <div class="line"> ))</div>
- </div><!-- fragment -->
- </div>
- </div>
- <a class="anchor" id="a4acff8232e4aec9cd5c6dc200ac55ef3"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">pthread_mutex_t mutex</td>
- </tr>
- </table>
- </div><div class="memdoc">
- </div>
- </div>
- <a class="anchor" id="a2a24ab7c0142e353c9ce9ca1ee1210bb"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">bool optCold = false</td>
- </tr>
- </table>
- </div><div class="memdoc">
- </div>
- </div>
- <a class="anchor" id="ae88c926fe2a10f736eb01b1d1e899a1c"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">bool optDate = false</td>
- </tr>
- </table>
- </div><div class="memdoc">
- </div>
- </div>
- <a class="anchor" id="a7bfeade3d2f19e8baecdcddd7f9162fa"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">bool optPower = false</td>
- </tr>
- </table>
- </div><div class="memdoc">
- </div>
- </div>
- <a class="anchor" id="ad1c21fd320f05c652f120ad167628c14"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">pthread_t thread[4]</td>
- </tr>
- </table>
- </div><div class="memdoc">
- </div>
- </div>
- <a class="anchor" id="a0b2caeb4b6f130be43e5a2f0267dd453"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int verbose = 0</td>
- </tr>
- </table>
- </div><div class="memdoc">
- </div>
- </div>
- </div><!-- contents -->
- <!-- start footer part -->
- <hr class="footer"/><address class="footer"><small>
- Generated by  <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/>
- </a> 1.8.10
- </small></address>
- </body>
- </html>
|