blob: 5424518729b5822ebcacdb5ba00ce2f2518eb315 [file] [log] [blame]
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>/home/eantwuh/build/git/iot_lt/InfluxDB_Functions.ttcn - Massive IoT Test Tools</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script></head><body class="FramedContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version 1.52 -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="InfluxDB_Functions.ttcn"></a>InfluxDB_Functions.ttcn</h1><div class=CBody><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#InfluxDB_Functions.ttcn" >InfluxDB_Functions.ttcn</a></td><td class=SDescription></td></tr><tr class="SFunction SMarked"><td class=SEntry><a href="#f_IOT_LGen_behavior" >f_IOT_LGen_behavior</a></td><td class=SDescription>The main initialization function for the &lt;InfluxDB_CT&gt; component type</td></tr><tr class="SFunction"><td class=SEntry><a href="#f_InfluxDB_connect" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">f_InfluxDB_connect</a></td><td class=SDescription>Setup the connection with the InfluxDB database</td></tr><tr class="SFunction SMarked"><td class=SEntry><a href="#f_InfluxDB_send" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">f_InfluxDB_send</a></td><td class=SDescription>Sends a report to the InfluxDB database</td></tr><tr class="SFunction"><td class=SEntry><a href="#f_InfluxDB_encode" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">f_InfluxDB_encode</a></td><td class=SDescription>Converts a report to charstring format</td></tr><tr class="SFunction SMarked"><td class=SEntry><a href="#f_InfluxDB_setMeasurement" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">f_InfluxDB_setMeasurement</a></td><td class=SDescription>Sets the measurement field of an InfluxDB report</td></tr><tr class="SFunction"><td class=SEntry><a href="#f_InfluxDB_addTag" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">f_InfluxDB_addTag</a></td><td class=SDescription>Adds a tag to the tag-list of an InfluxDB message</td></tr><tr class="SFunction SMarked"><td class=SEntry><a href="#f_InfluxDB_addField" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">f_InfluxDB_addField</a></td><td class=SDescription>Adds a field to the field-list of an InfluxDB message</td></tr><tr class="SFunction"><td class=SEntry><a href="#f_InfluxDB_scheduleNextReport" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">f_InfluxDB_scheduleNextReport</a></td><td class=SDescription>Sets the target time of the next report</td></tr><tr class="SFunction SMarked"><td class=SEntry><a href="#f_InlfuxDB_log_debug" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">f_InlfuxDB_log_debug</a></td><td class=SDescription>If debug log is set, write the parameter to the log file</td></tr><tr class="SFunction"><td class=SEntry><a href="#as_InfluxDB_eventHandler" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">as_InfluxDB_eventHandler</a></td><td class=SDescription>When report period expired, restarts the InfluxDB event handler and sets the time of the next report</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="f_IOT_LGen_behavior"></a>f_IOT_LGen_behavior</h3><div class=CBody><h4 class=CHeading>Purpose</h4><p>The main initialization function for the &lt;InfluxDB_CT&gt; component type</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>p_lgenIdx</td><td class=CDLDescription><b>in</b> <b>integer</b> - the index of the component instance</td></tr></table><h4 class=CHeading>Related Type</h4><p>&lt;InfluxDB_CT&gt;</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="f_InfluxDB_connect"></a>f_InfluxDB_connect</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">function f_InfluxDB_connect() runs on InfluxDB_CT</td></tr></table></blockquote><h4 class=CHeading>Purpose</h4><p>Setup the connection with the InfluxDB database</p><h4 class=CHeading>Parameters</h4><h4 class=CHeading>Related Type</h4><p>&lt;InfluxDB_CT&gt;</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="f_InfluxDB_send"></a>f_InfluxDB_send</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InfluxDB_send(</td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>InfluxLineProtocol&nbsp;</td><td class="PParameter prettyprint " nowrap>p_data</td><td class="PAfterParameters prettyprint "nowrap>) runs on InfluxDB_CT</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Purpose</h4><p>Sends a report to the InfluxDB database</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>p_data</td><td class=CDLDescription><b>in</b> &lt;InfluxLineProtocol&gt; - Report to send</td></tr></table><h4 class=CHeading>Related Type</h4><p>&lt;InfluxDB_CT&gt;</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="f_InfluxDB_encode"></a>f_InfluxDB_encode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InfluxDB_encode(</td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>InfluxLineProtocol&nbsp;</td><td class="PParameter prettyprint " nowrap>p_prot,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>out&nbsp;</td><td class="PType prettyprint " nowrap>charstring&nbsp;</td><td class="PParameter prettyprint " nowrap>p_encoded</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Purpose</h4><p>Converts a report to charstring format</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>p_prot</td><td class=CDLDescription><b>in</b> &lt;InfluxLineProtocol&gt;, Message to send</td></tr><tr><td class=CDLEntry>p_encoded</td><td class=CDLDescription><b>out</b> <b>charstring</b> - Output string</td></tr></table><h4 class=CHeading>Related Type</h4></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="f_InfluxDB_setMeasurement"></a>f_InfluxDB_setMeasurement</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InfluxDB_setMeasurement(</td><td class="PTypePrefix prettyprint " nowrap>inout&nbsp;</td><td class="PType prettyprint " nowrap>InfluxLineProtocol&nbsp;</td><td class="PParameter prettyprint " nowrap>p_pdu,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>charstring&nbsp;</td><td class="PParameter prettyprint " nowrap>p_measurement</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Purpose</h4><p>Sets the measurement field of an InfluxDB report</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>p_pdu</td><td class=CDLDescription><b>inout</b> &lt;InfluxLineProtocol&gt;, Influx message</td></tr><tr><td class=CDLEntry>p_measurement</td><td class=CDLDescription><b>in</b> <b>charstring</b> - measurement value</td></tr></table><h4 class=CHeading>Related Type</h4></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="f_InfluxDB_addTag"></a>f_InfluxDB_addTag</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InfluxDB_addTag(</td><td class="PTypePrefix prettyprint " nowrap>inout&nbsp;</td><td class="PType prettyprint " nowrap>InfluxLineProtocol&nbsp;</td><td class="PParameter prettyprint " nowrap>p_pdu,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>InfluxAttrValue&nbsp;</td><td class="PParameter prettyprint " nowrap>p_tag</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Purpose</h4><p>Adds a tag to the tag-list of an InfluxDB message</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>p_pdu</td><td class=CDLDescription><b>inout</b> &lt;InfluxLineProtocol&gt;, Influx message</td></tr><tr><td class=CDLEntry>p_tag</td><td class=CDLDescription><b>in</b> &lt;InfluxAttrValue&gt; - tag value to be added</td></tr></table><h4 class=CHeading>Related Type</h4></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="f_InfluxDB_addField"></a>f_InfluxDB_addField</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InfluxDB_addField(</td><td class="PTypePrefix prettyprint " nowrap>inout&nbsp;</td><td class="PType prettyprint " nowrap>InfluxLineProtocol&nbsp;</td><td class="PParameter prettyprint " nowrap>p_pdu,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>InfluxAttrValue&nbsp;</td><td class="PParameter prettyprint " nowrap>p_field</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Purpose</h4><p>Adds a field to the field-list of an InfluxDB message</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>p_pdu</td><td class=CDLDescription><b>inout</b> &lt;InfluxLineProtocol&gt;, Influx message</td></tr><tr><td class=CDLEntry>p_field</td><td class=CDLDescription><b>in</b> &lt;InfluxAttrValue&gt; - field value to be added</td></tr></table><h4 class=CHeading>Related Type</h4></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="f_InfluxDB_scheduleNextReport"></a>f_InfluxDB_scheduleNextReport</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">function f_InfluxDB_scheduleNextReport() runs on InfluxDB_CT</td></tr></table></blockquote><h4 class=CHeading>Purpose</h4><p>Sets the target time of the next report</p><h4 class=CHeading>Parameters</h4><h4 class=CHeading>Related Type</h4><p>&lt;InfluxDB_CT&gt;</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="f_InlfuxDB_log_debug"></a>f_InlfuxDB_log_debug</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InlfuxDB_log_debug(</td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>charstring&nbsp;</td><td class="PParameter prettyprint " nowrap>p_log</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Purpose</h4><p>If debug log is set, write the parameter to the log file</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>p_log</td><td class=CDLDescription><b>in</b> <b>charstring</b> - string to log</td></tr></table><h4 class=CHeading>Related Type</h4></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="as_InfluxDB_eventHandler"></a>as_InfluxDB_eventHandler</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">altstep as_InfluxDB_eventHandler() runs on InfluxDB_CT</td></tr></table></blockquote><h4 class=CHeading>Purpose</h4><p>When report period expired, restarts the InfluxDB event handler and sets the time of the next report</p><h4 class=CHeading>Parameters</h4><h4 class=CHeading>Related Type</h4><p>&lt;InfluxDB_CT&gt;</p></div></div></div>
</div><!--Content-->
<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">function f_InfluxDB_connect() runs on InfluxDB_CT</td></tr></table></blockquote>Setup the connection with the InfluxDB database</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InfluxDB_send(</td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>InfluxLineProtocol&nbsp;</td><td class="PParameter prettyprint " nowrap>p_data</td><td class="PAfterParameters prettyprint "nowrap>) runs on InfluxDB_CT</td></tr></table></td></tr></table></blockquote>Sends a report to the InfluxDB database</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InfluxDB_encode(</td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>InfluxLineProtocol&nbsp;</td><td class="PParameter prettyprint " nowrap>p_prot,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>out&nbsp;</td><td class="PType prettyprint " nowrap>charstring&nbsp;</td><td class="PParameter prettyprint " nowrap>p_encoded</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Converts a report to charstring format</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InfluxDB_setMeasurement(</td><td class="PTypePrefix prettyprint " nowrap>inout&nbsp;</td><td class="PType prettyprint " nowrap>InfluxLineProtocol&nbsp;</td><td class="PParameter prettyprint " nowrap>p_pdu,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>charstring&nbsp;</td><td class="PParameter prettyprint " nowrap>p_measurement</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the measurement field of an InfluxDB report</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InfluxDB_addTag(</td><td class="PTypePrefix prettyprint " nowrap>inout&nbsp;</td><td class="PType prettyprint " nowrap>InfluxLineProtocol&nbsp;</td><td class="PParameter prettyprint " nowrap>p_pdu,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>InfluxAttrValue&nbsp;</td><td class="PParameter prettyprint " nowrap>p_tag</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Adds a tag to the tag-list of an InfluxDB message</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InfluxDB_addField(</td><td class="PTypePrefix prettyprint " nowrap>inout&nbsp;</td><td class="PType prettyprint " nowrap>InfluxLineProtocol&nbsp;</td><td class="PParameter prettyprint " nowrap>p_pdu,</td></tr><tr><td></td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>InfluxAttrValue&nbsp;</td><td class="PParameter prettyprint " nowrap>p_field</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Adds a field to the field-list of an InfluxDB message</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">function f_InfluxDB_scheduleNextReport() runs on InfluxDB_CT</td></tr></table></blockquote>Sets the target time of the next report</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters prettyprint "nowrap>function f_InlfuxDB_log_debug(</td><td class="PTypePrefix prettyprint " nowrap>in&nbsp;</td><td class="PType prettyprint " nowrap>charstring&nbsp;</td><td class="PParameter prettyprint " nowrap>p_log</td><td class="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>If debug log is set, write the parameter to the log file</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">altstep as_InfluxDB_eventHandler() runs on InfluxDB_CT</td></tr></table></blockquote>When report period expired, restarts the InfluxDB event handler and sets the time of the next report</div></div><!--END_ND_TOOLTIPS-->
<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>