blob: 7a7366093c1bea12b0e2c9b1c5d909f356879d47 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright 2019 NXP
This software is owned or controlled by NXP and may only be used
strictly in accordance with the applicable license terms. By expressly
accepting such terms or by downloading, installing, activating and/or
otherwise using the software, you are agreeing that you have read, and
that you agree to comply with and are bound by, such license terms. If
you do not agree to be bound by the applicable license terms, then you
may not retain, install, activate or otherwise use the software.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>6.6. API &#8212; Plug &amp; Trust MW v03.00.05 documentation</title>
<link rel="stylesheet" href="../../_static/bootstrap-sphinx.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
<script id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="6.7. Usage Examples" href="readme_usage_examples.html" />
<link rel="prev" title="6.1. Introduction" href="introduction.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="../../_static/js/jquery-1.11.0.min.js "></script>
<script type="text/javascript" src="../../_static/js/jquery-fix.js "></script>
<script type="text/javascript" src="../../_static/bootstrap-3.3.7/js/bootstrap.min.js "></script>
<script type="text/javascript" src="../../_static/bootstrap-sphinx.js "></script>
</head><body>
<div id="navbar" class="navbar navbar-inverse navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../toc.html"><span><img src="../../_static/NXP_logo_JPG.jpg"></span>
MW</a>
<span class="navbar-text navbar-version pull-left"><b>v03.00.05</b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="../../toc.html">TOC <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../index.html">1. NXP Plug &amp; Trust Middleware</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../organization-of-documentation.html">1.1. Organization of Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../folder-structure.html">1.2. Folder Structure</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../sw-prerequisites.html">1.3. List of Platform Prerequisites</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../changes/index.html">2. Changes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../changes/pending.html">2.1. Pending Refactoring items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/pending.html#known-limitations">2.2. Known limitations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v03_00_05.html">2.3. Release <code class="docutils literal notranslate"><span class="pre">v03.00.05</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v03_00_04.html">2.4. Release <code class="docutils literal notranslate"><span class="pre">v03.00.04</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v03_00_03.html">2.5. Release <code class="docutils literal notranslate"><span class="pre">v03.00.03</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v03_00_02.html">2.6. Release <code class="docutils literal notranslate"><span class="pre">v03.00.02</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_16_01.html">2.7. Release <code class="docutils literal notranslate"><span class="pre">v02.16.01</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_16_00.html">2.8. Release <code class="docutils literal notranslate"><span class="pre">v02.16.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_15_00.html">2.9. Release <code class="docutils literal notranslate"><span class="pre">v02.15.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_14_00.html">2.10. Release <code class="docutils literal notranslate"><span class="pre">v02.14.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_12_00.html">2.11. Release <code class="docutils literal notranslate"><span class="pre">v02.12.05</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_12_00.html#release-v02-12-04">2.12. Release <code class="docutils literal notranslate"><span class="pre">v02.12.04</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_12_00.html#release-v02-12-03">2.13. Release <code class="docutils literal notranslate"><span class="pre">v02.12.03</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_12_00.html#release-v02-12-02">2.14. Release <code class="docutils literal notranslate"><span class="pre">v02.12.02</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_12_00.html#release-v02-12-01">2.15. Release <code class="docutils literal notranslate"><span class="pre">v02.12.01</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_12_00.html#release-v02-12-00">2.16. Release <code class="docutils literal notranslate"><span class="pre">v02.12.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_11_03.html">2.17. Release <code class="docutils literal notranslate"><span class="pre">v02.11.03</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_11_01.html">2.18. Internal Release <code class="docutils literal notranslate"><span class="pre">v02.11.01</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_11_00.html">2.19. Release <code class="docutils literal notranslate"><span class="pre">v02.11.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_10_00.html">2.20. Release <code class="docutils literal notranslate"><span class="pre">v02.10.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_09_00.html">2.21. Release <code class="docutils literal notranslate"><span class="pre">v02.09.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_07_00.html">2.22. Release <code class="docutils literal notranslate"><span class="pre">v02.07.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_06_00.html">2.23. Release <code class="docutils literal notranslate"><span class="pre">v02.06.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_05_00_to_v02_03_00.html">2.24. Release <code class="docutils literal notranslate"><span class="pre">v02.05.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_05_00_to_v02_03_00.html#release-v02-04-00">2.25. Release <code class="docutils literal notranslate"><span class="pre">v02.04.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../changes/v02_05_00_to_v02_03_00.html#release-02-03-00">2.26. Release <code class="docutils literal notranslate"><span class="pre">02.03.00</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../stack/index.html">3. Plug &amp; Trust MW Stack</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../stack/features.html">3.1. Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/features.html#plug-trust-mw-block-diagram">3.2. Plug &amp; Trust MW : Block Diagram</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../sss-apis.html">3.3. SSS APIs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/se05xfeatures.html">3.4. SSS APIs: SE051 vs SE050</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/param_checks.html">3.5. Parameter Check &amp; Conventions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/i2cm.html">3.6. I2CM / Secure Sensor</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/logging.html">3.7. Logging</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/feature-file.html">3.8. Feature File - <code class="docutils literal notranslate"><span class="pre">fsl_sss_ftr.h</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/platf-scp-from-fs.html">3.9. Using Platform SCP Keys from File System</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/auth/auth-objects.html">3.10. Auth Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/auth/auth-objects-userid.html">3.11. Auth Objects : UserID</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/auth/auth-objects-aeskey.html">3.12. Auth Objects : AESKey</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/auth/auth-objects-eckey.html">3.13. Auth Objects : ECKey</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/key-id-range.html">3.14. Key Id Range and Purpose</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/key-id-range.html#authentication-keys">3.15. Authentication Keys</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../stack/key-id-range.html#trust-provisioned-keyids">3.16. Trust provisioned KeyIDs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../sss/ex/doc/puf-scp03.html">3.17. SCP03 with PUF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../sss/doc/sss_heap_management.html">3.18. SSS Heap Management</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../building/index.html">4. Building / Compiling</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../building/windows.html">4.1. Windows Build</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building/frdm-k64f-sdk.html">4.2. Import MCUXPresso projects from SDK</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building/frdm-k64f-cmake.html">4.3. Freedom K64F Build (CMake - Advanced)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building/imx6.html">4.4. i.MX Linux Build</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building/rpi3.html">4.5. Raspberry Pi Build</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building/cmake.html">4.6. CMake</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../scripts/cmake_options.html">4.7. CMake Options</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../demos/index.html">5. Demo and Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#demo-list">5.1. Demo List</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#sss-api-examples">5.2. SSS API Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#cloud-demos">5.3. Cloud Demos</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#linux-specific-demos">5.4. Linux Specific Demos</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#opc-ua-example">5.5. OPC-UA Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#arm-psa-example">5.6. ARM PSA Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#se05x-examples">5.7. SE05X Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#openssl-examples">5.8. OpenSSL Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#tests-for-user-crypto">5.9. Tests for User Crypto</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#nxpnfcrdlib-examples">5.10. NXPNFCRDLIB examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#ease-of-use-examples">5.11. Ease-of-Use examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#semslite-examples">5.12. Semslite examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/index.html#puf-examples">5.13. PUF examples</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="reference internal" href="../../edgelock2go-agent.html">6. NXP EdgeLock 2GO Agent</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="introduction.html">6.1. Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="introduction.html#building-and-running-the-edgelock-2go-agent">6.2. Building and running the EdgeLock 2GO agent</a></li>
<li class="toctree-l2"><a class="reference internal" href="introduction.html#datastore-keystore">6.3. Datastore / Keystore</a></li>
<li class="toctree-l2"><a class="reference internal" href="introduction.html#connection-to-the-edgelock-2go-cloud-service">6.4. Connection to the EdgeLock 2GO cloud service</a></li>
<li class="toctree-l2"><a class="reference internal" href="introduction.html#claim-codes">6.5. Claim Codes</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">6.6. API</a></li>
<li class="toctree-l2"><a class="reference internal" href="readme_usage_examples.html">6.7. Usage Examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../semslite/doc/index.html">7. SEMS Lite Agent</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../semslite/doc/sems_lite_overview.html">7.1. SEMS Lite Overview (Only for SE051)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../semslite/doc/sems_lite_package.html">7.2. Update Package</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../semslite/doc/sems_lite_usage.html">7.3. SEMS Lite Agent Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../semslite/doc/sems_lite_mgmt_api.html">7.4. SEMS Lite management APIs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../semslite/doc/sems_lite_process.html">7.5. SEMS Lite Agent Package Load Process</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../semslite/doc/sems_lite_api.html">7.6. APIs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../semslite/doc/sems_lite_known_issue.html">7.7. SEMS Lite Known Issue</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../semslite/doc/demo_update.html">7.8. SEMS Lite DEMOs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../plugins/index.html">8. Plugins / Add-ins</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../sss/plugin/openssl/scripts/readme.html">8.1. Introduction on OpenSSL engine</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../sss/plugin/mbedtls/scripts/readme.html">8.2. Introduction on mbedTLS ALT Implementation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../sss/plugin/psa/Readme.html">8.3. Platform Security Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins/akm.html">8.4. Android Key master</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../sss/plugin/open62541/readme.html">8.5. Introduction on Open62541 (OPC UA stack)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins/wifiEAP/wifiEAP.html">8.6. WiFi EAP Demo with Raspberry Pi3</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../plugins/pkcs11.html">8.7. PKCS#11 Standalone Library</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../cli-tool.html">9. CLI Tool</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../pycli/doc/introduction.html">9.1. Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pycli/doc/block-diagram.html">9.2. Block Diagram</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pycli/doc/pre-steps.html">9.3. Steps needed before running <code class="docutils literal notranslate"><span class="pre">ssscli</span></code> tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pycli/doc/running.html">9.4. Running the <code class="docutils literal notranslate"><span class="pre">ssscli</span></code> tool - Windows</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pycli/Provisioning/readme.html">9.5. CLI Provisioning</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pycli/doc/readme_usage_examples.html">9.6. Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pycli/doc/cli_commands_list.html">9.7. List of <code class="docutils literal notranslate"><span class="pre">ssscli</span></code> commands</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pycli/doc/cli_data_format.html">9.8. CLI Data formats</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pycli/doc/cli_object_policy.html">9.9. Object Policies Through ssscli</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../appendix/upload_se05x_using_pycli.html">9.10. Upload keys and certificates to SE05X using ssscli tool</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../a71ch.html">10. A71CH</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../a71ch/a71ch_sss.html">10.1. A71CH and SSS API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../a71ch/a71ch_miscellaneous.html">10.2. Miscellaneous</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../a71ch/a71ch_legacy_host_api.html">10.3. A71CH Legacy API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../a71ch/a71ch_legacy_hlse_api.html">10.4. A71CH Legacy HLSE (Generic) API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../a71ch/a71ch_configure_tool.html">10.5. A71CH Legacy Configure Tool</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../appendix.html">11. Appendix</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../appendix/glossary.html">11.1. Glossary</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../appendix/vcom.html">11.2. APDU Commands over VCOM</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../appendix/vs2019-setup.html">11.3. Visual Studio 2019 Setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../appendix/ide_mcux.html">11.4. Setting up MCUXPresso IDE</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../dev-platforms.html">11.5. Development Platforms</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../appendix/se_uid.html">11.6. How to get SE Platform Information and UID</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../appendix/version_info.html">11.7. Version Information</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../demos/Certificate_Chains/Readme.html">11.8. Certificate Chains</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../appendix/rjct_server.html">11.9. JRCP_v1 Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../appendix/platfscp.html">11.10. Using own Platform SCP03 Keys</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../appendix/apdu_write_to_buffer.html">11.11. Write APDU to buffer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api/api_list.html">11.12. Plug &amp; Trust MW APIs</a></li>
</ul>
</li>
</ul>
</ul>
</li>
<li class="dropdown">
<a role="button"
id="dLabelLocalToc"
data-toggle="dropdown"
data-target="#"
href="#">Page <b class="caret"></b></a>
<ul class="dropdown-menu localtoc"
role="menu"
aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">6.6. API</a><ul>
<li><a class="reference internal" href="#edgelock-2go-main">6.6.1. EdgeLock 2GO Main</a></li>
<li><a class="reference internal" href="#edgelock-2go-datastore">6.6.2. EdgeLock 2GO Datastore</a></li>
<li><a class="reference internal" href="#edgelock-2go-keystore">6.6.3. EdgeLock 2GO Keystore</a></li>
<li><a class="reference internal" href="#edgelock-2go-session">6.6.4. EdgeLock 2GO Session</a></li>
<li><a class="reference internal" href="#edgelock-2go-service">6.6.5. EdgeLock 2GO Service</a></li>
<li><a class="reference internal" href="#edgelock-2go-dispatcher">6.6.6. EdgeLock 2GO Dispatcher</a></li>
<li><a class="reference internal" href="#edgelock-2go-utils">6.6.7. EdgeLock 2GO Utils</a></li>
</ul>
</li>
</ul>
</ul>
</li>
<li>
<a href="introduction.html" title="Previous Chapter: 6.1. Introduction"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; 6.1. Introduction</span>
</a>
</li>
<li>
<a href="readme_usage_examples.html" title="Next Chapter: 6.7. Usage Examples"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">6.7. Usage Examples &raquo;</span>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-3">
<div id="sidebar" class="bs-sidenav" role="complementary">
<div class="sidebar-header">
<h3>Plug &amp; Trust MW</h3>
</div>
<div class="row">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../index.html">1. NXP Plug &amp; Trust Middleware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../changes/index.html">2. Changes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../stack/index.html">3. Plug &amp; Trust MW Stack</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../building/index.html">4. Building / Compiling</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../demos/index.html">5. Demo and Examples</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../edgelock2go-agent.html">6. NXP EdgeLock 2GO Agent</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="introduction.html">6.1. Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="introduction.html#building-and-running-the-edgelock-2go-agent">6.2. Building and running the EdgeLock 2GO agent</a></li>
<li class="toctree-l2"><a class="reference internal" href="introduction.html#datastore-keystore">6.3. Datastore / Keystore</a></li>
<li class="toctree-l2"><a class="reference internal" href="introduction.html#connection-to-the-edgelock-2go-cloud-service">6.4. Connection to the EdgeLock 2GO cloud service</a></li>
<li class="toctree-l2"><a class="reference internal" href="introduction.html#claim-codes">6.5. Claim Codes</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">6.6. API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#edgelock-2go-main">6.6.1. EdgeLock 2GO Main</a></li>
<li class="toctree-l3"><a class="reference internal" href="#edgelock-2go-datastore">6.6.2. EdgeLock 2GO Datastore</a></li>
<li class="toctree-l3"><a class="reference internal" href="#edgelock-2go-keystore">6.6.3. EdgeLock 2GO Keystore</a></li>
<li class="toctree-l3"><a class="reference internal" href="#edgelock-2go-session">6.6.4. EdgeLock 2GO Session</a></li>
<li class="toctree-l3"><a class="reference internal" href="#edgelock-2go-service">6.6.5. EdgeLock 2GO Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="#edgelock-2go-dispatcher">6.6.6. EdgeLock 2GO Dispatcher</a></li>
<li class="toctree-l3"><a class="reference internal" href="#edgelock-2go-utils">6.6.7. EdgeLock 2GO Utils</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="readme_usage_examples.html">6.7. Usage Examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../semslite/doc/index.html">7. SEMS Lite Agent</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../plugins/index.html">8. Plugins / Add-ins</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cli-tool.html">9. CLI Tool</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../a71ch.html">10. A71CH</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../appendix.html">11. Appendix</a></li>
</ul>
</div>
<div class="row">
<form class="form" action="../../search.html" method="get">
<div class="form-group">
<label for="Search">Search:</label>
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="body col-md-9 content" role="main">
<div class="section" id="api">
<h1><span class="section-number">6.6. </span>API<a class="headerlink" href="#api" title="Permalink to this headline"></a></h1>
<div class="section" id="edgelock-2go-main">
<h2><span class="section-number">6.6.1. </span>EdgeLock 2GO Main<a class="headerlink" href="#edgelock-2go-main" title="Permalink to this headline"></a></h2>
<dl class="group">
<dt>
<span class="target" id="group__edgelock2go__agent__main"></span><em>group</em> <code class="sig-name descname">edgelock2go_agent_main</code></dt>
<dd><p>Main API for registering keystores, datastores and connecting to the cloud to update provisionings. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.EDGELOCK2GO_ATTESTATION_KEY_ECC">
<span class="target" id="group__edgelock2go__agent__main_1ga2399274fa1c43f6c7f45f5d48d40bce8"></span><code class="sig-name descname">EDGELOCK2GO_ATTESTATION_KEY_ECC</code><a class="headerlink" href="#c.EDGELOCK2GO_ATTESTATION_KEY_ECC" title="Permalink to this definition"></a></dt>
<dd><p>The attestation keyid on the SSS API to use for the attestation. </p>
</dd></dl>
<dl class="macro">
<dt id="c.EDGELOCK2GO_ATTESTATION_KEY_RSA">
<span class="target" id="group__edgelock2go__agent__main_1ga5a401a8e25bf1a8e520a43d72d92bb2a"></span><code class="sig-name descname">EDGELOCK2GO_ATTESTATION_KEY_RSA</code><a class="headerlink" href="#c.EDGELOCK2GO_ATTESTATION_KEY_RSA" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="macro">
<dt id="c.EDGELOCK2GO_CERTID_ECC">
<span class="target" id="group__edgelock2go__agent__main_1gab5f4ebe4275e68312ff8519488e7e35a"></span><code class="sig-name descname">EDGELOCK2GO_CERTID_ECC</code><a class="headerlink" href="#c.EDGELOCK2GO_CERTID_ECC" title="Permalink to this definition"></a></dt>
<dd><p>The certid on the SSS API to use for the keystore to use for connecting to EdgeLock 2GO cloud service. </p>
</dd></dl>
<dl class="macro">
<dt id="c.EDGELOCK2GO_CERTID_RSA">
<span class="target" id="group__edgelock2go__agent__main_1gaf6229387c706f84d517ba6b0c03cc267"></span><code class="sig-name descname">EDGELOCK2GO_CERTID_RSA</code><a class="headerlink" href="#c.EDGELOCK2GO_CERTID_RSA" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="macro">
<dt id="c.EDGELOCK2GO_KEYID_ECC">
<span class="target" id="group__edgelock2go__agent__main_1ga5d107a02198fe23645d26e3da89868a7"></span><code class="sig-name descname">EDGELOCK2GO_KEYID_ECC</code><a class="headerlink" href="#c.EDGELOCK2GO_KEYID_ECC" title="Permalink to this definition"></a></dt>
<dd><p>The keyid on the SSS API to use for the keystore and keypair to use for connecting to EdgeLock 2GO cloud service. </p>
</dd></dl>
<dl class="macro">
<dt id="c.EDGELOCK2GO_KEYID_RSA">
<span class="target" id="group__edgelock2go__agent__main_1ga126abde9f18965600ff51534d404a29c"></span><code class="sig-name descname">EDGELOCK2GO_KEYID_RSA</code><a class="headerlink" href="#c.EDGELOCK2GO_KEYID_RSA" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="macro">
<dt id="c.EDGELOCK2GO_KEYSTORE_ID">
<span class="target" id="group__edgelock2go__agent__main_1ga754a6a696b6f261751f3fcc57f78fd75"></span><code class="sig-name descname">EDGELOCK2GO_KEYSTORE_ID</code><a class="headerlink" href="#c.EDGELOCK2GO_KEYSTORE_ID" title="Permalink to this definition"></a></dt>
<dd><p>The keystore that stores the credentials for the EdgeLock 2GO cloud service. </p>
<p>When connecting to the EdgeLock 2GO cloud service, for the client authentication a private key is required. This key is expected to be in a keystore which is registered to the EdgeLock 2GO agent.</p>
<p>In case there is a datastore which holds the information how to connect to the EdgeLock 2GO cloud service this datastore also holds the information where to get the private key.</p>
<p>In case the EdgeLock 2GO agent needs to fall back to compile-time constant connection information, it does assume that the private key for the client authentication is stored in a keystore that is registered with this ID. </p>
</dd></dl>
<dl class="macro">
<dt id="c.EDGELOCK2GO_MANAGED_SERVICE_KEY_MAX">
<span class="target" id="group__edgelock2go__agent__main_1gaef74156f44f464a2d823777ccb875001"></span><code class="sig-name descname">EDGELOCK2GO_MANAGED_SERVICE_KEY_MAX</code><a class="headerlink" href="#c.EDGELOCK2GO_MANAGED_SERVICE_KEY_MAX" title="Permalink to this definition"></a></dt>
<dd><p>&#64; brief End of the range of keys to use for keys of cloud services provisioned by EdgeLock 2GO. </p>
</dd></dl>
<dl class="macro">
<dt id="c.EDGELOCK2GO_MANAGED_SERVICE_KEY_MIN">
<span class="target" id="group__edgelock2go__agent__main_1ga42d607d00a8fb01b642d9a33ef83b64b"></span><code class="sig-name descname">EDGELOCK2GO_MANAGED_SERVICE_KEY_MIN</code><a class="headerlink" href="#c.EDGELOCK2GO_MANAGED_SERVICE_KEY_MIN" title="Permalink to this definition"></a></dt>
<dd><p>&#64; brief Start of the range of keys to use for keys of cloud services provisioned by EdgeLock 2GO. </p>
</dd></dl>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Typedefs</p>
<dl class="type">
<dt id="_CPPv426nxp_iot_UpdateStatusReport">
<span id="_CPPv326nxp_iot_UpdateStatusReport"></span><span id="_CPPv226nxp_iot_UpdateStatusReport"></span><span id="nxp_iot_UpdateStatusReport"></span><span class="target" id="group__edgelock2go__agent__main_1gab2249405be1380580455850f39f59939"></span><em class="property">typedef </em><em class="property">struct</em> _nxp_iot_UpdateStatusReport <code class="sig-name descname">nxp_iot_UpdateStatusReport</code><br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv410pb_field_t">
<span id="_CPPv310pb_field_t"></span><span id="_CPPv210pb_field_t"></span><span id="pb_field_t"></span><span class="target" id="group__edgelock2go__agent__main_1ga53c667ab2ba4e188fee712d355418904"></span><em class="property">typedef </em><em class="property">struct</em> pb_field_s <code class="sig-name descname">pb_field_t</code><br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv412pb_istream_t">
<span id="_CPPv312pb_istream_t"></span><span id="_CPPv212pb_istream_t"></span><span id="pb_istream_t"></span><span class="target" id="group__edgelock2go__agent__main_1gae4a0d49c85b2eb9e3497a4352aa0db63"></span><em class="property">typedef </em><em class="property">struct</em> pb_istream_s <code class="sig-name descname">pb_istream_t</code><br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv412pb_ostream_t">
<span id="_CPPv312pb_ostream_t"></span><span id="_CPPv212pb_ostream_t"></span><span id="pb_ostream_t"></span><span class="target" id="group__edgelock2go__agent__main_1ga0a2d46c69fdcda81627431d7b58b0bac"></span><em class="property">typedef </em><em class="property">struct</em> pb_ostream_s <code class="sig-name descname">pb_ostream_t</code><br /></dt>
<dd></dd></dl>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv433iot_agent_free_service_descriptorP25nxp_iot_ServiceDescriptor">
<span id="_CPPv333iot_agent_free_service_descriptorP25nxp_iot_ServiceDescriptor"></span><span id="_CPPv233iot_agent_free_service_descriptorP25nxp_iot_ServiceDescriptor"></span><span id="iot_agent_free_service_descriptor__nxp_iot_ServiceDescriptorP"></span><span class="target" id="group__edgelock2go__agent__main_1gae44d7181d9296a1c579cabbbd595c969"></span>void <code class="sig-name descname">iot_agent_free_service_descriptor</code><span class="sig-paren">(</span>nxp_iot_ServiceDescriptor *<em>service_descriptor</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Free all FT_POINTER fields of a service descriptor. </p>
<p>When selecting a service, a service descriptor is read from a datastore. A service descriptor can contain fields of variable length (binary data (certificates, etc.) or text (hostname, etc.)). Those fields use dynamically allocated memory. The memory is freed by calling this function.</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">service_descriptor</span></code>: Reference to service descriptor </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv435iot_agent_free_update_status_reportP26nxp_iot_UpdateStatusReport">
<span id="_CPPv335iot_agent_free_update_status_reportP26nxp_iot_UpdateStatusReport"></span><span id="_CPPv235iot_agent_free_update_status_reportP26nxp_iot_UpdateStatusReport"></span><span id="iot_agent_free_update_status_report__nxp_iot_UpdateStatusReportP"></span><span class="target" id="group__edgelock2go__agent__main_1gad80c3da3fbfe2ec6df7a7daf7a98d058"></span>void <code class="sig-name descname">iot_agent_free_update_status_report</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__main_1gab2249405be1380580455850f39f59939.html#_CPPv426nxp_iot_UpdateStatusReport" title="nxp_iot_UpdateStatusReport">nxp_iot_UpdateStatusReport</a> *<em>status_report</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Free all FT_POINTER fields of a update status report. </p>
<p>When a status report is filled during updating a device configuration, it contains pointer fields which use dynamically allocated memory. The memory is freed by calling this function.</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">status_report</span></code>: Reference to status_report </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv429iot_agent_get_datastore_by_idPK19iot_agent_context_tK8uint32_tPP21iot_agent_datastore_t">
<span id="_CPPv329iot_agent_get_datastore_by_idPK19iot_agent_context_tK8uint32_tPP21iot_agent_datastore_t"></span><span id="_CPPv229iot_agent_get_datastore_by_idPK19iot_agent_context_tK8uint32_tPP21iot_agent_datastore_t"></span><span id="iot_agent_get_datastore_by_id__iot_agent_context_tCP.uint32_tC.iot_agent_datastore_tPP"></span><span class="target" id="group__edgelock2go__agent__main_1gafbec62888bd0409bcb32f0db92c92a99"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_get_datastore_by_id</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, <em class="property">const</em> uint32_t <em>id</em>, <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> **<em>datastore</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get a reference to a datastore based on its identifier. </p>
<p><dl class="simple">
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_STATUS_SUCCESS</span></code>: A datastore with the <code class="docutils literal notranslate"><span class="pre">id</span></code> was found in the agent’s context and a pointer to it is returned in <code class="docutils literal notranslate"><span class="pre">datastore</span></code>. </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv435iot_agent_get_datastore_index_by_idPK19iot_agent_context_tK8uint32_tP6size_t">
<span id="_CPPv335iot_agent_get_datastore_index_by_idPK19iot_agent_context_tK8uint32_tP6size_t"></span><span id="_CPPv235iot_agent_get_datastore_index_by_idPK19iot_agent_context_tK8uint32_tP6size_t"></span><span id="iot_agent_get_datastore_index_by_id__iot_agent_context_tCP.uint32_tC.sP"></span><span class="target" id="group__edgelock2go__agent__main_1ga89880296390b5896ce2d8982b7ce0c3b"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_get_datastore_index_by_id</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, <em class="property">const</em> uint32_t <em>id</em>, size_t *<em>index</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get the index of a datastore based on its identifier. </p>
<p><dl class="simple">
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_STATUS_SUCCESS</span></code>: A datastore with the <code class="docutils literal notranslate"><span class="pre">id</span></code> was found in the agent’s context and its index is returned in <code class="docutils literal notranslate"><span class="pre">index</span></code>. </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv427iot_agent_get_endpoint_infoPvPv">
<span id="_CPPv327iot_agent_get_endpoint_infoPvPv"></span><span id="_CPPv227iot_agent_get_endpoint_infoPvPv"></span><span id="iot_agent_get_endpoint_info__voidP.voidP"></span><span class="target" id="group__edgelock2go__agent__main_1ga22bd060df9afa42dd3d18b895f5ac931"></span>bool <code class="sig-name descname">iot_agent_get_endpoint_info</code><span class="sig-paren">(</span>void *<em>context</em>, void *<em>endpoint_information</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get an endpoint information of the endpoint. </p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">context</span></code>: Reference to end point context </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">endpoint_information</span></code>: Reference to end point information </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv428iot_agent_get_keystore_by_idPK19iot_agent_context_tK8uint32_tPP20iot_agent_keystore_t">
<span id="_CPPv328iot_agent_get_keystore_by_idPK19iot_agent_context_tK8uint32_tPP20iot_agent_keystore_t"></span><span id="_CPPv228iot_agent_get_keystore_by_idPK19iot_agent_context_tK8uint32_tPP20iot_agent_keystore_t"></span><span id="iot_agent_get_keystore_by_id__iot_agent_context_tCP.uint32_tC.iot_agent_keystore_tPP"></span><span class="target" id="group__edgelock2go__agent__main_1ga496f68d413ea7f3e6220591c6928bd40"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_get_keystore_by_id</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, <em class="property">const</em> uint32_t <em>id</em>, <a class="reference internal" href="../../api/structiot__agent__keystore__t.html#_CPPv420iot_agent_keystore_t" title="iot_agent_keystore_t">iot_agent_keystore_t</a> **<em>keystore</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get a reference to a keystore based on its identifier. </p>
<p><dl class="simple">
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_STATUS_SUCCESS</span></code>: A keystore with the <code class="docutils literal notranslate"><span class="pre">id</span></code> was found in the agent’s context and a pointer to it is returned in <code class="docutils literal notranslate"><span class="pre">keystore</span></code>. </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv434iot_agent_get_keystore_index_by_idPK19iot_agent_context_tK8uint32_tP6size_t">
<span id="_CPPv334iot_agent_get_keystore_index_by_idPK19iot_agent_context_tK8uint32_tP6size_t"></span><span id="_CPPv234iot_agent_get_keystore_index_by_idPK19iot_agent_context_tK8uint32_tP6size_t"></span><span id="iot_agent_get_keystore_index_by_id__iot_agent_context_tCP.uint32_tC.sP"></span><span class="target" id="group__edgelock2go__agent__main_1ga15e3c712f348cd18fadca0480f595381"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_get_keystore_index_by_id</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, <em class="property">const</em> uint32_t <em>id</em>, size_t *<em>index</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get the index of a keystore based in its identifier. </p>
<p><dl class="simple">
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_STATUS_SUCCESS</span></code>: A keystore with the <code class="docutils literal notranslate"><span class="pre">id</span></code> was found in the agent’s context and its index is returned in <code class="docutils literal notranslate"><span class="pre">index</span></code>. </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv432iot_agent_get_number_of_servicesPK19iot_agent_context_t">
<span id="_CPPv332iot_agent_get_number_of_servicesPK19iot_agent_context_t"></span><span id="_CPPv232iot_agent_get_number_of_servicesPK19iot_agent_context_t"></span><span id="iot_agent_get_number_of_services__iot_agent_context_tCP"></span><span class="target" id="group__edgelock2go__agent__main_1ga8fa2402aa9f54ecc80fa1a1e261eedf9"></span>size_t <code class="sig-name descname">iot_agent_get_number_of_services</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Returns total number of services of all registered datastores. </p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: Context for the iot_agent. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">Total</span></code>: number of services of all registered datastores </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv432iot_agent_get_service_descriptorPK19iot_agent_context_tP25nxp_iot_ServiceDescriptor">
<span id="_CPPv332iot_agent_get_service_descriptorPK19iot_agent_context_tP25nxp_iot_ServiceDescriptor"></span><span id="_CPPv232iot_agent_get_service_descriptorPK19iot_agent_context_tP25nxp_iot_ServiceDescriptor"></span><span id="iot_agent_get_service_descriptor__iot_agent_context_tCP.nxp_iot_ServiceDescriptorP"></span><span class="target" id="group__edgelock2go__agent__main_1gad27a145a00af3cdd10785e0734a273b1"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_get_service_descriptor</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, nxp_iot_ServiceDescriptor *<em>service_descriptor</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get the service descriptor of the currently selected service. </p>
<p><dl class="simple">
<dt><strong>Pre</strong></dt><dd><p>The configuration data associated to the context is valid. </p>
</dd>
<dt><strong>Post</strong></dt><dd><p>In case of success, the service_descriptor structure is filled and needs to be freed after usage by calling <a class="reference internal" href="#group__edgelock2go__agent__main_1gae44d7181d9296a1c579cabbbd595c969"><span class="std std-ref">iot_agent_free_service_descriptor</span></a>. In case of failure no freeing is required. Also in case of failures, the contents of service_descriptor are not guaranteed to remain intact. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: The context of the agent. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">service_descriptor</span></code>: Structure for holding a service descriptor. Must point to a valid service descriptor object upon invocation. Any FT_POINTER fields in the service descriptor are freed before changing the contents to the service_descriptor of the selected service. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv424iot_agent_handle_requestP12pb_istream_tP12pb_ostream_tPK10pb_field_tPv">
<span id="_CPPv324iot_agent_handle_requestP12pb_istream_tP12pb_ostream_tPK10pb_field_tPv"></span><span id="_CPPv224iot_agent_handle_requestP12pb_istream_tP12pb_ostream_tPK10pb_field_tPv"></span><span id="iot_agent_handle_request__pb_istream_tP.pb_ostream_tP.pb_field_tCP.voidP"></span><span class="target" id="group__edgelock2go__agent__main_1ga420d54f861d8db01cfeca7e92756a520"></span>bool <code class="sig-name descname">iot_agent_handle_request</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__keystore_1gae4a0d49c85b2eb9e3497a4352aa0db63.html#_CPPv412pb_istream_t" title="pb_istream_t">pb_istream_t</a> *<em>istream</em>, <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__keystore_1ga0a2d46c69fdcda81627431d7b58b0bac.html#_CPPv412pb_ostream_t" title="pb_ostream_t">pb_ostream_t</a> *<em>ostream</em>, <em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__keystore_1ga53c667ab2ba4e188fee712d355418904.html#_CPPv410pb_field_t" title="pb_field_t">pb_field_t</a> *<em>message_type</em>, void *<em>context</em><span class="sig-paren">)</span><br /></dt>
<dd><p>handle request by end point </p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">istream</span></code>: Input stream </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ostream</span></code>: Output stream </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">message_type</span></code>: a pointer to the message type fields array </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">context</span></code>: End point context </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv414iot_agent_initP19iot_agent_context_t">
<span id="_CPPv314iot_agent_initP19iot_agent_context_t"></span><span id="_CPPv214iot_agent_initP19iot_agent_context_t"></span><span id="iot_agent_init__iot_agent_context_tP"></span><span class="target" id="group__edgelock2go__agent__main_1ga3d319341cacd8b6584cf4e45ff5cbd1b"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_init</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initialize EdgeLock 2GO agent context memory with zeros. </p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[inout]</span> <span class="pre">ctx</span></code>: EdgeLock 2GO agent context </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv425iot_agent_init_dispatcherP30iot_agent_dispatcher_context_tP19iot_agent_context_tP25nxp_iot_ServiceDescriptorP26nxp_iot_UpdateStatusReport">
<span id="_CPPv325iot_agent_init_dispatcherP30iot_agent_dispatcher_context_tP19iot_agent_context_tP25nxp_iot_ServiceDescriptorP26nxp_iot_UpdateStatusReport"></span><span id="_CPPv225iot_agent_init_dispatcherP30iot_agent_dispatcher_context_tP19iot_agent_context_tP25nxp_iot_ServiceDescriptorP26nxp_iot_UpdateStatusReport"></span><span id="iot_agent_init_dispatcher__iot_agent_dispatcher_context_tP.iot_agent_context_tP.nxp_iot_ServiceDescriptorP.nxp_iot_UpdateStatusReportP"></span><span class="target" id="group__edgelock2go__agent__main_1gaa1fdd657ab1b085e9bab7f34e5c0ce57"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_init_dispatcher</code><span class="sig-paren">(</span>iot_agent_dispatcher_context_t *<em>dispatcher_context</em>, <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>agent_context</em>, nxp_iot_ServiceDescriptor *<em>service_descriptor</em>, <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__main_1gab2249405be1380580455850f39f59939.html#_CPPv426nxp_iot_UpdateStatusReport" title="nxp_iot_UpdateStatusReport">nxp_iot_UpdateStatusReport</a> *<em>status_report</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initialize Dispatcher. </p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">dispatcher_context</span></code>: Context for the dispatcher </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">agent_context</span></code>: Context for the agent </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">service_descriptor</span></code>: The service descriptor containing the connection parameters to connect to the EdgeLock 2GO cloud service. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">status_report</span></code>: A pointer to a structure that gets filled with a status report after the update is complete. If NULL is given, no status report is created. </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv445iot_agent_is_service_configuration_data_validPK19iot_agent_context_t">
<span id="_CPPv345iot_agent_is_service_configuration_data_validPK19iot_agent_context_t"></span><span id="_CPPv245iot_agent_is_service_configuration_data_validPK19iot_agent_context_t"></span><span id="iot_agent_is_service_configuration_data_valid__iot_agent_context_tCP"></span><span class="target" id="group__edgelock2go__agent__main_1gaedf5ee6f479c0313c4d5b0b2ef3d0d91"></span>bool <code class="sig-name descname">iot_agent_is_service_configuration_data_valid</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Checks whether service configuration data of all registered datastores is valid. </p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: Context for the iot_agent. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">true</span></code>: Service configuration data of all registered datastores is valid </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">false</span></code>: Service configuration data of a registered datastores is invalid </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv428iot_agent_register_datastoreP19iot_agent_context_tP21iot_agent_datastore_t">
<span id="_CPPv328iot_agent_register_datastoreP19iot_agent_context_tP21iot_agent_datastore_t"></span><span id="_CPPv228iot_agent_register_datastoreP19iot_agent_context_tP21iot_agent_datastore_t"></span><span id="iot_agent_register_datastore__iot_agent_context_tP.iot_agent_datastore_tP"></span><span class="target" id="group__edgelock2go__agent__main_1ga97c59a62f882a78f7adc24d18d54663b"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_register_datastore</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> *<em>datastore</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Register datastore endpoint. </p>
<p>Note that the ownership for the datastore is not transferred. The caller is responsible that the datastore is freed at the appropriate time.</p>
<p>It is not possible to register two endpoints with the same identifier.</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: Context for the iot_agent. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">datastore</span></code>: Datastore that is registered.</p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv427iot_agent_register_keystoreP19iot_agent_context_tP20iot_agent_keystore_t">
<span id="_CPPv327iot_agent_register_keystoreP19iot_agent_context_tP20iot_agent_keystore_t"></span><span id="_CPPv227iot_agent_register_keystoreP19iot_agent_context_tP20iot_agent_keystore_t"></span><span id="iot_agent_register_keystore__iot_agent_context_tP.iot_agent_keystore_tP"></span><span class="target" id="group__edgelock2go__agent__main_1gae8e32224660e4e59e7717f32a75406cc"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_register_keystore</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, <a class="reference internal" href="../../api/structiot__agent__keystore__t.html#_CPPv420iot_agent_keystore_t" title="iot_agent_keystore_t">iot_agent_keystore_t</a> *<em>keystore</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Register a keystore endpoint. </p>
<p>Note that the ownership for the keystore is not transferred. The caller is responsible that the keystore is freed at the appropriate time.</p>
<p>It is not possible to register two endpoints with the same identifier.</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ctx</span></code>: Context for the iot_agent. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">keystore</span></code>: Keystore that is registered.</p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv430iot_agent_select_service_by_idP19iot_agent_context_t8uint64_tP25nxp_iot_ServiceDescriptor">
<span id="_CPPv330iot_agent_select_service_by_idP19iot_agent_context_t8uint64_tP25nxp_iot_ServiceDescriptor"></span><span id="_CPPv230iot_agent_select_service_by_idP19iot_agent_context_t8uint64_tP25nxp_iot_ServiceDescriptor"></span><span id="iot_agent_select_service_by_id__iot_agent_context_tP.uint64_t.nxp_iot_ServiceDescriptorP"></span><span class="target" id="group__edgelock2go__agent__main_1ga137f3fc96f3f26b26574e73c739c232c"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_select_service_by_id</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, uint64_t <em>service_id</em>, nxp_iot_ServiceDescriptor *<em>service_descriptor</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Select service by given ID. </p>
<p><dl class="simple">
<dt><strong>Pre</strong></dt><dd><p>The configuration data associated to the context is valid. </p>
</dd>
<dt><strong>Post</strong></dt><dd><p>In case of success, the service_descriptor structure is filled and needs to be freed after usage by calling <a class="reference internal" href="#group__edgelock2go__agent__main_1gae44d7181d9296a1c579cabbbd595c969"><span class="std std-ref">iot_agent_free_service_descriptor</span></a>. In case of failure no freeing is required. Also in case of failures, the contents of service_descriptor are not guaranteed to remain intact. </p>
</dd>
<dt><strong>See</strong></dt><dd><p><a class="reference internal" href="#group__edgelock2go__agent__main_1gaedf5ee6f479c0313c4d5b0b2ef3d0d91"><span class="std std-ref">iot_agent_is_service_configuration_data_valid</span></a> </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: Context for the iot_agent. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">service_id</span></code>: ID of the service </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">service_descriptor</span></code>: Structure for holding a service descriptor. Must point to a valid service descriptor object upon invocation. Any FT_POINTER fields in the service descriptor are freed before changing the contents to the service_descriptor of the selected service. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv433iot_agent_select_service_by_indexP19iot_agent_context_t6size_tP25nxp_iot_ServiceDescriptor">
<span id="_CPPv333iot_agent_select_service_by_indexP19iot_agent_context_t6size_tP25nxp_iot_ServiceDescriptor"></span><span id="_CPPv233iot_agent_select_service_by_indexP19iot_agent_context_t6size_tP25nxp_iot_ServiceDescriptor"></span><span id="iot_agent_select_service_by_index__iot_agent_context_tP.s.nxp_iot_ServiceDescriptorP"></span><span class="target" id="group__edgelock2go__agent__main_1ga08c22d4e5c33b1e0270d46f45ac812e5"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_select_service_by_index</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, size_t <em>index</em>, nxp_iot_ServiceDescriptor *<em>service_descriptor</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Select service by given index. </p>
<p><dl class="simple">
<dt><strong>Pre</strong></dt><dd><p>The configuration data associated to the context is valid. </p>
</dd>
<dt><strong>Post</strong></dt><dd><p>In case of success, the service_descriptor structure is filled and needs to be freed after usage by calling <a class="reference internal" href="#group__edgelock2go__agent__main_1gae44d7181d9296a1c579cabbbd595c969"><span class="std std-ref">iot_agent_free_service_descriptor</span></a>. In case of failure no freeing is required. Also in case of failures, the contents of service_descriptor are not guaranteed to remain intact. </p>
</dd>
<dt><strong>See</strong></dt><dd><p><a class="reference internal" href="#group__edgelock2go__agent__main_1gaedf5ee6f479c0313c4d5b0b2ef3d0d91"><span class="std std-ref">iot_agent_is_service_configuration_data_valid</span></a> </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: Context for the iot_agent. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">index</span></code>: Index of the service </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">service_descriptor</span></code>: Structure for holding a service descriptor. Must point to a valid service descriptor object upon invocation. Any FT_POINTER fields in the service descriptor are freed before changing the contents to the service_descriptor of the selected service. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv435iot_agent_set_edgelock2go_datastoreP19iot_agent_context_tP21iot_agent_datastore_t">
<span id="_CPPv335iot_agent_set_edgelock2go_datastoreP19iot_agent_context_tP21iot_agent_datastore_t"></span><span id="_CPPv235iot_agent_set_edgelock2go_datastoreP19iot_agent_context_tP21iot_agent_datastore_t"></span><span id="iot_agent_set_edgelock2go_datastore__iot_agent_context_tP.iot_agent_datastore_tP"></span><span class="target" id="group__edgelock2go__agent__main_1ga3b71b3a97a1f71e153e0a608af3e9fbd"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_set_edgelock2go_datastore</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> *<em>datastore</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Set the datastore that is used to hold the information to connect to the EdgeLock 2GO cloud service. </p>
<p>Note that the ownership for the datastore is not transferred. The caller is responsible that the datastore is freed at the appropriate time. </p>
</dd></dl>
<dl class="function">
<dt id="_CPPv437iot_agent_update_device_configurationP19iot_agent_context_tP26nxp_iot_UpdateStatusReport">
<span id="_CPPv337iot_agent_update_device_configurationP19iot_agent_context_tP26nxp_iot_UpdateStatusReport"></span><span id="_CPPv237iot_agent_update_device_configurationP19iot_agent_context_tP26nxp_iot_UpdateStatusReport"></span><span id="iot_agent_update_device_configuration__iot_agent_context_tP.nxp_iot_UpdateStatusReportP"></span><span class="target" id="group__edgelock2go__agent__main_1ga19a73207ea5c87bf8373556477f85969"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_update_device_configuration</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>ctx</em>, <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__main_1gab2249405be1380580455850f39f59939.html#_CPPv426nxp_iot_UpdateStatusReport" title="nxp_iot_UpdateStatusReport">nxp_iot_UpdateStatusReport</a> *<em>status_report</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Update device configuration Reach out to EdgeLock 2GO cloud service for checking and (if applicable) fetching configuration updates for the device. </p>
<p><dl class="simple">
<dt><strong>Post</strong></dt><dd><p>In case of success, the status_report structure is filled using dynamically allocated fields and needs to be freed after usage by calling #iot_agent_free_status_report.</p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: Context for the iot_agent. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">status_report</span></code>: Provides a more detailed view on the operations performed during the update and its outcomes. If the argument is NULL, no detailed status is reported. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_FAILURE</span></code>: Upon failure </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv452iot_agent_update_device_configuration_from_constantsP19iot_agent_context_t8uint32_t8uint32_tP26nxp_iot_UpdateStatusReport">
<span id="_CPPv352iot_agent_update_device_configuration_from_constantsP19iot_agent_context_t8uint32_t8uint32_tP26nxp_iot_UpdateStatusReport"></span><span id="_CPPv252iot_agent_update_device_configuration_from_constantsP19iot_agent_context_t8uint32_t8uint32_tP26nxp_iot_UpdateStatusReport"></span><span id="iot_agent_update_device_configuration_from_constants__iot_agent_context_tP.uint32_t.uint32_t.nxp_iot_UpdateStatusReportP"></span><span class="target" id="group__edgelock2go__agent__main_1ga81b5b048bab95dca633d21bc6893f811"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_update_device_configuration_from_constants</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> *<em>agent_context</em>, uint32_t <em>client_key_object_id</em>, uint32_t <em>client_cert_object_id</em>, <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__main_1gab2249405be1380580455850f39f59939.html#_CPPv426nxp_iot_UpdateStatusReport" title="nxp_iot_UpdateStatusReport">nxp_iot_UpdateStatusReport</a> *<em>status_report</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Update device configuration. </p>
<p>Reach out to EdgeLock 2GO cloud service for checking and (if applicable) fetching configuration updates for the device.</p>
<p>The connection details (hostname/port/server root certificates, etc.) are taken from the configuration constants in nxp_iot_agent_config.h.</p>
<p>It is necessary that an sss keystore that contains credentials (client key and client certificate) for connecting to the EdgeLock 2GO cloud service. The object ids to those credentials are settable via function arguments.</p>
<p><dl class="simple">
<dt><strong>Post</strong></dt><dd><p>In case of success, the status_report structure is filled using dynamically allocated fields and needs to be freed after usage by calling #iot_agent_free_status_report.</p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: Context for the iot_agent. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">status_report</span></code>: Provides a more detailed view on the operations performed during the update and its outcomes. If the argument is NULL, no detailed status is reported. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_FAILURE</span></code>: Upon failure </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
</div>
</dd></dl>
</div>
<div class="section" id="edgelock-2go-datastore">
<h2><span class="section-number">6.6.2. </span>EdgeLock 2GO Datastore<a class="headerlink" href="#edgelock-2go-datastore" title="Permalink to this headline"></a></h2>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>doxygengroup: Cannot find namespace “edgelock2go_agent_datastore” in doxygen xml output for project “simw” from directory: ../../../../_docs_build_simw/xml</p>
</div>
</div>
<div class="section" id="edgelock-2go-keystore">
<h2><span class="section-number">6.6.3. </span>EdgeLock 2GO Keystore<a class="headerlink" href="#edgelock-2go-keystore" title="Permalink to this headline"></a></h2>
<dl class="group">
<dt>
<span class="target" id="group__edgelock2go__agent__keystore"></span><em>group</em> <code class="sig-name descname">edgelock2go_agent_keystore</code></dt>
<dd><p>Functions to interact with a keystore. There are concrete implementations of this API for different SEs. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Typedefs</p>
<dl class="type">
<dt id="_CPPv430iot_agent_keystore_destroyer_t">
<span id="_CPPv330iot_agent_keystore_destroyer_t"></span><span id="_CPPv230iot_agent_keystore_destroyer_t"></span><span id="iot_agent_keystore_destroyer_t"></span><span class="target" id="group__edgelock2go__agent__keystore_1ga84e75352baa7734cf7c65f8e637734b3"></span><em class="property">typedef </em>iot_agent_status_t (*<code class="sig-name descname">iot_agent_keystore_destroyer_t</code>)<span class="sig-paren">(</span>void *context<span class="sig-paren">)</span><br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv435iot_agent_keystore_session_closer_t">
<span id="_CPPv335iot_agent_keystore_session_closer_t"></span><span id="_CPPv235iot_agent_keystore_session_closer_t"></span><span id="iot_agent_keystore_session_closer_t"></span><span class="target" id="group__edgelock2go__agent__keystore_1ga73c1db1145825b2ceea8badd52b05bde"></span><em class="property">typedef </em>void (*<code class="sig-name descname">iot_agent_keystore_session_closer_t</code>)<span class="sig-paren">(</span>void *context<span class="sig-paren">)</span><br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv435iot_agent_keystore_session_opener_t">
<span id="_CPPv335iot_agent_keystore_session_opener_t"></span><span id="_CPPv235iot_agent_keystore_session_opener_t"></span><span id="iot_agent_keystore_session_opener_t"></span><span class="target" id="group__edgelock2go__agent__keystore_1gac9faa443d2901e3bda2728e2f0e45099"></span><em class="property">typedef </em>iot_agent_status_t (*<code class="sig-name descname">iot_agent_keystore_session_opener_t</code>)<span class="sig-paren">(</span>void *context<span class="sig-paren">)</span><br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv410pb_field_t">
<span id="_CPPv310pb_field_t"></span><span id="_CPPv210pb_field_t"></span><span class="target" id="group__edgelock2go__agent__keystore_1ga53c667ab2ba4e188fee712d355418904"></span><em class="property">typedef </em><em class="property">struct</em> pb_field_s <code class="sig-name descname">pb_field_t</code><br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv412pb_istream_t">
<span id="_CPPv312pb_istream_t"></span><span id="_CPPv212pb_istream_t"></span><span class="target" id="group__edgelock2go__agent__keystore_1gae4a0d49c85b2eb9e3497a4352aa0db63"></span><em class="property">typedef </em><em class="property">struct</em> pb_istream_s <code class="sig-name descname">pb_istream_t</code><br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv412pb_ostream_t">
<span id="_CPPv312pb_ostream_t"></span><span id="_CPPv212pb_ostream_t"></span><span class="target" id="group__edgelock2go__agent__keystore_1ga0a2d46c69fdcda81627431d7b58b0bac"></span><em class="property">typedef </em><em class="property">struct</em> pb_ostream_s <code class="sig-name descname">pb_ostream_t</code><br /></dt>
<dd></dd></dl>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv432iot_agent_keystore_close_sessionP20iot_agent_keystore_t">
<span id="_CPPv332iot_agent_keystore_close_sessionP20iot_agent_keystore_t"></span><span id="_CPPv232iot_agent_keystore_close_sessionP20iot_agent_keystore_t"></span><span id="iot_agent_keystore_close_session__iot_agent_keystore_tP"></span><span class="target" id="group__edgelock2go__agent__keystore_1ga56c09420646b32d60bfffee45af72b4d"></span>void <code class="sig-name descname">iot_agent_keystore_close_session</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/structiot__agent__keystore__t.html#_CPPv420iot_agent_keystore_t" title="iot_agent_keystore_t">iot_agent_keystore_t</a> *<em>keystore</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Close a session/connection to a keystore. </p>
</dd></dl>
<dl class="function">
<dt id="_CPPv423iot_agent_keystore_freeP20iot_agent_keystore_t">
<span id="_CPPv323iot_agent_keystore_freeP20iot_agent_keystore_t"></span><span id="_CPPv223iot_agent_keystore_freeP20iot_agent_keystore_t"></span><span id="iot_agent_keystore_free__iot_agent_keystore_tP"></span><span class="target" id="group__edgelock2go__agent__keystore_1ga4a5c5653e5b414f56989d1880d321b2d"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_keystore_free</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/structiot__agent__keystore__t.html#_CPPv420iot_agent_keystore_t" title="iot_agent_keystore_t">iot_agent_keystore_t</a> *<em>keystore</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Destroy the keystore. </p>
<p>Depending on the type of the keystore this is triggering actions on the keystore’s context itself by calling the _destroy() function of the keystore interface.</p>
<p>This does not free the context of the keystore.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">keystore</span></code> is not usable after a call to iot_agent_keystore_free. </p>
</dd></dl>
<dl class="function">
<dt id="_CPPv431iot_agent_keystore_open_sessionP20iot_agent_keystore_t">
<span id="_CPPv331iot_agent_keystore_open_sessionP20iot_agent_keystore_t"></span><span id="_CPPv231iot_agent_keystore_open_sessionP20iot_agent_keystore_t"></span><span id="iot_agent_keystore_open_session__iot_agent_keystore_tP"></span><span class="target" id="group__edgelock2go__agent__keystore_1ga3f38c9f13daf3f3c792d1fe0e6ca71c6"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_keystore_open_session</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/structiot__agent__keystore__t.html#_CPPv420iot_agent_keystore_t" title="iot_agent_keystore_t">iot_agent_keystore_t</a> *<em>keystore</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Open a session/connection to a keystore. </p>
</dd></dl>
</div>
<dl class="class">
<dt id="_CPPv430iot_agent_keystore_interface_t">
<span id="_CPPv330iot_agent_keystore_interface_t"></span><span id="_CPPv230iot_agent_keystore_interface_t"></span><span id="iot_agent_keystore_interface_t"></span><span class="target" id="structiot__agent__keystore__interface__t"></span><em class="property">struct </em><code class="sig-name descname">iot_agent_keystore_interface_t</code><br /></dt>
<dd><em>#include &lt;nxp_iot_agent_keystore.h&gt;</em><p>The interface any keystore needs to implement. </p>
</dd></dl>
<dl class="class">
<dt id="_CPPv420iot_agent_keystore_t">
<span id="_CPPv320iot_agent_keystore_t"></span><span id="_CPPv220iot_agent_keystore_t"></span><span id="iot_agent_keystore_t"></span><span class="target" id="structiot__agent__keystore__t"></span><em class="property">struct </em><code class="sig-name descname">iot_agent_keystore_t</code><br /></dt>
<dd><em>#include &lt;nxp_iot_agent_keystore.h&gt;</em><p>A structure binding a keystore interface and a keystore context to a keystore instance. </p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="edgelock-2go-session">
<h2><span class="section-number">6.6.4. </span>EdgeLock 2GO Session<a class="headerlink" href="#edgelock-2go-session" title="Permalink to this headline"></a></h2>
<dl class="group">
<dt>
<span class="target" id="group__edgelock2go__agent__session"></span><em>group</em> <code class="sig-name descname">edgelock2go_agent_session</code></dt>
<dd><p>Session handling functions for the EdgeLock 2GO agent. When interacting with the OpenSSL engine, the agent session needs to be closed before and opened after OpenSSL is active. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv425iot_agent_session_connectP17ex_sss_boot_ctx_t">
<span id="_CPPv325iot_agent_session_connectP17ex_sss_boot_ctx_t"></span><span id="_CPPv225iot_agent_session_connectP17ex_sss_boot_ctx_t"></span><span id="iot_agent_session_connect__ex_sss_boot_ctx_tP"></span><span class="target" id="group__edgelock2go__agent__session_1gaee4e04dd367504b190661b8c92824ce4"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_session_connect</code><span class="sig-paren">(</span>ex_sss_boot_ctx_t *<em>pSeBootCtx</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Re-create an open a session with secure element</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">pCtx</span></code>: pointer to session context</p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: upon success </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_FAILURE</span></code>: upon failure </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv428iot_agent_session_disconnectP17ex_sss_boot_ctx_t">
<span id="_CPPv328iot_agent_session_disconnectP17ex_sss_boot_ctx_t"></span><span id="_CPPv228iot_agent_session_disconnectP17ex_sss_boot_ctx_t"></span><span id="iot_agent_session_disconnect__ex_sss_boot_ctx_tP"></span><span class="target" id="group__edgelock2go__agent__session_1ga1e578adf73adb8b88fd9a33fc56bbe74"></span>void <code class="sig-name descname">iot_agent_session_disconnect</code><span class="sig-paren">(</span>ex_sss_boot_ctx_t *<em>pSeBootCtx</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Disconnect and close session with secure element</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">pCtx</span></code>: pointer to session context </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv422iot_agent_session_initiA_PKcP17ex_sss_boot_ctx_t">
<span id="_CPPv322iot_agent_session_initiA_PKcP17ex_sss_boot_ctx_t"></span><span id="_CPPv222iot_agent_session_initiA_PKcP17ex_sss_boot_ctx_t"></span><span id="iot_agent_session_init__i.cCPA.ex_sss_boot_ctx_tP"></span><span class="target" id="group__edgelock2go__agent__session_1ga7fd7789182190d0561fbb548f67ba9e1"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_session_init</code><span class="sig-paren">(</span>int <em>argc</em>, <em class="property">const</em> char *<em>argv</em>[], ex_sss_boot_ctx_t *<em>pCtx</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Create an open a session with secure element</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">argc</span></code>: arguments from command-line if any </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">argv</span></code>: arguments from command-line if any </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">pCtx</span></code>: pointer to session context</p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: upon success </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_FAILURE</span></code>: upon failure </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
</div>
</dd></dl>
</div>
<div class="section" id="edgelock-2go-service">
<h2><span class="section-number">6.6.5. </span>EdgeLock 2GO Service<a class="headerlink" href="#edgelock-2go-service" title="Permalink to this headline"></a></h2>
<dl class="group">
<dt>
<span class="target" id="group__edgelock2go__agent__service"></span><em>group</em> <code class="sig-name descname">edgelock2go_agent_service</code></dt>
<dd><p>Functionality to work with service descriptors. A service descriptor represents all information from a single cloud provisioning. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.IOT_AGENT_CONFIGURATION_DATA_VERSION">
<span class="target" id="group__edgelock2go__agent__service_1ga1e78c2e46a5aa6aaa91b2d9d5e83ab08"></span><code class="sig-name descname">IOT_AGENT_CONFIGURATION_DATA_VERSION</code><a class="headerlink" href="#c.IOT_AGENT_CONFIGURATION_DATA_VERSION" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Typedefs</p>
<dl class="type">
<dt id="_CPPv427configuration_data_header_t">
<span id="_CPPv327configuration_data_header_t"></span><span id="_CPPv227configuration_data_header_t"></span><span id="configuration_data_header_t"></span><span class="target" id="group__edgelock2go__agent__service_1ga92b8531a760739e75135c75edec63725"></span><em class="property">typedef </em><code class="sig-name descname">configuration_data_header_t</code><br /></dt>
<dd><p>The header of configuration data stored in a datastore. </p>
</dd></dl>
<dl class="type">
<dt id="_CPPv421iot_agent_datastore_t">
<span id="_CPPv321iot_agent_datastore_t"></span><span id="_CPPv221iot_agent_datastore_t"></span><span id="iot_agent_datastore_t"></span><span class="target" id="group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b"></span><em class="property">typedef </em><em class="property">struct</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> <code class="sig-name descname">iot_agent_datastore_t</code><br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv423public_key_identifier_t">
<span id="_CPPv323public_key_identifier_t"></span><span id="_CPPv223public_key_identifier_t"></span><span id="public_key_identifier_t"></span><span class="target" id="group__edgelock2go__agent__service_1ga37547adf23bddaa757484b9f8ce0c6b9"></span><em class="property">typedef </em>uint8_t <code class="sig-name descname">public_key_identifier_t</code>[16]<br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv420service_identifier_t">
<span id="_CPPv320service_identifier_t"></span><span id="_CPPv220service_identifier_t"></span><span id="service_identifier_t"></span><span class="target" id="group__edgelock2go__agent__service_1gaf2572000d30f703bb30a5d8481b2708b"></span><em class="property">typedef </em>uint8_t <code class="sig-name descname">service_identifier_t</code>[32]<br /></dt>
<dd></dd></dl>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv441iot_agent_service_free_service_descriptorP25nxp_iot_ServiceDescriptor">
<span id="_CPPv341iot_agent_service_free_service_descriptorP25nxp_iot_ServiceDescriptor"></span><span id="_CPPv241iot_agent_service_free_service_descriptorP25nxp_iot_ServiceDescriptor"></span><span id="iot_agent_service_free_service_descriptor__nxp_iot_ServiceDescriptorP"></span><span class="target" id="group__edgelock2go__agent__service_1gada0bfe46e6734c9ea1bcac4acb1d6977"></span>void <code class="sig-name descname">iot_agent_service_free_service_descriptor</code><span class="sig-paren">(</span>nxp_iot_ServiceDescriptor *<em>service_descriptor</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Free all FT_POINTER fields of a service descriptor. </p>
<p>When selecting a service, a service descriptor is read from a datastore. A service descriptor can contain fields of variable length (binary data (certificates, etc.) or text (hostname, etc.)). Those fields use dynamically allocated memory. The memory is freed by calling this function.</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">service_descriptor</span></code>: Reference to service descriptor </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv440iot_agent_service_get_number_of_servicesPK21iot_agent_datastore_t">
<span id="_CPPv340iot_agent_service_get_number_of_servicesPK21iot_agent_datastore_t"></span><span id="_CPPv240iot_agent_service_get_number_of_servicesPK21iot_agent_datastore_t"></span><span id="iot_agent_service_get_number_of_services__iot_agent_datastore_tCP"></span><span class="target" id="group__edgelock2go__agent__service_1gad87e5cb0c9fe1aebcc5745b419a55a0d"></span>size_t <code class="sig-name descname">iot_agent_service_get_number_of_services</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> *<em>ctx</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get the number of services that are available. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>The number of services that are avilable. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: Context for the iot_agent. </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv451iot_agent_service_get_protocol_of_service_as_stringPK25nxp_iot_ServiceDescriptorPPKc">
<span id="_CPPv351iot_agent_service_get_protocol_of_service_as_stringPK25nxp_iot_ServiceDescriptorPPKc"></span><span id="_CPPv251iot_agent_service_get_protocol_of_service_as_stringPK25nxp_iot_ServiceDescriptorPPKc"></span><span id="iot_agent_service_get_protocol_of_service_as_string__nxp_iot_ServiceDescriptorCP.cCPP"></span><span class="target" id="group__edgelock2go__agent__service_1ga223b9905a3c4d01a40d034673b660c9a"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_service_get_protocol_of_service_as_string</code><span class="sig-paren">(</span><em class="property">const</em> nxp_iot_ServiceDescriptor *<em>service_descriptor</em>, <em class="property">const</em> char **<em>buffer</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get a textual description of the protocol. </p>
<p>Protocol strings are internal constant c-strings. This function returns a pointer to such a string, ownership remains with the iot_agent.</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">service_descriptor</span></code>: The service descriptor to get the protocol for. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">buffer</span></code>: A pointer to a c-string that is changed to point to the textual representation of the protocol.</p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: The service type could be resolved. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_FAILURE</span></code>: The service type is invalid. </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv451iot_agent_service_get_service_descriptor_of_servicePK21iot_agent_datastore_t6size_tP25nxp_iot_ServiceDescriptor">
<span id="_CPPv351iot_agent_service_get_service_descriptor_of_servicePK21iot_agent_datastore_t6size_tP25nxp_iot_ServiceDescriptor"></span><span id="_CPPv251iot_agent_service_get_service_descriptor_of_servicePK21iot_agent_datastore_t6size_tP25nxp_iot_ServiceDescriptor"></span><span id="iot_agent_service_get_service_descriptor_of_service__iot_agent_datastore_tCP.s.nxp_iot_ServiceDescriptorP"></span><span class="target" id="group__edgelock2go__agent__service_1ga55cc0651df0225cc5fda0fb6f20cc9e0"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_service_get_service_descriptor_of_service</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> *<em>datastore</em>, size_t <em>offset</em>, nxp_iot_ServiceDescriptor *<em>service_descriptor</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get the service descriptor of a service specified by offset. </p>
<p><dl class="simple">
<dt><strong>Pre</strong></dt><dd><p>The configuration data associated to the context is valid. </p>
</dd>
<dt><strong>Post</strong></dt><dd><p>In case of success, the service_descriptor structure is filled and needs to be freed after usage by calling <a class="reference internal" href="#group__edgelock2go__agent__main_1gae44d7181d9296a1c579cabbbd595c969"><span class="std std-ref">iot_agent_free_service_descriptor</span></a>. In case of failure no freeing is required. Also in case of failures, the contents of service_descriptor are not guaranteed to remain intact. </p>
</dd>
<dt><strong>See</strong></dt><dd><p><a class="reference internal" href="#group__edgelock2go__agent__main_1gaedf5ee6f479c0313c4d5b0b2ef3d0d91"><span class="std std-ref">iot_agent_is_service_configuration_data_valid</span></a> </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: The datastore to query for the service. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">offset</span></code>: The offset of the service - the memory location in the given datastore. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">service_descriptor</span></code>: Structure for holding a service descriptor. Must point to a valid service descriptor object upon invocation. Any FT_POINTER fields in the service descriptor are freed before changing the contents to the service_descriptor of the selected service. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv442iot_agent_service_get_service_offset_by_idPK21iot_agent_datastore_t8uint64_tP6size_tP25nxp_iot_ServiceDescriptor">
<span id="_CPPv342iot_agent_service_get_service_offset_by_idPK21iot_agent_datastore_t8uint64_tP6size_tP25nxp_iot_ServiceDescriptor"></span><span id="_CPPv242iot_agent_service_get_service_offset_by_idPK21iot_agent_datastore_t8uint64_tP6size_tP25nxp_iot_ServiceDescriptor"></span><span id="iot_agent_service_get_service_offset_by_id__iot_agent_datastore_tCP.uint64_t.sP.nxp_iot_ServiceDescriptorP"></span><span class="target" id="group__edgelock2go__agent__service_1gabbc5aa636f06f350d37a52eccd319434"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_service_get_service_offset_by_id</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> *<em>ctx</em>, uint64_t <em>service_id</em>, size_t *<em>offset</em>, nxp_iot_ServiceDescriptor *<em>service_descriptor</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get the offset and the service descriptor of a service specified by service_id. </p>
<p><dl class="simple">
<dt><strong>Pre</strong></dt><dd><p>The configuration data associated to the context is valid. </p>
</dd>
<dt><strong>Post</strong></dt><dd><p>In case of success, the service_descriptor structure is filled and needs to be freed after usage by calling <a class="reference internal" href="#group__edgelock2go__agent__main_1gae44d7181d9296a1c579cabbbd595c969"><span class="std std-ref">iot_agent_free_service_descriptor</span></a>. In case of failure no freeing is required. Also in case of failures, the contents of service_descriptor are not guaranteed to remain intact. </p>
</dd>
<dt><strong>See</strong></dt><dd><p><a class="reference internal" href="#group__edgelock2go__agent__main_1gaedf5ee6f479c0313c4d5b0b2ef3d0d91"><span class="std std-ref">iot_agent_is_service_configuration_data_valid</span></a> </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: The datastore to query for the service. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">service_id</span></code>: ID of the service </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">offset</span></code>: The offset of the service descriptor within the datastore. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">service_descriptor</span></code>: Structure for holding a service descriptor. Must point to a valid service descriptor object upon invocation. Any FT_POINTER fields in the service descriptor are freed before changing the contents to the service_descriptor of the selected service. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv445iot_agent_service_get_service_offset_by_indexPK21iot_agent_datastore_t6size_tP6size_tP25nxp_iot_ServiceDescriptor">
<span id="_CPPv345iot_agent_service_get_service_offset_by_indexPK21iot_agent_datastore_t6size_tP6size_tP25nxp_iot_ServiceDescriptor"></span><span id="_CPPv245iot_agent_service_get_service_offset_by_indexPK21iot_agent_datastore_t6size_tP6size_tP25nxp_iot_ServiceDescriptor"></span><span id="iot_agent_service_get_service_offset_by_index__iot_agent_datastore_tCP.s.sP.nxp_iot_ServiceDescriptorP"></span><span class="target" id="group__edgelock2go__agent__service_1gaf2ed90556af1f65d2bcf7bdc342499d5"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_service_get_service_offset_by_index</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> *<em>datastore</em>, size_t <em>index</em>, size_t *<em>offset</em>, nxp_iot_ServiceDescriptor *<em>service_descriptor</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get the offset and the service descriptor of a service specified by index. </p>
<p><dl class="simple">
<dt><strong>Pre</strong></dt><dd><p>The configuration data associated to the context is valid. </p>
</dd>
<dt><strong>Post</strong></dt><dd><p>In case of success, the service_descriptor structure is filled and needs to be freed after usage by calling <a class="reference internal" href="#group__edgelock2go__agent__main_1gae44d7181d9296a1c579cabbbd595c969"><span class="std std-ref">iot_agent_free_service_descriptor</span></a>. In case of failure no freeing is required. Also in case of failures, the contents of service_descriptor are not guaranteed to remain intact. </p>
</dd>
<dt><strong>See</strong></dt><dd><p><a class="reference internal" href="#group__edgelock2go__agent__main_1gaedf5ee6f479c0313c4d5b0b2ef3d0d91"><span class="std std-ref">iot_agent_is_service_configuration_data_valid</span></a> </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: The datastore to query for the service. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">index</span></code>: The index of the service (within the given datastore). </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">service_descriptor</span></code>: Structure for holding a service descriptor. Must point to a valid service descriptor object upon invocation. Any FT_POINTER fields in the service descriptor are freed before changing the contents to the service_descriptor of the selected service. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: Upon success </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv444iot_agent_service_get_service_type_as_stringPK25nxp_iot_ServiceDescriptorPPKc">
<span id="_CPPv344iot_agent_service_get_service_type_as_stringPK25nxp_iot_ServiceDescriptorPPKc"></span><span id="_CPPv244iot_agent_service_get_service_type_as_stringPK25nxp_iot_ServiceDescriptorPPKc"></span><span id="iot_agent_service_get_service_type_as_string__nxp_iot_ServiceDescriptorCP.cCPP"></span><span class="target" id="group__edgelock2go__agent__service_1gaaa760566938401ade73aa4cbed8fcc2e"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_service_get_service_type_as_string</code><span class="sig-paren">(</span><em class="property">const</em> nxp_iot_ServiceDescriptor *<em>service_descriptor</em>, <em class="property">const</em> char **<em>buffer</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Get a textual description of the service type. </p>
<p>Service type strings are internal constant c-strings. This function returns a pointer to such a string, ownership remains with the iot_agent.</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">service_descriptor</span></code>: The service descriptor to get the type for. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">buffer</span></code>: A pointer to a c-string that is changed to point to the textual representation of the service type.</p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: The service type could be resolved. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_FAILURE</span></code>: The service type is invalid. </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv445iot_agent_service_is_configuration_data_validPK21iot_agent_datastore_t">
<span id="_CPPv345iot_agent_service_is_configuration_data_validPK21iot_agent_datastore_t"></span><span id="_CPPv245iot_agent_service_is_configuration_data_validPK21iot_agent_datastore_t"></span><span id="iot_agent_service_is_configuration_data_valid__iot_agent_datastore_tCP"></span><span class="target" id="group__edgelock2go__agent__service_1gab1c18aaf60fa18ebcb99d3a5ace524dc"></span>bool <code class="sig-name descname">iot_agent_service_is_configuration_data_valid</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> *<em>ctx</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Checks service configuration data of all registered datastores are valid. </p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">ctx</span></code>: Context for the iot_agent. </p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">true</span></code>: Service configuration data of all registered datastores are valid </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">false</span></code>: Service configuration data of a registered datastores is invalid </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Variables</p>
<dl class="member">
<dt id="_CPPv46length">
<span id="_CPPv36length"></span><span id="_CPPv26length"></span><span id="length__uint32_t"></span><span class="target" id="group__edgelock2go__agent__service_1gaebb70c2aab3407a9f05334c47131a43b"></span>uint32_t <code class="sig-name descname">length</code><br /></dt>
<dd><p>Total length of the stored data (incl. all fields of configuration_data_header_t). </p>
</dd></dl>
<dl class="member">
<dt id="_CPPv418number_of_services">
<span id="_CPPv318number_of_services"></span><span id="_CPPv218number_of_services"></span><span id="number_of_services__uint32_t"></span><span class="target" id="group__edgelock2go__agent__service_1ga1148d30c61aa69b1cfab566adaa0201c"></span>uint32_t <code class="sig-name descname">number_of_services</code><br /></dt>
<dd><p>Number of stored service configurations. </p>
</dd></dl>
<dl class="member">
<dt id="_CPPv47version">
<span id="_CPPv37version"></span><span id="_CPPv27version"></span><span id="version__uint32_t"></span><span class="target" id="group__edgelock2go__agent__service_1gacd99bb05ca015e7d74448acb1deba7ca"></span>uint32_t <code class="sig-name descname">version</code><a class="headerlink" href="#_CPPv47version" title="Permalink to this definition"></a><br /></dt>
<dd><p>Version number of the structure of the configuration data. </p>
</dd></dl>
</div>
</dd></dl>
</div>
<div class="section" id="edgelock-2go-dispatcher">
<h2><span class="section-number">6.6.6. </span>EdgeLock 2GO Dispatcher<a class="headerlink" href="#edgelock-2go-dispatcher" title="Permalink to this headline"></a></h2>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>doxygengroup: Cannot find namespace “edgelock2go_agent_dispatcher” in doxygen xml output for project “simw” from directory: ../../../../_docs_build_simw/xml</p>
</div>
</div>
<div class="section" id="edgelock-2go-utils">
<h2><span class="section-number">6.6.7. </span>EdgeLock 2GO Utils<a class="headerlink" href="#edgelock-2go-utils" title="Permalink to this headline"></a></h2>
<dl class="group">
<dt>
<span class="target" id="group__edgelock2go__agent__utils"></span><em>group</em> <code class="sig-name descname">edgelock2go_agent_utils</code></dt>
<dd><p>Utility functions for the EdgeLock 2GO agent for writing and generating key references and certificates. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.NXP_IOT_AGENT_EDGELOCK2GO_CLIENT_CERTIFICATE_BUFFER_SIZE">
<span class="target" id="group__edgelock2go__agent__utils_1ga891bd068ed21a99d8b10db0d2321e8f1"></span><code class="sig-name descname">NXP_IOT_AGENT_EDGELOCK2GO_CLIENT_CERTIFICATE_BUFFER_SIZE</code><a class="headerlink" href="#c.NXP_IOT_AGENT_EDGELOCK2GO_CLIENT_CERTIFICATE_BUFFER_SIZE" title="Permalink to this definition"></a></dt>
<dd><p>The size of the buffer to reserve for the EdgeLock 2GO cloud service client certificate. </p>
</dd></dl>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Typedefs</p>
<dl class="type">
<dt id="_CPPv419iot_agent_context_t">
<span id="_CPPv319iot_agent_context_t"></span><span id="_CPPv219iot_agent_context_t"></span><span id="iot_agent_context_t"></span><span class="target" id="group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c"></span><em class="property">typedef </em><em class="property">struct</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__utils_1ga422aa2d462f3d64d43dfdb164b9bb95c.html#_CPPv419iot_agent_context_t" title="iot_agent_context_t">iot_agent_context_t</a> <code class="sig-name descname">iot_agent_context_t</code><br /></dt>
<dd></dd></dl>
<dl class="type">
<dt id="_CPPv421iot_agent_datastore_t">
<span id="_CPPv321iot_agent_datastore_t"></span><span id="_CPPv221iot_agent_datastore_t"></span><span class="target" id="group__edgelock2go__agent__utils_1gab098c81df6ce718287725d4c9023775b"></span><em class="property">typedef </em><em class="property">struct</em> <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> <code class="sig-name descname">iot_agent_datastore_t</code><br /></dt>
<dd></dd></dl>
</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv433iot_agent_keystore_file_existencePKcb">
<span id="_CPPv333iot_agent_keystore_file_existencePKcb"></span><span id="_CPPv233iot_agent_keystore_file_existencePKcb"></span><span id="iot_agent_keystore_file_existence__cCP.b"></span><span class="target" id="group__edgelock2go__agent__utils_1ga8ee7205106121217123a0978b38b8727"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_keystore_file_existence</code><span class="sig-paren">(</span><em class="property">const</em> char *<em>filename</em>, bool <em>forceCreation</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Checks existence of a file. If required it forces creation of file.</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">filename</span></code>: Name of the file </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">forceCreation</span></code>: Switch to force creation of the file</p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: upon success </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_FAILURE</span></code>: upon failure </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv438iot_agent_utils_convert_service2key_id8uint64_tP8uint32_t">
<span id="_CPPv338iot_agent_utils_convert_service2key_id8uint64_tP8uint32_t"></span><span id="_CPPv238iot_agent_utils_convert_service2key_id8uint64_tP8uint32_t"></span><span id="iot_agent_utils_convert_service2key_id__uint64_t.uint32_tP"></span><span class="target" id="group__edgelock2go__agent__utils_1gae9899c8382352e3c157d9e734b0ed038"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_utils_convert_service2key_id</code><span class="sig-paren">(</span>uint64_t <em>service_id</em>, uint32_t *<em>key_id</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Maps a given service id to the range of keys that are managed by the EdgeLock 2GO cloud service. </p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">[in]</span> <span class="pre">service_id</span></code>: Service ID </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">[out]</span> <span class="pre">key_id</span></code>: Key ID</p></li>
</ul>
</dd>
<dt><strong>Return Value</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_SUCCESS</span></code>: upon success </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">IOT_AGENT_FAILURE</span></code>: upon failure </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="function">
<dt id="_CPPv446iot_agent_utils_get_edgelock2go_certificate_idP15sss_key_store_tP8uint32_t">
<span id="_CPPv346iot_agent_utils_get_edgelock2go_certificate_idP15sss_key_store_tP8uint32_t"></span><span id="_CPPv246iot_agent_utils_get_edgelock2go_certificate_idP15sss_key_store_tP8uint32_t"></span><span id="iot_agent_utils_get_edgelock2go_certificate_id__sss_key_store_tP.uint32_tP"></span><span class="target" id="group__edgelock2go__agent__utils_1ga1070c7b0c649ff0700604afd68e443ad"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_utils_get_edgelock2go_certificate_id</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/structsss__key__store__t.html#_CPPv415sss_key_store_t" title="sss_key_store_t">sss_key_store_t</a> *<em>keystore</em>, uint32_t *<em>object_id</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Checks whether a keystore contains the object with the defined certificate to use for authenticating at the EdgeLock 2GO cloud service. </p>
<p>The keystore might contain keys using ECC and/or RSA. If available, it will return the object id of the ECC certificate, otherwise the object id of the RSA certificate.</p>
<p>When neither is found or in case of other issues with the keystore, the function does not return IOT_AGENT_SUCCESS. </p>
</dd></dl>
<dl class="function">
<dt id="_CPPv438iot_agent_utils_get_edgelock2go_key_idP15sss_key_store_tP8uint32_t">
<span id="_CPPv338iot_agent_utils_get_edgelock2go_key_idP15sss_key_store_tP8uint32_t"></span><span id="_CPPv238iot_agent_utils_get_edgelock2go_key_idP15sss_key_store_tP8uint32_t"></span><span id="iot_agent_utils_get_edgelock2go_key_id__sss_key_store_tP.uint32_tP"></span><span class="target" id="group__edgelock2go__agent__utils_1gaadd537d9380ae56cfe7981e1931765d5"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_utils_get_edgelock2go_key_id</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/structsss__key__store__t.html#_CPPv415sss_key_store_t" title="sss_key_store_t">sss_key_store_t</a> *<em>keystore</em>, uint32_t *<em>object_id</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Checks whether a keystore contains the object with the defined key to use for authenticating at the EdgeLock 2GO cloud service. </p>
<p>The keystore might contain keys using ECC and/or RSA. If available, it will return the object id of the ECC key, otherwise the object id of the RSA key.</p>
<p>When neither is found or in case of other issues with the keystore, the function does not return IOT_AGENT_SUCCESS. </p>
</dd></dl>
<dl class="function">
<dt id="_CPPv443iot_agent_utils_write_edgelock2go_datastoreP20iot_agent_keystore_tP21iot_agent_datastore_tPKc8uint32_tPK16pb_bytes_array_t">
<span id="_CPPv343iot_agent_utils_write_edgelock2go_datastoreP20iot_agent_keystore_tP21iot_agent_datastore_tPKc8uint32_tPK16pb_bytes_array_t"></span><span id="_CPPv243iot_agent_utils_write_edgelock2go_datastoreP20iot_agent_keystore_tP21iot_agent_datastore_tPKc8uint32_tPK16pb_bytes_array_t"></span><span id="iot_agent_utils_write_edgelock2go_datastore__iot_agent_keystore_tP.iot_agent_datastore_tP.cCP.uint32_t.pb_bytes_array_tCP"></span><span class="target" id="group__edgelock2go__agent__utils_1ga2ddc5746603835acf23638274fda2dec"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_utils_write_edgelock2go_datastore</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/structiot__agent__keystore__t.html#_CPPv420iot_agent_keystore_t" title="iot_agent_keystore_t">iot_agent_keystore_t</a> *<em>keystore</em>, <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> *<em>datastore</em>, <em class="property">const</em> char *<em>hostname</em>, uint32_t <em>port</em>, <em class="property">const</em> pb_bytes_array_t *<em>trusted_root_ca_certificates</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Assemble a service descriptor for the connection to EdgeLock 2GO cloud service and write it to a datastore. </p>
<p>It is assumed that credentials (either ECC or RSA) for client certificate authentication are stored in <code class="docutils literal notranslate"><span class="pre">keystore</span></code>. </p>
</dd></dl>
<dl class="function">
<dt id="_CPPv452iot_agent_utils_write_edgelock2go_datastore_from_envP20iot_agent_keystore_tP21iot_agent_datastore_t">
<span id="_CPPv352iot_agent_utils_write_edgelock2go_datastore_from_envP20iot_agent_keystore_tP21iot_agent_datastore_t"></span><span id="_CPPv252iot_agent_utils_write_edgelock2go_datastore_from_envP20iot_agent_keystore_tP21iot_agent_datastore_t"></span><span id="iot_agent_utils_write_edgelock2go_datastore_from_env__iot_agent_keystore_tP.iot_agent_datastore_tP"></span><span class="target" id="group__edgelock2go__agent__utils_1ga83082063f1c02e800aa7eac8efb21c95"></span>iot_agent_status_t <code class="sig-name descname">iot_agent_utils_write_edgelock2go_datastore_from_env</code><span class="sig-paren">(</span><a class="reference internal" href="../../api/structiot__agent__keystore__t.html#_CPPv420iot_agent_keystore_t" title="iot_agent_keystore_t">iot_agent_keystore_t</a> *<em>keystore</em>, <a class="reference internal" href="../../api/typedef_group__edgelock2go__agent__service_1gab098c81df6ce718287725d4c9023775b.html#_CPPv421iot_agent_datastore_t" title="iot_agent_datastore_t">iot_agent_datastore_t</a> *<em>datastore</em><span class="sig-paren">)</span><br /></dt>
<dd><p>Assemble a service descriptor for the connection to EdgeLock 2GO cloud service and write it to a datastore. </p>
<p>Per default this function takes the hostname and port from the defines<ul class="simple">
<li><p>EDGELOCK2GO_HOSTNAME and</p></li>
<li><p>EDGELOCK2GO_PORT</p></li>
</ul>
</p>
<p>For testing purposes, it is possible to set-up the connection parameters to the EdgeLock 2GO cloud service from externally by passing in information via environment variables.</p>
<p>The following env variables are considered:<ul class="simple">
<li><p>IOT_AGENT_TEST_EDGELOCK2GO_HOSTNAME</p></li>
<li><p>IOT_AGENT_TEST_EDGELOCK2GO_PORT</p></li>
</ul>
</p>
<p>It is assumed that credentials (either ECC or RSA) for client certificate authentication are stored in <code class="docutils literal notranslate"><span class="pre">keystore</span></code>. </p>
</dd></dl>
</div>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2018-2020, NXP.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.4.1.<br/>
</p>
</div>
</footer>
</body>
</html>