Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
01e1f04e3This file is pinned to the selected release. Download the original to open it in your design tool.
<!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" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tRacket Sensor: noisemeter-device/api.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="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 id="projectrow">
<td id="projectalign">
<div id="projectname">tRacket Sensor<span id="projectnumber"> 0.2.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- 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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_640a2e73a782d0e2711002117fcf2017.html">noisemeter-device</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">api.h</div></div>
</div><!--header-->
<div class="contents">
<a href="api_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">/* noisemeter-device - Firmware for CivicTechTO's Noisemeter Device</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> * Copyright (C) 2024 Clyne Sullivan</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"> *</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment"> * This program is free software: you can redistribute it and/or modify</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment"> * (at your option) any later version.</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment"> *</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment"> * GNU General Public License for more details.</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment"> *</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment"> * along with this program. If not, see <https://www.gnu.org/licenses/>.</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment"> */</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#ifndef API_H</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#define API_H</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include "<a class="code" href="data-packet_8h.html">data-packet.h</a>"</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include "<a class="code" href="UUID_8h.html">UUID/UUID.h</a>"</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include <ArduinoJson.h></span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include <WString.h></span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="preprocessor">#include <list></span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#include <optional></span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">class </span>HTTPClient;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="foldopen" id="foldopen00036" data-start="{" data-end="};">
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="classAPI.html"> 36</a></span><span class="keyword">class </span><a class="code hl_class" href="classAPI.html">API</a></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span>{</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classAPI.html#a1ae6751f843fcaaf0f0b93d27d6a1f55"> 39</a></span> <span class="keyword">constexpr</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code hl_variable" href="classAPI.html#a1ae6751f843fcaaf0f0b93d27d6a1f55">Base</a>[] = <span class="stringliteral">"https://api.tracket.info/v1/"</span>;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="foldopen" id="foldopen00042" data-start="{" data-end="};">
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="structAPI_1_1Request.html"> 42</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structAPI_1_1Request.html">Request</a> {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="structAPI_1_1Request.html#add312b1776b4e110e1916c73fb430c86"> 47</a></span> <a class="code hl_function" href="structAPI_1_1Request.html#add312b1776b4e110e1916c73fb430c86">Request</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> endpoint[]);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="structAPI_1_1Request.html#a1ade33dc9bf0717c1bbfcd24a6b17698"> 55</a></span> <a class="code hl_struct" href="structAPI_1_1Request.html">Request</a>& <a class="code hl_function" href="structAPI_1_1Request.html#a1ade33dc9bf0717c1bbfcd24a6b17698">addParam</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> param[], String value);</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="structAPI_1_1Request.html#ac1ed273e77b895150fa098ff2d4e88a1"> 58</a></span> String <a class="code hl_variable" href="structAPI_1_1Request.html#ac1ed273e77b895150fa098ff2d4e88a1">url</a>;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> String params;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> };</div>
</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00064" data-start="{" data-end="};">
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="structAPI_1_1LatestSoftware.html"> 64</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structAPI_1_1LatestSoftware.html">LatestSoftware</a> {</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="structAPI_1_1LatestSoftware.html#acbd0d6cc7032f96b785b1c5af2fa111f"> 66</a></span> String <a class="code hl_variable" href="structAPI_1_1LatestSoftware.html#acbd0d6cc7032f96b785b1c5af2fa111f">version</a>;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="structAPI_1_1LatestSoftware.html#a3d366cba9641a74c44afaf1bb718eeec"> 68</a></span> String <a class="code hl_variable" href="structAPI_1_1LatestSoftware.html#a3d366cba9641a74c44afaf1bb718eeec">url</a>;</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> };</div>
</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
<div class="foldopen" id="foldopen00071" data-start="{" data-end="};">
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="structAPI_1_1DeviceConfig.html"> 71</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structAPI_1_1DeviceConfig.html">DeviceConfig</a> {</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="structAPI_1_1DeviceConfig.html#ad8104b13144c4fc90f0f30b22a24be5b"> 73</a></span> String <a class="code hl_variable" href="structAPI_1_1DeviceConfig.html#ad8104b13144c4fc90f0f30b22a24be5b">timestamp</a>;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="structAPI_1_1DeviceConfig.html#ad9f44d01a43247cb6cac6b581520dc91"> 75</a></span> <span class="keywordtype">int</span> <a class="code hl_variable" href="structAPI_1_1DeviceConfig.html#ad9f44d01a43247cb6cac6b581520dc91">measurementFrequency</a>;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="structAPI_1_1DeviceConfig.html#a898cc51d7a3d7690da820db892c869ea"> 77</a></span> <span class="keywordtype">int</span> <a class="code hl_variable" href="structAPI_1_1DeviceConfig.html#a898cc51d7a3d7690da820db892c869ea">sendFrequency</a>;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> };</div>
</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="classAPI.html#aca6120ab8e7663f2d83eddc5bf85f2e4"> 85</a></span> <a class="code hl_function" href="classAPI.html#aca6120ab8e7663f2d83eddc5bf85f2e4">API</a>(<a class="code hl_class" href="classUUID.html">UUID</a> id_, String token_ = {});</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="classAPI.html#a6dc76b90725abcbc3310fb48c3f52dbb"> 93</a></span> std::optional<String> <a class="code hl_function" href="classAPI.html#a6dc76b90725abcbc3310fb48c3f52dbb">sendMeasurement</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structDataPacket.html">DataPacket</a>& packet);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::optional<String> sendMeasurements(<span class="keyword">const</span> std::list<DataPacket>& <a class="code hl_variable" href="noisemeter-device_8ino.html#a8ed6493bf4782cfdf85b9c3d632a1692">packets</a>,</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keyword">const</span> std::list<DataPacket>::const_iterator from);</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="classAPI.html#a918615b325e3f1cdb43479828f466cf7"> 106</a></span> std::optional<String> <a class="code hl_function" href="classAPI.html#a918615b325e3f1cdb43479828f466cf7">sendMeasurementWithDiagnostics</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structDataPacket.html">DataPacket</a>& packet, String version, String boottime);</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="classAPI.html#a532d91caf2eb282118488b0c7150cf56"> 113</a></span> std::optional<String> <a class="code hl_function" href="classAPI.html#a532d91caf2eb282118488b0c7150cf56">sendRegister</a>(String email);</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="classAPI.html#a65fd992b59714621689a67bfaa58c535"> 119</a></span> std::optional<LatestSoftware> <a class="code hl_function" href="classAPI.html#a65fd992b59714621689a67bfaa58c535">getLatestSoftware</a>();</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> std::optional<DeviceConfig> getDeviceConfig();</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"><a class="line" href="classAPI.html#a5fcfb794b77fb25dc2ae16428373ab15"> 126</a></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code hl_function" href="classAPI.html#a5fcfb794b77fb25dc2ae16428373ab15">rootCertificate</a>();</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="classAPI.html#ae30c1b907bd31044253fdefa2fba7d05"> 130</a></span> <a class="code hl_class" href="classUUID.html">UUID</a> <a class="code hl_variable" href="classAPI.html#ae30c1b907bd31044253fdefa2fba7d05">id</a>;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="classAPI.html#a2f230c506eebd06856b9bbd1ff25695e"> 132</a></span> String <a class="code hl_variable" href="classAPI.html#a2f230c506eebd06856b9bbd1ff25695e">token</a>;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="classAPI.html#a64fcc6c6c4b0fd03de4412d8cc28b70e"> 135</a></span> std::optional<JsonDocument> <a class="code hl_function" href="classAPI.html#a64fcc6c6c4b0fd03de4412d8cc28b70e">responseToJson</a>(<span class="keyword">const</span> String& response);</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"><a class="line" href="classAPI.html#a4ec20ab7f79a076997bfa75eb646cfdb"> 137</a></span> std::optional<JsonDocument> <a class="code hl_function" href="classAPI.html#a4ec20ab7f79a076997bfa75eb646cfdb">sendAuthorizedRequest</a>(</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keyword">const</span> <a class="code hl_struct" href="structAPI_1_1Request.html">Request</a>& req, String ctype = <span class="stringliteral">"application/x-www-form-urlencoded"</span>);</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"><a class="line" href="classAPI.html#a18c196adba525ea80c15278e97e8baa1"> 140</a></span> std::optional<JsonDocument> <a class="code hl_function" href="classAPI.html#a18c196adba525ea80c15278e97e8baa1">sendNonauthorizedRequest</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structAPI_1_1Request.html">Request</a>& req);</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> </div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> std::optional<JsonDocument> sendHttpGET(HTTPClient& https);</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> std::optional<JsonDocument> sendHttpPOST(HTTPClient& https, <span class="keyword">const</span> String& payload);</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> std::optional<JsonDocument> handleHttpResponse(HTTPClient& https);</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span>};</div>
</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> </div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span><span class="preprocessor">#endif </span><span class="comment">// API_H</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="ttc" id="aUUID_8h_html"><div class="ttname"><a href="UUID_8h.html">UUID.h</a></div><div class="ttdoc">Arduino Library for generating UUID's.</div></div>
<div class="ttc" id="aclassAPI_html"><div class="ttname"><a href="classAPI.html">API</a></div><div class="ttdoc">Provides interface for API calls.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00036">api.h:37</a></div></div>
<div class="ttc" id="aclassAPI_html_a18c196adba525ea80c15278e97e8baa1"><div class="ttname"><a href="classAPI.html#a18c196adba525ea80c15278e97e8baa1">API::sendNonauthorizedRequest</a></div><div class="ttdeci">std::optional< JsonDocument > sendNonauthorizedRequest(const Request &req)</div><div class="ttdoc">Attempts the given request and returns the JSON response on success.</div></div>
<div class="ttc" id="aclassAPI_html_a1ae6751f843fcaaf0f0b93d27d6a1f55"><div class="ttname"><a href="classAPI.html#a1ae6751f843fcaaf0f0b93d27d6a1f55">API::Base</a></div><div class="ttdeci">static constexpr const char Base[]</div><div class="ttdoc">API host / base URL.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00039">api.h:39</a></div></div>
<div class="ttc" id="aclassAPI_html_a2f230c506eebd06856b9bbd1ff25695e"><div class="ttname"><a href="classAPI.html#a2f230c506eebd06856b9bbd1ff25695e">API::token</a></div><div class="ttdeci">String token</div><div class="ttdoc">Device's API token for authorized requests.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00132">api.h:132</a></div></div>
<div class="ttc" id="aclassAPI_html_a4ec20ab7f79a076997bfa75eb646cfdb"><div class="ttname"><a href="classAPI.html#a4ec20ab7f79a076997bfa75eb646cfdb">API::sendAuthorizedRequest</a></div><div class="ttdeci">std::optional< JsonDocument > sendAuthorizedRequest(const Request &req, String ctype="application/x-www-form-urlencoded")</div><div class="ttdoc">Attempts the given request and returns the JSON response on success.</div></div>
<div class="ttc" id="aclassAPI_html_a532d91caf2eb282118488b0c7150cf56"><div class="ttname"><a href="classAPI.html#a532d91caf2eb282118488b0c7150cf56">API::sendRegister</a></div><div class="ttdeci">std::optional< String > sendRegister(String email)</div><div class="ttdoc">Attempts to register the device with the given email.</div></div>
<div class="ttc" id="aclassAPI_html_a5fcfb794b77fb25dc2ae16428373ab15"><div class="ttname"><a href="classAPI.html#a5fcfb794b77fb25dc2ae16428373ab15">API::rootCertificate</a></div><div class="ttdeci">static const char * rootCertificate()</div><div class="ttdoc">Provides the server's root certificate for non-API HTTPS requests.</div></div>
<div class="ttc" id="aclassAPI_html_a64fcc6c6c4b0fd03de4412d8cc28b70e"><div class="ttname"><a href="classAPI.html#a64fcc6c6c4b0fd03de4412d8cc28b70e">API::responseToJson</a></div><div class="ttdeci">std::optional< JsonDocument > responseToJson(const String &response)</div><div class="ttdoc">Converts response string into JSON.</div></div>
<div class="ttc" id="aclassAPI_html_a65fd992b59714621689a67bfaa58c535"><div class="ttname"><a href="classAPI.html#a65fd992b59714621689a67bfaa58c535">API::getLatestSoftware</a></div><div class="ttdeci">std::optional< LatestSoftware > getLatestSoftware()</div><div class="ttdoc">Attempts to get the latest available software info (for OTA).</div></div>
<div class="ttc" id="aclassAPI_html_a6dc76b90725abcbc3310fb48c3f52dbb"><div class="ttname"><a href="classAPI.html#a6dc76b90725abcbc3310fb48c3f52dbb">API::sendMeasurement</a></div><div class="ttdeci">std::optional< String > sendMeasurement(const DataPacket &packet)</div><div class="ttdoc">Sends a DataPacket (dB measurement) to the server.</div></div>
<div class="ttc" id="aclassAPI_html_a918615b325e3f1cdb43479828f466cf7"><div class="ttname"><a href="classAPI.html#a918615b325e3f1cdb43479828f466cf7">API::sendMeasurementWithDiagnostics</a></div><div class="ttdeci">std::optional< String > sendMeasurementWithDiagnostics(const DataPacket &packet, String version, String boottime)</div><div class="ttdoc">Sends diagnostic/analytic data to the server along with a DataPacket.</div></div>
<div class="ttc" id="aclassAPI_html_aca6120ab8e7663f2d83eddc5bf85f2e4"><div class="ttname"><a href="classAPI.html#aca6120ab8e7663f2d83eddc5bf85f2e4">API::API</a></div><div class="ttdeci">API(UUID id_, String token_={})</div><div class="ttdoc">Creates a new API interface for the given device (ID).</div></div>
<div class="ttc" id="aclassAPI_html_ae30c1b907bd31044253fdefa2fba7d05"><div class="ttname"><a href="classAPI.html#ae30c1b907bd31044253fdefa2fba7d05">API::id</a></div><div class="ttdeci">UUID id</div><div class="ttdoc">Device's UUID.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00130">api.h:130</a></div></div>
<div class="ttc" id="aclassUUID_html"><div class="ttname"><a href="classUUID.html">UUID</a></div><div class="ttdef"><b>Definition</b> <a href="UUID_8h_source.html#l00034">UUID.h:35</a></div></div>
<div class="ttc" id="adata-packet_8h_html"><div class="ttname"><a href="data-packet_8h.html">data-packet.h</a></div><div class="ttdoc">Management for storage of collected data points.</div></div>
<div class="ttc" id="anoisemeter-device_8ino_html_a8ed6493bf4782cfdf85b9c3d632a1692"><div class="ttname"><a href="noisemeter-device_8ino.html#a8ed6493bf4782cfdf85b9c3d632a1692">packets</a></div><div class="ttdeci">static std::list< DataPacket > packets</div><div class="ttdoc">Linked list of completed data packets.</div><div class="ttdef"><b>Definition</b> <a href="noisemeter-device_8ino_source.html#l00059">noisemeter-device.ino:59</a></div></div>
<div class="ttc" id="astructAPI_1_1DeviceConfig_html"><div class="ttname"><a href="structAPI_1_1DeviceConfig.html">API::DeviceConfig</a></div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00071">api.h:71</a></div></div>
<div class="ttc" id="astructAPI_1_1DeviceConfig_html_a898cc51d7a3d7690da820db892c869ea"><div class="ttname"><a href="structAPI_1_1DeviceConfig.html#a898cc51d7a3d7690da820db892c869ea">API::DeviceConfig::sendFrequency</a></div><div class="ttdeci">int sendFrequency</div><div class="ttdoc">Specifies how frequently to upload measurements.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00077">api.h:77</a></div></div>
<div class="ttc" id="astructAPI_1_1DeviceConfig_html_ad8104b13144c4fc90f0f30b22a24be5b"><div class="ttname"><a href="structAPI_1_1DeviceConfig.html#ad8104b13144c4fc90f0f30b22a24be5b">API::DeviceConfig::timestamp</a></div><div class="ttdeci">String timestamp</div><div class="ttdoc">Timestamp for when this config was last updated.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00073">api.h:73</a></div></div>
<div class="ttc" id="astructAPI_1_1DeviceConfig_html_ad9f44d01a43247cb6cac6b581520dc91"><div class="ttname"><a href="structAPI_1_1DeviceConfig.html#ad9f44d01a43247cb6cac6b581520dc91">API::DeviceConfig::measurementFrequency</a></div><div class="ttdeci">int measurementFrequency</div><div class="ttdoc">Specifies how frequently to create a packet w/ min/mean/max stats.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00075">api.h:75</a></div></div>
<div class="ttc" id="astructAPI_1_1LatestSoftware_html"><div class="ttname"><a href="structAPI_1_1LatestSoftware.html">API::LatestSoftware</a></div><div class="ttdoc">Results of the software update endpoint.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00064">api.h:64</a></div></div>
<div class="ttc" id="astructAPI_1_1LatestSoftware_html_a3d366cba9641a74c44afaf1bb718eeec"><div class="ttname"><a href="structAPI_1_1LatestSoftware.html#a3d366cba9641a74c44afaf1bb718eeec">API::LatestSoftware::url</a></div><div class="ttdeci">String url</div><div class="ttdoc">Download URL for latest software.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00068">api.h:68</a></div></div>
<div class="ttc" id="astructAPI_1_1LatestSoftware_html_acbd0d6cc7032f96b785b1c5af2fa111f"><div class="ttname"><a href="structAPI_1_1LatestSoftware.html#acbd0d6cc7032f96b785b1c5af2fa111f">API::LatestSoftware::version</a></div><div class="ttdeci">String version</div><div class="ttdoc">Version number of latest available software.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00066">api.h:66</a></div></div>
<div class="ttc" id="astructAPI_1_1Request_html"><div class="ttname"><a href="structAPI_1_1Request.html">API::Request</a></div><div class="ttdoc">String builder to create URLs for API endpoints and requests.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00042">api.h:42</a></div></div>
<div class="ttc" id="astructAPI_1_1Request_html_a1ade33dc9bf0717c1bbfcd24a6b17698"><div class="ttname"><a href="structAPI_1_1Request.html#a1ade33dc9bf0717c1bbfcd24a6b17698">API::Request::addParam</a></div><div class="ttdeci">Request & addParam(const char param[], String value)</div><div class="ttdoc">Adds a parameter to the given request.</div></div>
<div class="ttc" id="astructAPI_1_1Request_html_ac1ed273e77b895150fa098ff2d4e88a1"><div class="ttname"><a href="structAPI_1_1Request.html#ac1ed273e77b895150fa098ff2d4e88a1">API::Request::url</a></div><div class="ttdeci">String url</div><div class="ttdoc">Stores the resulting request URL.</div><div class="ttdef"><b>Definition</b> <a href="api_8h_source.html#l00058">api.h:58</a></div></div>
<div class="ttc" id="astructAPI_1_1Request_html_add312b1776b4e110e1916c73fb430c86"><div class="ttname"><a href="structAPI_1_1Request.html#add312b1776b4e110e1916c73fb430c86">API::Request::Request</a></div><div class="ttdeci">Request(const char endpoint[])</div><div class="ttdoc">Initializes a new request with zero parameters.</div></div>
<div class="ttc" id="astructDataPacket_html"><div class="ttname"><a href="structDataPacket.html">DataPacket</a></div><div class="ttdoc">Stores data points included in an uploaded "measurement".</div><div class="ttdef"><b>Definition</b> <a href="data-packet_8h_source.html#l00029">data-packet.h:30</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>