Files
lighthub/docs/html/streamlog_8h_source.html
2022-01-06 02:01:16 +03:00

171 lines
17 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LightHub: streamlog.h Source File</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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.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>
<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="projectlogo"><img alt="Logo" src="lh.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">LightHub
&#160;<span id="projectnumber">v4.0.0</span>
</div>
<div id="projectbrief">Smarthome controller firmware</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('streamlog_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- 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 class="header">
<div class="headertitle">
<div class="title">streamlog.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="streamlog_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="preprocessor">#include &lt;Print.h&gt;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="preprocessor">#include &lt;Arduino.h&gt;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="preprocessor">#include &lt;HardwareSerial.h&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="preprocessor">#include &lt;inttypes.h&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#if defined (STM32)</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="preprocessor">#include &lt;USBSerial.h&gt;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="preprocessor">#ifndef LOGBUFFER_SIZE</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="streamlog_8h.html#a2e75de3d470df65326791691c3039c70"> 12</a></span>&#160;<span class="preprocessor">#define LOGBUFFER_SIZE 80</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160; </div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="preprocessor">#ifdef SYSLOG_ENABLE</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="preprocessor">#include &lt;Syslog.h&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="keyword">extern</span> uint8_t <a class="code" href="streamlog_8h.html#a28a478cd6130b2e1aa726dd789aaf309">serialDebugLevel</a>;</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="keyword">extern</span> uint8_t <a class="code" href="streamlog_8h.html#aef9fa4d03bb6207d9cd46e647f575cd2">udpDebugLevel</a>;</div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#ifndef SerialPortType</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="streamlog_8h.html#ace67e7b92ea9c2ca0cf0cc6c201ccbc2"> 24</a></span>&#160;<span class="preprocessor">#define SerialPortType HardwareSerial</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="streamlog_8h.html#a6ff63e8955665c4a58b1598f2b07c51a"> 27</a></span>&#160;<span class="preprocessor">#define LOG_DEBUG 7</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="streamlog_8h.html#aeb4f36db01bd128c7afeac5889dac311"> 28</a></span>&#160;<span class="preprocessor">#define LOG_INFO 6</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="streamlog_8h.html#aced66975c154ea0e2a8ec3bc818b4e08"> 29</a></span>&#160;<span class="preprocessor">#define LOG_ERROR 3</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="class_streamlog.html"> 31</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_streamlog.html">Streamlog</a> : <span class="keyword">public</span> Print</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;{</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor"> #ifdef SYSLOG_ENABLE</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <a class="code" href="class_streamlog.html#aa3d6de674a30268eeb1c3fcc45e9bd47">Streamlog</a> (<a class="code" href="streamlog_8h.html#ace67e7b92ea9c2ca0cf0cc6c201ccbc2">SerialPortType</a> * _serialPort, uint8_t _severity = <a class="code" href="streamlog_8h.html#a6ff63e8955665c4a58b1598f2b07c51a">LOG_DEBUG</a>, Syslog * _syslog = NULL, uint8_t _ledPattern = 0);</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor"> #else</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <a class="code" href="class_streamlog.html#aa3d6de674a30268eeb1c3fcc45e9bd47">Streamlog</a> (<a class="code" href="streamlog_8h.html#ace67e7b92ea9c2ca0cf0cc6c201ccbc2">SerialPortType</a> * _serialPort, uint8_t _severity = <a class="code" href="streamlog_8h.html#a6ff63e8955665c4a58b1598f2b07c51a">LOG_DEBUG</a>, uint8_t _ledPattern = 0);</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor"> #endif</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_streamlog.html#ab9c1022fccf6b585b738f30f8577d613">begin</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> speed);</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_streamlog.html#ace6e3e265ae590b7f3b14b926bc3e60b">end</a>() ;</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keywordtype">int</span> <a class="code" href="class_streamlog.html#ae7a165675188ecb1bf305b025efbf47b">available</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keywordtype">int</span> <a class="code" href="class_streamlog.html#a246066803cd501ca4f1f5c94823db0e0">peek</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keywordtype">int</span> <a class="code" href="class_streamlog.html#acbea1e8e890180c66757bd7647703d54">read</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_streamlog.html#aec3522140e0c8f95039e62747f841987">flush</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="class_streamlog.html#a944486d544c3677410e1505b9cd6858b">write</a>(uint8_t ch);</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keyword">using</span> Print::write; <span class="comment">// pull in write(str) and write(buf, size) from Print</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="class_streamlog.html#adcd1dcab71fd1e1c9da5bc9c18ac3d1d"> 48</a></span>&#160; <span class="keyword">operator</span> bool() {<span class="keywordflow">return</span> <span class="keyword">true</span>;};</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; uint8_t severity;</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <a class="code" href="streamlog_8h.html#ace67e7b92ea9c2ca0cf0cc6c201ccbc2">SerialPortType</a> *serialPort;</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; uint8_t ledPattern;</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="preprocessor"> #ifdef SYSLOG_ENABLE</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; Syslog * syslog;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="preprocessor"> #endif</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;};</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="astreamlog_8h_html_aef9fa4d03bb6207d9cd46e647f575cd2"><div class="ttname"><a href="streamlog_8h.html#aef9fa4d03bb6207d9cd46e647f575cd2">udpDebugLevel</a></div><div class="ttdeci">uint8_t udpDebugLevel</div><div class="ttdef"><b>Definition:</b> streamlog.cpp:11</div></div>
<div class="ttc" id="aclass_streamlog_html_ace6e3e265ae590b7f3b14b926bc3e60b"><div class="ttname"><a href="class_streamlog.html#ace6e3e265ae590b7f3b14b926bc3e60b">Streamlog::end</a></div><div class="ttdeci">void end()</div><div class="ttdef"><b>Definition:</b> streamlog.cpp:39</div></div>
<div class="ttc" id="aclass_streamlog_html_ae7a165675188ecb1bf305b025efbf47b"><div class="ttname"><a href="class_streamlog.html#ae7a165675188ecb1bf305b025efbf47b">Streamlog::available</a></div><div class="ttdeci">int available(void)</div><div class="ttdef"><b>Definition:</b> streamlog.cpp:44</div></div>
<div class="ttc" id="aclass_streamlog_html_aa3d6de674a30268eeb1c3fcc45e9bd47"><div class="ttname"><a href="class_streamlog.html#aa3d6de674a30268eeb1c3fcc45e9bd47">Streamlog::Streamlog</a></div><div class="ttdeci">Streamlog(SerialPortType *_serialPort, uint8_t _severity=LOG_DEBUG, uint8_t _ledPattern=0)</div><div class="ttdef"><b>Definition:</b> streamlog.cpp:27</div></div>
<div class="ttc" id="aclass_streamlog_html_a944486d544c3677410e1505b9cd6858b"><div class="ttname"><a href="class_streamlog.html#a944486d544c3677410e1505b9cd6858b">Streamlog::write</a></div><div class="ttdeci">size_t write(uint8_t ch)</div><div class="ttdef"><b>Definition:</b> streamlog.cpp:69</div></div>
<div class="ttc" id="astreamlog_8h_html_ace67e7b92ea9c2ca0cf0cc6c201ccbc2"><div class="ttname"><a href="streamlog_8h.html#ace67e7b92ea9c2ca0cf0cc6c201ccbc2">SerialPortType</a></div><div class="ttdeci">#define SerialPortType</div><div class="ttdef"><b>Definition:</b> streamlog.h:24</div></div>
<div class="ttc" id="aclass_streamlog_html_aec3522140e0c8f95039e62747f841987"><div class="ttname"><a href="class_streamlog.html#aec3522140e0c8f95039e62747f841987">Streamlog::flush</a></div><div class="ttdeci">void flush(void)</div><div class="ttdef"><b>Definition:</b> streamlog.cpp:63</div></div>
<div class="ttc" id="aclass_streamlog_html_a246066803cd501ca4f1f5c94823db0e0"><div class="ttname"><a href="class_streamlog.html#a246066803cd501ca4f1f5c94823db0e0">Streamlog::peek</a></div><div class="ttdeci">int peek(void)</div><div class="ttdef"><b>Definition:</b> streamlog.cpp:50</div></div>
<div class="ttc" id="aclass_streamlog_html_ab9c1022fccf6b585b738f30f8577d613"><div class="ttname"><a href="class_streamlog.html#ab9c1022fccf6b585b738f30f8577d613">Streamlog::begin</a></div><div class="ttdeci">void begin(unsigned long speed)</div><div class="ttdef"><b>Definition:</b> streamlog.cpp:34</div></div>
<div class="ttc" id="aclass_streamlog_html"><div class="ttname"><a href="class_streamlog.html">Streamlog</a></div><div class="ttdef"><b>Definition:</b> streamlog.h:32</div></div>
<div class="ttc" id="aclass_streamlog_html_acbea1e8e890180c66757bd7647703d54"><div class="ttname"><a href="class_streamlog.html#acbea1e8e890180c66757bd7647703d54">Streamlog::read</a></div><div class="ttdeci">int read(void)</div><div class="ttdef"><b>Definition:</b> streamlog.cpp:56</div></div>
<div class="ttc" id="astreamlog_8h_html_a28a478cd6130b2e1aa726dd789aaf309"><div class="ttname"><a href="streamlog_8h.html#a28a478cd6130b2e1aa726dd789aaf309">serialDebugLevel</a></div><div class="ttdeci">uint8_t serialDebugLevel</div><div class="ttdef"><b>Definition:</b> streamlog.cpp:10</div></div>
<div class="ttc" id="astreamlog_8h_html_a6ff63e8955665c4a58b1598f2b07c51a"><div class="ttname"><a href="streamlog_8h.html#a6ff63e8955665c4a58b1598f2b07c51a">LOG_DEBUG</a></div><div class="ttdeci">#define LOG_DEBUG</div><div class="ttdef"><b>Definition:</b> streamlog.h:27</div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="streamlog_8h.html">streamlog.h</a></li>
<li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
</ul>
</div>
</body>
</html>