Weather station with ModBus over RS-485
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

127 lines
24 KiB

<!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.11"/>
<title>modbus-arduino: ModbusSerial.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>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</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="projectlogo"><img alt="Logo" src="modbus.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">modbus-arduino
&#160;<span id="projectnumber">1.0.0</span>
</div>
<div id="projectbrief">Modbus library for Arduino</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<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&#160;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</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><!-- 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">
$(document).ready(function(){initNavTree('ModbusSerial_8h_source.html','');});
</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">ModbusSerial.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> ModbusSerial.h - Header for ModbusSerial Library</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> Copyright (C) 2014 André Sarmento Barbosa</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="preprocessor">#include &lt;Arduino.h&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="preprocessor">#include &lt;Modbus.h&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="preprocessor">#ifndef MODBUSSERIAL_H</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="preprocessor">#define MODBUSSERIAL_H</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="comment">//#define USE_SOFTWARE_SERIAL</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="preprocessor">#ifdef USE_SOFTWARE_SERIAL</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="preprocessor">#include &lt;SoftwareSerial.h&gt;</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="keyword">enum</span> MB_PARITY {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; MB_PARITY_NONE = SERIAL_8N2, </div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; MB_PARITY_EVEN = SERIAL_8E1, </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; MB_PARITY_ODD = SERIAL_8O1 </div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;};</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="classModbusSerial.html"> 54</a></span>&#160;<span class="keyword">class </span><a class="code" href="classModbusSerial.html">ModbusSerial</a> : <span class="keyword">public</span> <a class="code" href="classModbus.html">Modbus</a> {</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="preprocessor">#ifndef __DOXYGEN__</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; Stream* _port;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keywordtype">long</span> _baud;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; byte _format;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordtype">int</span> _txPin;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _t15; <span class="comment">// inter character time out</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _t35; <span class="comment">// frame delay</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; byte _slaveId;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; word calcCrc(byte address, byte* pduframe, byte pdulen);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classModbusSerial.html#a3fb991a7b8d0d9766889e2cad7fca115">receive</a>(byte* frame);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classModbusSerial.html#a69850777f84662664dd17e137250e3b0">sendPDU</a>(byte* pduframe);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classModbusSerial.html#ae7b2f3574d102b26a1de084cb345b6cc">send</a>(byte* frame);</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <a class="code" href="classModbusSerial.html#add48c6a2b436e600865e0cf63ed0aafc">ModbusSerial</a>();</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classModbusSerial.html#aefa9a7f9a910a311bfcd5110a6a8ab71">config</a>(HardwareSerial * port, <span class="keywordtype">long</span> baud, byte parity=MB_PARITY_EVEN, <span class="keywordtype">int</span> txenPin=-1);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="preprocessor">#ifdef __DOXYGEN__</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classModbusSerial.html#aefa9a7f9a910a311bfcd5110a6a8ab71">config</a>(SoftwareSerial* port, <span class="keywordtype">long</span> baud, <span class="keywordtype">int</span> txenPin=-1);</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classModbusSerial.html#aefa9a7f9a910a311bfcd5110a6a8ab71">config</a>(Serial_ * port, <span class="keywordtype">long</span> baud, byte parity=MB_PARITY_EVEN, <span class="keywordtype">int</span> txenPin=-1);</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="preprocessor">#else </span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="preprocessor"> #ifdef USE_SOFTWARE_SERIAL</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classModbusSerial.html#aefa9a7f9a910a311bfcd5110a6a8ab71">config</a>(SoftwareSerial* port, <span class="keywordtype">long</span> baud, <span class="keywordtype">int</span> txenPin=-1);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="preprocessor"> #endif</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="preprocessor"> #ifdef __AVR_ATmega32U4__</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classModbusSerial.html#aefa9a7f9a910a311bfcd5110a6a8ab71">config</a>(Serial_ * port, <span class="keywordtype">long</span> baud, byte parity=MB_PARITY_EVEN, <span class="keywordtype">int</span> txenPin=-1);</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="preprocessor"> #endif</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classModbusSerial.html#ad47e2b6a70d42a106a1a55a515e2f33a">task</a>();</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classModbusSerial.html#a2b727d4d516177e698db6e49729624d8">setSlaveId</a>(byte slaveId);</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; byte <a class="code" href="classModbusSerial.html#adefaff8d3e8f4cfc1d90c9b52d880262">getSlaveId</a>();</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;};</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="preprocessor">#ifndef __DOXYGEN__</span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="comment">/* Table of CRC values for high–order byte */</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="keyword">const</span> byte _auchCRCHi[] = {</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81,</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01,</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; 0x40};</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="comment">/* Table of CRC values for low–order byte */</span></div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;<span class="keyword">const</span> byte _auchCRCLo[] = {</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; 0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06, 0x07, 0xC7, 0x05, 0xC5, 0xC4,</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; 0x04, 0xCC, 0x0C, 0x0D, 0xCD, 0x0F, 0xCF, 0xCE, 0x0E, 0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09,</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; 0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9, 0x1B, 0xDB, 0xDA, 0x1A, 0x1E, 0xDE, 0xDF, 0x1F, 0xDD,</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; 0x1D, 0x1C, 0xDC, 0x14, 0xD4, 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, 0x12, 0x13, 0xD3,</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; 0x11, 0xD1, 0xD0, 0x10, 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3, 0xF2, 0x32, 0x36, 0xF6, 0xF7,</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; 0x37, 0xF5, 0x35, 0x34, 0xF4, 0x3C, 0xFC, 0xFD, 0x3D, 0xFF, 0x3F, 0x3E, 0xFE, 0xFA, 0x3A,</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; 0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38, 0x28, 0xE8, 0xE9, 0x29, 0xEB, 0x2B, 0x2A, 0xEA, 0xEE,</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; 0x2E, 0x2F, 0xEF, 0x2D, 0xED, 0xEC, 0x2C, 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26,</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; 0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, 0xA0, 0x60, 0x61, 0xA1, 0x63, 0xA3, 0xA2,</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; 0x62, 0x66, 0xA6, 0xA7, 0x67, 0xA5, 0x65, 0x64, 0xA4, 0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F,</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; 0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB, 0x69, 0xA9, 0xA8, 0x68, 0x78, 0xB8, 0xB9, 0x79, 0xBB,</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; 0x7B, 0x7A, 0xBA, 0xBE, 0x7E, 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, 0xB4, 0x74, 0x75, 0xB5,</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; 0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, 0x70, 0xB0, 0x50, 0x90, 0x91,</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; 0x51, 0x93, 0x53, 0x52, 0x92, 0x96, 0x56, 0x57, 0x97, 0x55, 0x95, 0x94, 0x54, 0x9C, 0x5C,</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; 0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E, 0x5A, 0x9A, 0x9B, 0x5B, 0x99, 0x59, 0x58, 0x98, 0x88,</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; 0x48, 0x49, 0x89, 0x4B, 0x8B, 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C,</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; 0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83, 0x41, 0x81, 0x80,</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; 0x40};</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;<span class="preprocessor">#endif //MODBUSSERIAL_H</span></div><div class="ttc" id="classModbusSerial_html_aefa9a7f9a910a311bfcd5110a6a8ab71"><div class="ttname"><a href="classModbusSerial.html#aefa9a7f9a910a311bfcd5110a6a8ab71">ModbusSerial::config</a></div><div class="ttdeci">bool config(HardwareSerial *port, long baud, byte parity=MB_PARITY_EVEN, int txenPin=-1)</div><div class="ttdoc">Connect an ModbusSerial object to a hardware serial port. </div></div>
<div class="ttc" id="classModbusSerial_html_ad47e2b6a70d42a106a1a55a515e2f33a"><div class="ttname"><a href="classModbusSerial.html#ad47e2b6a70d42a106a1a55a515e2f33a">ModbusSerial::task</a></div><div class="ttdeci">void task()</div><div class="ttdoc">Task that performs all operations on MODBUS. </div></div>
<div class="ttc" id="classModbusSerial_html_add48c6a2b436e600865e0cf63ed0aafc"><div class="ttname"><a href="classModbusSerial.html#add48c6a2b436e600865e0cf63ed0aafc">ModbusSerial::ModbusSerial</a></div><div class="ttdeci">ModbusSerial()</div><div class="ttdoc">Default constructor. </div></div>
<div class="ttc" id="classModbusSerial_html_ae7b2f3574d102b26a1de084cb345b6cc"><div class="ttname"><a href="classModbusSerial.html#ae7b2f3574d102b26a1de084cb345b6cc">ModbusSerial::send</a></div><div class="ttdeci">bool send(byte *frame)</div></div>
<div class="ttc" id="classModbusSerial_html_a3fb991a7b8d0d9766889e2cad7fca115"><div class="ttname"><a href="classModbusSerial.html#a3fb991a7b8d0d9766889e2cad7fca115">ModbusSerial::receive</a></div><div class="ttdeci">bool receive(byte *frame)</div></div>
<div class="ttc" id="classModbusSerial_html"><div class="ttname"><a href="classModbusSerial.html">ModbusSerial</a></div><div class="ttdoc">Modbus over serial line Class. </div><div class="ttdef"><b>Definition:</b> <a href="ModbusSerial_8h_source.html#l00054">ModbusSerial.h:54</a></div></div>
<div class="ttc" id="classModbus_html"><div class="ttname"><a href="classModbus.html">Modbus</a></div><div class="ttdoc">Modbus base class. </div><div class="ttdef"><b>Definition:</b> <a href="Modbus_8h_source.html#l00053">Modbus.h:53</a></div></div>
<div class="ttc" id="classModbusSerial_html_adefaff8d3e8f4cfc1d90c9b52d880262"><div class="ttname"><a href="classModbusSerial.html#adefaff8d3e8f4cfc1d90c9b52d880262">ModbusSerial::getSlaveId</a></div><div class="ttdeci">byte getSlaveId()</div><div class="ttdoc">Return slave identifier. </div></div>
<div class="ttc" id="classModbusSerial_html_a2b727d4d516177e698db6e49729624d8"><div class="ttname"><a href="classModbusSerial.html#a2b727d4d516177e698db6e49729624d8">ModbusSerial::setSlaveId</a></div><div class="ttdeci">bool setSlaveId(byte slaveId)</div><div class="ttdoc">Change the value of slave identifier. </div></div>
<div class="ttc" id="classModbusSerial_html_a69850777f84662664dd17e137250e3b0"><div class="ttname"><a href="classModbusSerial.html#a69850777f84662664dd17e137250e3b0">ModbusSerial::sendPDU</a></div><div class="ttdeci">bool sendPDU(byte *pduframe)</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_bc0718b08fb2015b8e59c47b2805f60c.html">libraries</a></li><li class="navelem"><a class="el" href="dir_b54e0a2b0f0dd993b2c80a66bde8de0f.html">ModbusSerial</a></li><li class="navelem"><b>ModbusSerial.h</b></li>
<li class="footer">Generated on Fri Jan 19 2018 01:17:49 for modbus-arduino by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
</ul>
</div>
</body>
</html>