blob: d572097bab4a7a8d24d3add3d21d75a7c77ef5e3 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NimBLE Host Return Codes &mdash; Apache Mynewt latest documentation</title>
<link rel="shortcut icon" href="../../_static/mynewt-logo-only-newt32x32.png"/>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/sphinx_theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/bootstrap-3.0.3.min.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/v2.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/restructuredtext.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/overrides.css" type="text/css" />
<link rel="index" title="Index"
href="../../genindex.html"/>
<link rel="search" title="Search" href="../../search.html"/>
<link rel="top" title="Apache Mynewt latest documentation" href="../../index.html"/>
<link rel="up" title="NimBLE Host" href="ble_hs.html"/>
<link rel="next" title="NimBLE Host GAP Reference" href="ble_gap.html"/>
<link rel="prev" title="NimBLE Host" href="ble_hs.html"/>
<script src="../../_static/js/modernizr.min.js"></script>
<script>
(function(i, s, o, g, r, a, m) {
i["GoogleAnalyticsObject"] = r;
(i[r] =
i[r] ||
function() {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(window, document, "script", "//www.google-analytics.com/analytics.js", "ga");
ga("create", "UA-72162311-1", "auto");
ga("send", "pageview");
</script>
</head>
<body class="not-front page-documentation" role="document" >
<div id="wrapper">
<div class="container">
<div id="banner" class="row v2-main-banner">
<a class="logo-cell" href="/">
<img class="logo" src="../../_static/img/logo.png">
</a>
<div class="tagline-cell">
<h4 class="tagline">An OS to build, deploy and securely manage billions of devices</h4>
</div>
<div class="news-cell">
<div class="well">
<h4>Latest News:</h4> <a href="/download">Apache Mynewt 1.11.0, Apache NimBLE 1.6.0 </a> released September 7, 2023)
</div>
</div>
</div>
</div>
<header>
<nav id="navbar" class="navbar navbar-inverse" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav navbar-right">
<li>
<a href="/"><i class="fa fa-home" style="font-size: larger;"></i></a>
</li>
<li class="important">
<a href="/quick-start/">Quick Start</a>
</li>
<li>
<a href="/about/">About</a>
</li>
<li>
<a href="/talks/">Talks</a>
</li>
<li class="active">
<a href="/documentation/">Documentation</a>
</li>
<li>
<a href="/download/">Download</a>
</li>
<li>
<a href="/community/">Community</a>
</li>
<li>
<a href="/events/">Events</a>
</li>
</ul>
<!-- Search, Navigation and Repo links -->
<ul class="nav navbar-nav navbar-right">
</ul>
</div>
</div>
</nav>
</header>
<!-- STARTS MAIN CONTENT -->
<div id="main-content">
<div id="breadcrumb">
<div class="container">
<a href="/documentation/">Docs</a> /
<a href="../index.html">BLE User Guide</a> /
<a href="ble_hs.html">NimBLE Host</a> /
NimBLE Host Return Codes
<div class="sourcelink">
<a href="https://github.com/apache/mynewt-nimble/edit/master/docs/ble_hs/ble_hs_return_codes.rst" class="icon icon-github"
rel="nofollow"> Edit on GitHub</a>
</div>
</div>
</div>
<!-- STARTS CONTAINER -->
<div class="container">
<!-- STARTS .content -->
<div id="content" class="row">
<!-- STARTS .container-sidebar -->
<div class="container-sidebar col-xs-12 col-sm-3">
<div id="docSidebar" class="sticky-container">
<div role="search" class="sphinx-search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search documentation" class="search-documentation" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<!-- Note: only works when deployed -->
<select class="form-control" onchange="if (this.value) window.location.href=this.value">
<option value="/latest" selected>
Version: latest
</option>
<option value="/v1_11_0" >
Version: 1.11.0
</option>
<option value="/v1_10_0" >
Version: 1.10.0
</option>
<option value="/v1_9_0" >
Version: 1.9.0
</option>
<option value="/v1_8_0" >
Version: 1.8.0
</option>
<option value="/v1_7_0" >
Version: 1.7.0
</option>
<option value="/v1_6_0" selected="selected" >
Version: 1.6.0
</option>
<option value="/v1_5_0" >
Version: 1.5.0
</option>
<option value="/v1_4_0" >
Version: 1.4.0
</option>
<option value="/v1_3_0/os/introduction" >
Version: 1.3.0
</option>
<option value="/v1_2_0/os/introduction" >
Version: 1.2.0
</option>
<option value="/v1_1_0/os/introduction" >
Version: 1.1.0
</option>
<option value="/v1_0_0/os/introduction" >
Version: 1.0.0
</option>
<option value="/v0_9_0/os/introduction" >
Version: 0.9.0
</option>
</select>
<div class="region region-sidebar">
<div class="docs-menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../index.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/index.html">Setup &amp; Get Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../concepts.html">Concepts</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tutorials/tutorials.html">Tutorials</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../external_links.html">Third-party Resources</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../os/os_user_guide.html">OS User Guide</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">BLE User Guide</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../ble_sec.html">NimBLE Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ble_setup/ble_setup_intro.html">NimBLE Setup</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="ble_hs.html">NimBLE Host</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">Return Codes</a></li>
<li class="toctree-l3"><a class="reference internal" href="ble_gap.html">GAP</a></li>
<li class="toctree-l3"><a class="reference internal" href="ble_gattc.html">GATT Client</a></li>
<li class="toctree-l3"><a class="reference internal" href="ble_gatts.html">GATT Server</a></li>
<li class="toctree-l3"><a class="reference internal" href="ble_hs_id.html">Identity</a></li>
<li class="toctree-l3"><a class="reference internal" href="ble_att.html">ATT</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../btshell/btshell_api.html">btshell Usage API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mesh/index.html">Bluetooth Mesh</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../newt/index.html">Newt Tool Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../newtmgr/index.html">Newt Manager Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mynewt_faq/index.html">Mynewt FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../misc/index.html">Appendix</a></li>
</ul>
</div>
</div>
</div>
<!-- ENDS STICKY CONTAINER -->
</div>
<!-- ENDS .container-sidebar -->
<div class="col-xs-12 col-sm-9">
<div class="alert alert-warning">
<p>
Version 1.6.0 is not the most recent version of the
Apache Mynewt documentation. Click <a href="/latest">here</a> to
read the latest version.
</p>
</div>
<div class="">
<div class="rst-content">
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="nimble-host-return-codes">
<h1>NimBLE Host Return Codes<a class="headerlink" href="#nimble-host-return-codes" title="Permalink to this headline"></a></h1>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#introduction" id="id1">Introduction</a></p>
<ul>
<li><p><a class="reference internal" href="#summary" id="id2">Summary</a></p></li>
<li><p><a class="reference internal" href="#example" id="id3">Example</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#return-code-reference" id="id4">Return Code Reference</a></p>
<ul>
<li><p><a class="reference internal" href="#header" id="id5">Header</a></p></li>
<li><p><a class="reference internal" href="#return-codes-core" id="id6">Return codes - Core</a></p></li>
<li><p><a class="reference internal" href="#return-codes-att" id="id7">Return codes - ATT</a></p></li>
<li><p><a class="reference internal" href="#return-codes-hci" id="id8">Return codes - HCI</a></p></li>
<li><p><a class="reference internal" href="#return-codes-l2cap" id="id9">Return codes - L2CAP</a></p></li>
<li><p><a class="reference internal" href="#return-codes-security-manager-us" id="id10">Return codes - Security manager (us)</a></p></li>
<li><p><a class="reference internal" href="#return-codes-security-manager-peer" id="id11">Return codes - Security manager (peer)</a></p></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="introduction">
<h2><a class="toc-backref" href="#id1">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<div class="section" id="summary">
<h3><a class="toc-backref" href="#id2">Summary</a><a class="headerlink" href="#summary" title="Permalink to this headline"></a></h3>
<p>The NimBLE host reports status to the application via a set of return codes. The host encompasses several layers of the Bluetooth specification that each defines its own set of status codes. Rather than “abstract away” information from lower layers that the application developer might find useful, the NimBLE host aims to indicate precisely what happened when something fails. Consequently, the host utilizes a rather large set of return codes.</p>
<p>A return code of 0 indicates success. For failure conditions, the return codes are partitioned into five separate sets:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 12%" />
<col style="width: 88%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Set</p></th>
<th class="head"><p>Condition</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>Core</p></td>
<td><p>Errors detected internally by the NimBLE host.</p></td>
</tr>
<tr class="row-odd"><td><p>ATT</p></td>
<td><p>The ATT server has reported a failure via the transmission of an ATT Error Response. The return code corresponds to the value of the Error Code field in the response.</p></td>
</tr>
<tr class="row-even"><td><p>HCI</p></td>
<td><p>The controller has reported an error to the host via a command complete or command status HCI event. The return code corresponds to the value of the Status field in the event.</p></td>
</tr>
<tr class="row-odd"><td><p>L2CAP</p></td>
<td><p>An L2CAP signaling procedure has failed and an L2CAP Command Reject was sent as a result. The return code corresponds to the value of the Reason field in the command.</p></td>
</tr>
<tr class="row-even"><td><p>Security manager (us)</p></td>
<td><p>The host detected an error during a security manager procedure and sent a Pairing Failed command to the peer. The return code corresponds to the value of the Reason field in the Pairing Failed command.</p></td>
</tr>
<tr class="row-odd"><td><p>Security manager (peer)</p></td>
<td><p>A security manager procedure failed because the peer sent us a Pairing Failed command. The return code corresponds to the value of the Reason field in the Pairing Failed command.</p></td>
</tr>
</tbody>
</table>
<p>The return codes in the core set are defined by the NimBLE Host. The other sets are defined in the Bluetooth specification; the codes in this latter group are referred to as <em>formal status codes</em>. As defined in the Bluetooth specification, the formal status code sets are not disjoint. That is, they overlap. For example, the spec defines a status code of 1 to have all of the following meanings:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 24%" />
<col style="width: 76%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Layer</p></th>
<th class="head"><p>Meaning</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>ATT</p></td>
<td><p>Invalid handle.</p></td>
</tr>
<tr class="row-odd"><td><p>HCI</p></td>
<td><p>Unknown HCI command.</p></td>
</tr>
<tr class="row-even"><td><p>L2CAP</p></td>
<td><p>Signalling MTU exceeded.</p></td>
</tr>
<tr class="row-odd"><td><p>SM</p></td>
<td><p>Passkey entry failed.</p></td>
</tr>
</tbody>
</table>
<p>Clearly, the host can’t just return an unadorned formal status code and expect the application to make sense of it. To resolve this ambiguity, the NimBLE host divides the full range of an int into several subranges. Each subrange corresponds to one of the five return code sets. For example, the ATT set is mapped onto the subrange <em>[0x100, 0x200)</em>. To indicate an ATT error of 3 (write not permitted), the NimBLE host returns a value 0x103 to the application.</p>
<p>The host defines a set of convenience macros for converting from a formal status code to NimBLE host status code. These macros are documented in the table below.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 41%" />
<col style="width: 39%" />
<col style="width: 20%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Macro</p></th>
<th class="head"><p>Status code set</p></th>
<th class="head"><p>Base value</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>BLE_HS_ATT_ERR()</p></td>
<td><p>ATT</p></td>
<td><p>0x100</p></td>
</tr>
<tr class="row-odd"><td><p>BLE_HS_HCI_ERR()</p></td>
<td><p>HCI</p></td>
<td><p>0x200</p></td>
</tr>
<tr class="row-even"><td><p>BLE_HS_L2C_ERR()</p></td>
<td><p>L2CAP</p></td>
<td><p>0x300</p></td>
</tr>
<tr class="row-odd"><td><p>BLE_HS_SM_US_ERR()</p></td>
<td><p>Security manager (us)</p></td>
<td><p>0x400</p></td>
</tr>
<tr class="row-even"><td><p>BLE_HS_SM_PEER_ERR()</p></td>
<td><p>Security manager (peer)</p></td>
<td><p>0x500</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="example">
<h3><a class="toc-backref" href="#id3">Example</a><a class="headerlink" href="#example" title="Permalink to this headline"></a></h3>
<p>The following example demonstrates how an application might determine which error is being reported by the host. In this example, the application performs the GAP encryption procedure and checks the return code. To simplify the example, the application uses a hypothetical <em>my_blocking_enc_proc()</em> function, which blocks until the pairing operation has completed.</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span>
<span class="nf">encrypt_connection</span><span class="p">(</span><span class="kt">uint16_t</span><span class="w"> </span><span class="n">conn_handle</span><span class="p">)</span>
<span class="p">{</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">rc</span><span class="p">;</span>
<span class="w"> </span><span class="cm">/* Perform a blocking GAP encryption procedure. */</span>
<span class="w"> </span><span class="n">rc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">my_blocking_enc_proc</span><span class="p">(</span><span class="n">conn_handle</span><span class="p">);</span>
<span class="w"> </span><span class="k">switch</span><span class="w"> </span><span class="p">(</span><span class="n">rc</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">case</span><span class="w"> </span><span class="mi">0</span><span class="p">:</span>
<span class="w"> </span><span class="n">console_printf</span><span class="p">(</span><span class="s">&quot;success - link successfully encrypted</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="w"> </span><span class="k">break</span><span class="p">;</span>
<span class="w"> </span><span class="k">case</span><span class="w"> </span><span class="no">BLE_HS_ENOTCONN</span><span class="p">:</span>
<span class="w"> </span><span class="n">console_printf</span><span class="p">(</span><span class="s">&quot;failure - no connection with handle %d</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="n">conn_handle</span><span class="p">);</span>
<span class="w"> </span><span class="k">break</span><span class="p">;</span>
<span class="w"> </span><span class="k">case</span><span class="w"> </span><span class="no">BLE_HS_ERR_SM_US_BASE</span><span class="p">(</span><span class="no">BLE_SM_ERR_CONFIRM_MISMATCH</span><span class="p">):</span>
<span class="w"> </span><span class="n">console_printf</span><span class="p">(</span><span class="s">&quot;failure - mismatch in peer&#39;s confirm and random &quot;</span>
<span class="w"> </span><span class="s">&quot;commands.</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="w"> </span><span class="k">break</span><span class="p">;</span>
<span class="w"> </span><span class="k">case</span><span class="w"> </span><span class="no">BLE_HS_ERR_SM_PEER_BASE</span><span class="p">(</span><span class="no">BLE_SM_ERR_CONFIRM_MISMATCH</span><span class="p">):</span>
<span class="w"> </span><span class="n">console_printf</span><span class="p">(</span><span class="s">&quot;failure - peer reports mismatch in our confirm and &quot;</span>
<span class="w"> </span><span class="s">&quot;random commands.</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="w"> </span><span class="k">break</span><span class="p">;</span>
<span class="w"> </span><span class="k">default</span><span class="o">:</span>
<span class="w"> </span><span class="n">console_printf</span><span class="p">(</span><span class="s">&quot;failure - other error: 0x%04x</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">rc</span><span class="p">);</span>
<span class="w"> </span><span class="k">break</span><span class="p">;</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="return-code-reference">
<h2><a class="toc-backref" href="#id4">Return Code Reference</a><a class="headerlink" href="#return-code-reference" title="Permalink to this headline"></a></h2>
<div class="section" id="header">
<h3><a class="toc-backref" href="#id5">Header</a><a class="headerlink" href="#header" title="Permalink to this headline"></a></h3>
<p>All NimBLE host return codes are made accessible by including the following header:</p>
<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&quot;host/ble_hs.h&quot;</span>
</pre></div>
</div>
</div>
<div class="section" id="return-codes-core">
<h3><a class="toc-backref" href="#id6">Return codes - Core</a><a class="headerlink" href="#return-codes-core" title="Permalink to this headline"></a></h3>
<p>The precise meaning of each of these error codes depends on the function that returns it.
The API reference for a particular function indicates the conditions under which each of these codes are returned.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 7%" />
<col style="width: 23%" />
<col style="width: 70%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Value</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Condition</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>0x00</p></td>
<td><p><em>N/A</em></p></td>
<td><p>Success</p></td>
</tr>
<tr class="row-odd"><td><p>0x01</p></td>
<td><p>BLE_HS_EAGAIN</p></td>
<td><p>Temporary failure; try again.</p></td>
</tr>
<tr class="row-even"><td><p>0x02</p></td>
<td><p>BLE_HS_EALREADY</p></td>
<td><p>Operation already in progress or completed.</p></td>
</tr>
<tr class="row-odd"><td><p>0x03</p></td>
<td><p>BLE_HS_EINVAL</p></td>
<td><p>One or more arguments are invalid.</p></td>
</tr>
<tr class="row-even"><td><p>0x04</p></td>
<td><p>BLE_HS_EMSGSIZE</p></td>
<td><p>The provided buffer is too small.</p></td>
</tr>
<tr class="row-odd"><td><p>0x05</p></td>
<td><p>BLE_HS_ENOENT</p></td>
<td><p>No entry matching the specified criteria.</p></td>
</tr>
<tr class="row-even"><td><p>0x06</p></td>
<td><p>BLE_HS_ENOMEM</p></td>
<td><p>Operation failed due to resource exhaustion.</p></td>
</tr>
<tr class="row-odd"><td><p>0x07</p></td>
<td><p>BLE_HS_ENOTCONN</p></td>
<td><p>No open connection with the specified handle.</p></td>
</tr>
<tr class="row-even"><td><p>0x08</p></td>
<td><p>BLE_HS_ENOTSUP</p></td>
<td><p>Operation disabled at compile time.</p></td>
</tr>
<tr class="row-odd"><td><p>0x09</p></td>
<td><p>BLE_HS_EAPP</p></td>
<td><p>Application callback behaved unexpectedly.</p></td>
</tr>
<tr class="row-even"><td><p>0x0a</p></td>
<td><p>BLE_HS_EBADDATA</p></td>
<td><p>Command from peer is invalid.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0b</p></td>
<td><p>BLE_HS_EOS</p></td>
<td><p>Mynewt OS error.</p></td>
</tr>
<tr class="row-even"><td><p>0x0c</p></td>
<td><p>BLE_HS_ECONTROLLER</p></td>
<td><p>Event from controller is invalid.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0d</p></td>
<td><p>BLE_HS_ETIMEOUT</p></td>
<td><p>Operation timed out.</p></td>
</tr>
<tr class="row-even"><td><p>0x0e</p></td>
<td><p>BLE_HS_EDONE</p></td>
<td><p>Operation completed successfully.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0f</p></td>
<td><p>BLE_HS_EBUSY</p></td>
<td><p>Operation cannot be performed until procedure completes.</p></td>
</tr>
<tr class="row-even"><td><p>0x10</p></td>
<td><p>BLE_HS_EREJECT</p></td>
<td><p>Peer rejected a connection parameter update request.</p></td>
</tr>
<tr class="row-odd"><td><p>0x11</p></td>
<td><p>BLE_HS_EUNKNOWN</p></td>
<td><p>Unexpected failure; catch all.</p></td>
</tr>
<tr class="row-even"><td><p>0x12</p></td>
<td><p>BLE_HS_EROLE</p></td>
<td><p>Operation requires different role (e.g., central vs. peripheral).</p></td>
</tr>
<tr class="row-odd"><td><p>0x13</p></td>
<td><p>BLE_HS_ETIMEOUT_HCI</p></td>
<td><p>HCI request timed out; controller unresponsive.</p></td>
</tr>
<tr class="row-even"><td><p>0x14</p></td>
<td><p>BLE_HS_ENOMEM_EVT</p></td>
<td><p>Controller failed to send event due to memory exhaustion (combined host-controller only).</p></td>
</tr>
<tr class="row-odd"><td><p>0x15</p></td>
<td><p>BLE_HS_ENOADDR</p></td>
<td><p>Operation requires an identity address but none configured.</p></td>
</tr>
<tr class="row-even"><td><p>0x16</p></td>
<td><p>BLE_HS_ENOTSYNCED</p></td>
<td><p>Attempt to use the host before it is synced with controller.</p></td>
</tr>
<tr class="row-odd"><td><p>0x17</p></td>
<td><p>BLE_HS_EAUTHEN</p></td>
<td><p>Insufficient authentication.</p></td>
</tr>
<tr class="row-even"><td><p>0x18</p></td>
<td><p>BLE_HS_EAUTHOR</p></td>
<td><p>Insufficient authorization.</p></td>
</tr>
<tr class="row-odd"><td><p>0x19</p></td>
<td><p>BLE_HS_EENCRYPT</p></td>
<td><p>Insufficient encryption level.</p></td>
</tr>
<tr class="row-even"><td><p>0x1a</p></td>
<td><p>BLE_HS_EENCRYPT_KEY_SZ</p></td>
<td><p>Insufficient key size.</p></td>
</tr>
<tr class="row-odd"><td><p>0x1b</p></td>
<td><p>BLE_HS_ESTORE_CAP</p></td>
<td><p>Storage at capacity.</p></td>
</tr>
<tr class="row-even"><td><p>0x1c</p></td>
<td><p>BLE_HS_ESTORE_FAIL</p></td>
<td><p>Storage IO error.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="return-codes-att">
<h3><a class="toc-backref" href="#id7">Return codes - ATT</a><a class="headerlink" href="#return-codes-att" title="Permalink to this headline"></a></h3>
<table class="docutils align-default">
<colgroup>
<col style="width: 7%" />
<col style="width: 7%" />
<col style="width: 20%" />
<col style="width: 65%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>NimBLE Value</p></th>
<th class="head"><p>Formal Value</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Condition</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>0x0101</p></td>
<td><p>0x01</p></td>
<td><p>BLE_ATT_ERR_INVALID_HANDLE</p></td>
<td><p>The attribute handle given was not valid on this server.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0102</p></td>
<td><p>0x02</p></td>
<td><p>BLE_ATT_ERR_READ_NOT_PERMITTED</p></td>
<td><p>The attribute cannot be read.</p></td>
</tr>
<tr class="row-even"><td><p>0x0103</p></td>
<td><p>0x03</p></td>
<td><p>BLE_ATT_ERR_WRITE_NOT_PERMITTED</p></td>
<td><p>The attribute cannot be written.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0104</p></td>
<td><p>0x04</p></td>
<td><p>BLE_ATT_ERR_INVALID_PDU</p></td>
<td><p>The attribute PDU was invalid.</p></td>
</tr>
<tr class="row-even"><td><p>0x0105</p></td>
<td><p>0x05</p></td>
<td><p>BLE_ATT_ERR_INSUFFICIENT_AUTHEN</p></td>
<td><p>The attribute requires authentication before it can be read or written.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0106</p></td>
<td><p>0x06</p></td>
<td><p>BLE_ATT_ERR_REQ_NOT_SUPPORTED</p></td>
<td><p>Attribute server does not support the request received from the client.</p></td>
</tr>
<tr class="row-even"><td><p>0x0107</p></td>
<td><p>0x07</p></td>
<td><p>BLE_ATT_ERR_INVALID_OFFSET</p></td>
<td><p>Offset specified was past the end of the attribute.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0108</p></td>
<td><p>0x08</p></td>
<td><p>BLE_ATT_ERR_INSUFFICIENT_AUTHOR</p></td>
<td><p>The attribute requires authorization before it can be read or written.</p></td>
</tr>
<tr class="row-even"><td><p>0x0109</p></td>
<td><p>0x09</p></td>
<td><p>BLE_ATT_ERR_PREPARE_QUEUE_FULL</p></td>
<td><p>Too many prepare writes have been queued.</p></td>
</tr>
<tr class="row-odd"><td><p>0x010a</p></td>
<td><p>0x0a</p></td>
<td><p>BLE_ATT_ERR_ATTR_NOT_FOUND</p></td>
<td><p>No attribute found within the given attribute handle range.</p></td>
</tr>
<tr class="row-even"><td><p>0x010b</p></td>
<td><p>0x0b</p></td>
<td><p>BLE_ATT_ERR_ATTR_NOT_LONG</p></td>
<td><p>The attribute cannot be read or written using the Read Blob Request.</p></td>
</tr>
<tr class="row-odd"><td><p>0x010c</p></td>
<td><p>0x0c</p></td>
<td><p>BLE_ATT_ERR_INSUFFICIENT_KEY_SZ</p></td>
<td><p>The Encryption Key Size used for encrypting this link is insufficient.</p></td>
</tr>
<tr class="row-even"><td><p>0x010d</p></td>
<td><p>0x0d</p></td>
<td><p>BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN</p></td>
<td><p>The attribute value length is invalid for the operation.</p></td>
</tr>
<tr class="row-odd"><td><p>0x010e</p></td>
<td><p>0x0e</p></td>
<td><p>BLE_ATT_ERR_UNLIKELY</p></td>
<td><p>The attribute request that was requested has encountered an error that was unlikely, and therefore could not be completed as requested.</p></td>
</tr>
<tr class="row-even"><td><p>0x010f</p></td>
<td><p>0x0f</p></td>
<td><p>BLE_ATT_ERR_INSUFFICIENT_ENC</p></td>
<td><p>The attribute requires encryption before it can be read or written.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0110</p></td>
<td><p>0x10</p></td>
<td><p>BLE_ATT_ERR_UNSUPPORTED_GROUP</p></td>
<td><p>The attribute type is not a supported grouping attribute as defined by a higher layer specification.</p></td>
</tr>
<tr class="row-even"><td><p>0x0111</p></td>
<td><p>0x11</p></td>
<td><p>BLE_ATT_ERR_INSUFFICIENT_RES</p></td>
<td><p>Insufficient Resources to complete the request.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="return-codes-hci">
<h3><a class="toc-backref" href="#id8">Return codes - HCI</a><a class="headerlink" href="#return-codes-hci" title="Permalink to this headline"></a></h3>
<table class="docutils align-default">
<colgroup>
<col style="width: 11%" />
<col style="width: 11%" />
<col style="width: 24%" />
<col style="width: 54%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>NimBLE Value</p></th>
<th class="head"><p>Formal Value</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Condition</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>0x0201</p></td>
<td><p>0x01</p></td>
<td><p>BLE_ERR_UNKNOWN_HCI_CMD</p></td>
<td><p>Unknown HCI Command</p></td>
</tr>
<tr class="row-odd"><td><p>0x0202</p></td>
<td><p>0x02</p></td>
<td><p>BLE_ERR_UNK_CONN_ID</p></td>
<td><p>Unknown Connection Identifier</p></td>
</tr>
<tr class="row-even"><td><p>0x0203</p></td>
<td><p>0x03</p></td>
<td><p>BLE_ERR_HW_FAIL</p></td>
<td><p>Hardware Failure</p></td>
</tr>
<tr class="row-odd"><td><p>0x0204</p></td>
<td><p>0x04</p></td>
<td><p>BLE_ERR_PAGE_TMO</p></td>
<td><p>Page Timeout</p></td>
</tr>
<tr class="row-even"><td><p>0x0205</p></td>
<td><p>0x05</p></td>
<td><p>BLE_ERR_AUTH_FAIL</p></td>
<td><p>Authentication Failure</p></td>
</tr>
<tr class="row-odd"><td><p>0x0206</p></td>
<td><p>0x06</p></td>
<td><p>BLE_ERR_PINKEY_MISSING</p></td>
<td><p>PIN or Key Missing</p></td>
</tr>
<tr class="row-even"><td><p>0x0207</p></td>
<td><p>0x07</p></td>
<td><p>BLE_ERR_MEM_CAPACITY</p></td>
<td><p>Memory Capacity Exceeded</p></td>
</tr>
<tr class="row-odd"><td><p>0x0208</p></td>
<td><p>0x08</p></td>
<td><p>BLE_ERR_CONN_SPVN_TMO</p></td>
<td><p>Connection Timeout</p></td>
</tr>
<tr class="row-even"><td><p>0x0209</p></td>
<td><p>0x09</p></td>
<td><p>BLE_ERR_CONN_LIMIT</p></td>
<td><p>Connection Limit Exceeded</p></td>
</tr>
<tr class="row-odd"><td><p>0x020a</p></td>
<td><p>0x0a</p></td>
<td><p>BLE_ERR_SYNCH_CONN_LIMIT</p></td>
<td><p>Synchronous Connection Limit To A Device Exceeded</p></td>
</tr>
<tr class="row-even"><td><p>0x020b</p></td>
<td><p>0x0b</p></td>
<td><p>BLE_ERR_ACL_CONN_EXISTS</p></td>
<td><p>ACL Connection Already Exists</p></td>
</tr>
<tr class="row-odd"><td><p>0x020c</p></td>
<td><p>0x0c</p></td>
<td><p>BLE_ERR_CMD_DISALLOWED</p></td>
<td><p>Command Disallowed</p></td>
</tr>
<tr class="row-even"><td><p>0x020d</p></td>
<td><p>0x0d</p></td>
<td><p>BLE_ERR_CONN_REJ_RESOURCES</p></td>
<td><p>Connection Rejected due to Limited Resources</p></td>
</tr>
<tr class="row-odd"><td><p>0x020e</p></td>
<td><p>0x0e</p></td>
<td><p>BLE_ERR_CONN_REJ_SECURITY</p></td>
<td><p>Connection Rejected Due To Security Reasons</p></td>
</tr>
<tr class="row-even"><td><p>0x020f</p></td>
<td><p>0x0f</p></td>
<td><p>BLE_ERR_CONN_REJ_BD_ADDR</p></td>
<td><p>Connection Rejected due to Unacceptable BD_ADDR</p></td>
</tr>
<tr class="row-odd"><td><p>0x0210</p></td>
<td><p>0x10</p></td>
<td><p>BLE_ERR_CONN_ACCEPT_TMO</p></td>
<td><p>Connection Accept Timeout Exceeded</p></td>
</tr>
<tr class="row-even"><td><p>0x0211</p></td>
<td><p>0x11</p></td>
<td><p>BLE_ERR_UNSUPPORTED</p></td>
<td><p>Unsupported Feature or Parameter Value</p></td>
</tr>
<tr class="row-odd"><td><p>0x0212</p></td>
<td><p>0x12</p></td>
<td><p>BLE_ERR_INV_HCI_CMD_PARMS</p></td>
<td><p>Invalid HCI Command Parameters</p></td>
</tr>
<tr class="row-even"><td><p>0x0213</p></td>
<td><p>0x13</p></td>
<td><p>BLE_ERR_REM_USER_CONN_TERM</p></td>
<td><p>Remote User Terminated Connection</p></td>
</tr>
<tr class="row-odd"><td><p>0x0214</p></td>
<td><p>0x14</p></td>
<td><p>BLE_ERR_RD_CONN_TERM_RESRCS</p></td>
<td><p>Remote Device Terminated Connection due to Low Resources</p></td>
</tr>
<tr class="row-even"><td><p>0x0215</p></td>
<td><p>0x15</p></td>
<td><p>BLE_ERR_RD_CONN_TERM_PWROFF</p></td>
<td><p>Remote Device Terminated Connection due to Power Off</p></td>
</tr>
<tr class="row-odd"><td><p>0x0216</p></td>
<td><p>0x16</p></td>
<td><p>BLE_ERR_CONN_TERM_LOCAL</p></td>
<td><p>Connection Terminated By Local Host</p></td>
</tr>
<tr class="row-even"><td><p>0x0217</p></td>
<td><p>0x17</p></td>
<td><p>BLE_ERR_REPEATED_ATTEMPTS</p></td>
<td><p>Repeated Attempts</p></td>
</tr>
<tr class="row-odd"><td><p>0x0218</p></td>
<td><p>0x18</p></td>
<td><p>BLE_ERR_NO_PAIRING</p></td>
<td><p>Pairing Not Allowed</p></td>
</tr>
<tr class="row-even"><td><p>0x0219</p></td>
<td><p>0x19</p></td>
<td><p>BLE_ERR_UNK_LMP</p></td>
<td><p>Unknown LMP PDU</p></td>
</tr>
<tr class="row-odd"><td><p>0x021a</p></td>
<td><p>0x1a</p></td>
<td><p>BLE_ERR_UNSUPP_REM_FEATURE</p></td>
<td><p>Unsupported Remote Feature / Unsupported LMP Feature</p></td>
</tr>
<tr class="row-even"><td><p>0x021b</p></td>
<td><p>0x1b</p></td>
<td><p>BLE_ERR_SCO_OFFSET</p></td>
<td><p>SCO Offset Rejected</p></td>
</tr>
<tr class="row-odd"><td><p>0x021c</p></td>
<td><p>0x1c</p></td>
<td><p>BLE_ERR_SCO_ITVL</p></td>
<td><p>SCO Interval Rejected</p></td>
</tr>
<tr class="row-even"><td><p>0x021d</p></td>
<td><p>0x1d</p></td>
<td><p>BLE_ERR_SCO_AIR_MODE</p></td>
<td><p>SCO Air Mode Rejected</p></td>
</tr>
<tr class="row-odd"><td><p>0x021e</p></td>
<td><p>0x1e</p></td>
<td><p>BLE_ERR_INV_LMP_LL_PARM</p></td>
<td><p>Invalid LMP Parameters / Invalid LL Parameters</p></td>
</tr>
<tr class="row-even"><td><p>0x021f</p></td>
<td><p>0x1f</p></td>
<td><p>BLE_ERR_UNSPECIFIED</p></td>
<td><p>Unspecified Error</p></td>
</tr>
<tr class="row-odd"><td><p>0x0220</p></td>
<td><p>0x20</p></td>
<td><p>BLE_ERR_UNSUPP_LMP_LL_PARM</p></td>
<td><p>Unsupported LMP Parameter Value / Unsupported LL Parameter Value</p></td>
</tr>
<tr class="row-even"><td><p>0x0221</p></td>
<td><p>0x21</p></td>
<td><p>BLE_ERR_NO_ROLE_CHANGE</p></td>
<td><p>Role Change Not Allowed</p></td>
</tr>
<tr class="row-odd"><td><p>0x0222</p></td>
<td><p>0x22</p></td>
<td><p>BLE_ERR_LMP_LL_RSP_TMO</p></td>
<td><p>LMP Response Timeout / LL Response Timeout</p></td>
</tr>
<tr class="row-even"><td><p>0x0223</p></td>
<td><p>0x23</p></td>
<td><p>BLE_ERR_LMP_COLLISION</p></td>
<td><p>LMP Error Transaction Collision</p></td>
</tr>
<tr class="row-odd"><td><p>0x0224</p></td>
<td><p>0x24</p></td>
<td><p>BLE_ERR_LMP_PDU</p></td>
<td><p>LMP PDU Not Allowed</p></td>
</tr>
<tr class="row-even"><td><p>0x0225</p></td>
<td><p>0x25</p></td>
<td><p>BLE_ERR_ENCRYPTION_MODE</p></td>
<td><p>Encryption Mode Not Acceptable</p></td>
</tr>
<tr class="row-odd"><td><p>0x0226</p></td>
<td><p>0x26</p></td>
<td><p>BLE_ERR_LINK_KEY_CHANGE</p></td>
<td><p>Link Key cannot be Changed</p></td>
</tr>
<tr class="row-even"><td><p>0x0227</p></td>
<td><p>0x27</p></td>
<td><p>BLE_ERR_UNSUPP_QOS</p></td>
<td><p>Requested QoS Not Supported</p></td>
</tr>
<tr class="row-odd"><td><p>0x0228</p></td>
<td><p>0x28</p></td>
<td><p>BLE_ERR_INSTANT_PASSED</p></td>
<td><p>Instant Passed</p></td>
</tr>
<tr class="row-even"><td><p>0x0229</p></td>
<td><p>0x29</p></td>
<td><p>BLE_ERR_UNIT_KEY_PAIRING</p></td>
<td><p>Pairing With Unit Key Not Supported</p></td>
</tr>
<tr class="row-odd"><td><p>0x022a</p></td>
<td><p>0x2a</p></td>
<td><p>BLE_ERR_DIFF_TRANS_COLL</p></td>
<td><p>Different Transaction Collision</p></td>
</tr>
<tr class="row-even"><td><p>0x022c</p></td>
<td><p>0x2c</p></td>
<td><p>BLE_ERR_QOS_PARM</p></td>
<td><p>QoS Unacceptable Parameter</p></td>
</tr>
<tr class="row-odd"><td><p>0x022d</p></td>
<td><p>0x2d</p></td>
<td><p>BLE_ERR_QOS_REJECTED</p></td>
<td><p>QoS Rejected</p></td>
</tr>
<tr class="row-even"><td><p>0x022e</p></td>
<td><p>0x2e</p></td>
<td><p>BLE_ERR_CHAN_CLASS</p></td>
<td><p>Channel Classification Not Supported</p></td>
</tr>
<tr class="row-odd"><td><p>0x022f</p></td>
<td><p>0x2f</p></td>
<td><p>BLE_ERR_INSUFFICIENT_SEC</p></td>
<td><p>Insufficient Security</p></td>
</tr>
<tr class="row-even"><td><p>0x0230</p></td>
<td><p>0x30</p></td>
<td><p>BLE_ERR_PARM_OUT_OF_RANGE</p></td>
<td><p>Parameter Out Of Mandatory Range</p></td>
</tr>
<tr class="row-odd"><td><p>0x0232</p></td>
<td><p>0x32</p></td>
<td><p>BLE_ERR_PENDING_ROLE_SW</p></td>
<td><p>Role Switch Pending</p></td>
</tr>
<tr class="row-even"><td><p>0x0234</p></td>
<td><p>0x34</p></td>
<td><p>BLE_ERR_RESERVED_SLOT</p></td>
<td><p>Reserved Slot Violation</p></td>
</tr>
<tr class="row-odd"><td><p>0x0235</p></td>
<td><p>0x35</p></td>
<td><p>BLE_ERR_ROLE_SW_FAIL</p></td>
<td><p>Role Switch Failed</p></td>
</tr>
<tr class="row-even"><td><p>0x0236</p></td>
<td><p>0x36</p></td>
<td><p>BLE_ERR_INQ_RSP_TOO_BIG</p></td>
<td><p>Extended Inquiry Response Too Large</p></td>
</tr>
<tr class="row-odd"><td><p>0x0237</p></td>
<td><p>0x37</p></td>
<td><p>BLE_ERR_SEC_SIMPLE_PAIR</p></td>
<td><p>Secure Simple Pairing Not Supported By Host</p></td>
</tr>
<tr class="row-even"><td><p>0x0238</p></td>
<td><p>0x38</p></td>
<td><p>BLE_ERR_HOST_BUSY_PAIR</p></td>
<td><p>Host Busy - Pairing</p></td>
</tr>
<tr class="row-odd"><td><p>0x0239</p></td>
<td><p>0x39</p></td>
<td><p>BLE_ERR_CONN_REJ_CHANNEL</p></td>
<td><p>Connection Rejected due to No Suitable Channel Found</p></td>
</tr>
<tr class="row-even"><td><p>0x023a</p></td>
<td><p>0x3a</p></td>
<td><p>BLE_ERR_CTLR_BUSY</p></td>
<td><p>Controller Busy</p></td>
</tr>
<tr class="row-odd"><td><p>0x023b</p></td>
<td><p>0x3b</p></td>
<td><p>BLE_ERR_CONN_PARMS</p></td>
<td><p>Unacceptable Connection Parameters</p></td>
</tr>
<tr class="row-even"><td><p>0x023c</p></td>
<td><p>0x3c</p></td>
<td><p>BLE_ERR_DIR_ADV_TMO</p></td>
<td><p>Directed Advertising Timeout</p></td>
</tr>
<tr class="row-odd"><td><p>0x023d</p></td>
<td><p>0x3d</p></td>
<td><p>BLE_ERR_CONN_TERM_MIC</p></td>
<td><p>Connection Terminated due to MIC Failure</p></td>
</tr>
<tr class="row-even"><td><p>0x023e</p></td>
<td><p>0x3e</p></td>
<td><p>BLE_ERR_CONN_ESTABLISHMENT</p></td>
<td><p>Connection Failed to be Established</p></td>
</tr>
<tr class="row-odd"><td><p>0x023f</p></td>
<td><p>0x3f</p></td>
<td><p>BLE_ERR_MAC_CONN_FAIL</p></td>
<td><p>MAC Connection Failed</p></td>
</tr>
<tr class="row-even"><td><p>0x0240</p></td>
<td><p>0x40</p></td>
<td><p>BLE_ERR_COARSE_CLK_ADJ</p></td>
<td><p>Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="return-codes-l2cap">
<h3><a class="toc-backref" href="#id9">Return codes - L2CAP</a><a class="headerlink" href="#return-codes-l2cap" title="Permalink to this headline"></a></h3>
<table class="docutils align-default">
<colgroup>
<col style="width: 12%" />
<col style="width: 12%" />
<col style="width: 35%" />
<col style="width: 41%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>NimBLE Value</p></th>
<th class="head"><p>Formal Value</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Condition</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>0x0300</p></td>
<td><p>0x00</p></td>
<td><p>BLE_L2CAP_SIG_ERR_CMD_NOT_UNDERSTOOD</p></td>
<td><p>Invalid or unsupported incoming L2CAP sig command.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0301</p></td>
<td><p>0x01</p></td>
<td><p>BLE_L2CAP_SIG_ERR_MTU_EXCEEDED</p></td>
<td><p>Incoming packet too large.</p></td>
</tr>
<tr class="row-even"><td><p>0x0302</p></td>
<td><p>0x02</p></td>
<td><p>BLE_L2CAP_SIG_ERR_INVALID_CID</p></td>
<td><p>No channel with specified ID.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="return-codes-security-manager-us">
<h3><a class="toc-backref" href="#id10">Return codes - Security manager (us)</a><a class="headerlink" href="#return-codes-security-manager-us" title="Permalink to this headline"></a></h3>
<table class="docutils align-default">
<colgroup>
<col style="width: 8%" />
<col style="width: 8%" />
<col style="width: 17%" />
<col style="width: 67%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>NimBLE Value</p></th>
<th class="head"><p>Formal Value</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Condition</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>0x0401</p></td>
<td><p>0x01</p></td>
<td><p>BLE_SM_ERR_PASSKEY</p></td>
<td><p>The user input of passkey failed, for example, the user cancelled the operation.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0402</p></td>
<td><p>0x02</p></td>
<td><p>BLE_SM_ERR_OOB</p></td>
<td><p>The OOB data is not available.</p></td>
</tr>
<tr class="row-even"><td><p>0x0403</p></td>
<td><p>0x03</p></td>
<td><p>BLE_SM_ERR_AUTHREQ</p></td>
<td><p>The pairing procedure cannot be performed as authentication requirements cannot be met due to IO capabilities of one or both devices.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0404</p></td>
<td><p>0x04</p></td>
<td><p>BLE_SM_ERR_CONFIRM_MISMATCH</p></td>
<td><p>The confirm value does not match the calculated compare value.</p></td>
</tr>
<tr class="row-even"><td><p>0x0405</p></td>
<td><p>0x05</p></td>
<td><p>BLE_SM_ERR_PAIR_NOT_SUPP</p></td>
<td><p>Pairing is not supported by the device.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0406</p></td>
<td><p>0x06</p></td>
<td><p>BLE_SM_ERR_ENC_KEY_SZ</p></td>
<td><p>The resultant encryption key size is insufficient for the security requirements of this device.</p></td>
</tr>
<tr class="row-even"><td><p>0x0407</p></td>
<td><p>0x07</p></td>
<td><p>BLE_SM_ERR_CMD_NOT_SUPP</p></td>
<td><p>The SMP command received is not supported on this device.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0408</p></td>
<td><p>0x08</p></td>
<td><p>BLE_SM_ERR_UNSPECIFIED</p></td>
<td><p>Pairing failed due to an unspecified reason.</p></td>
</tr>
<tr class="row-even"><td><p>0x0409</p></td>
<td><p>0x09</p></td>
<td><p>BLE_SM_ERR_REPEATED</p></td>
<td><p>Pairing or authentication procedure is disallowed because too little time has elapsed since last pairing request or security request.</p></td>
</tr>
<tr class="row-odd"><td><p>0x040a</p></td>
<td><p>0x0a</p></td>
<td><p>BLE_SM_ERR_INVAL</p></td>
<td><p>The Invalid Parameters error code indicates that the command length is invalid or that a parameter is outside of the specified range.</p></td>
</tr>
<tr class="row-even"><td><p>0x040b</p></td>
<td><p>0x0b</p></td>
<td><p>BLE_SM_ERR_DHKEY</p></td>
<td><p>Indicates to the remote device that the DHKey Check value received doesn’t match the one calculated by the local device.</p></td>
</tr>
<tr class="row-odd"><td><p>0x040c</p></td>
<td><p>0x0c</p></td>
<td><p>BLE_SM_ERR_NUMCMP</p></td>
<td><p>Indicates that the confirm values in the numeric comparison protocol do not match.</p></td>
</tr>
<tr class="row-even"><td><p>0x040d</p></td>
<td><p>0x0d</p></td>
<td><p>BLE_SM_ERR_ALREADY</p></td>
<td><p>Indicates that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR transport in process.</p></td>
</tr>
<tr class="row-odd"><td><p>0x040e</p></td>
<td><p>0x0e</p></td>
<td><p>BLE_SM_ERR_CROSS_TRANS</p></td>
<td><p>Indicates that the BR/EDR Link Key generated on the BR/EDR transport cannot be used to derive and distribute keys for the LE transport.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="return-codes-security-manager-peer">
<h3><a class="toc-backref" href="#id11">Return codes - Security manager (peer)</a><a class="headerlink" href="#return-codes-security-manager-peer" title="Permalink to this headline"></a></h3>
<table class="docutils align-default">
<colgroup>
<col style="width: 8%" />
<col style="width: 8%" />
<col style="width: 17%" />
<col style="width: 67%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>NimBLE Value</p></th>
<th class="head"><p>Formal Value</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Condition</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>0x0501</p></td>
<td><p>0x01</p></td>
<td><p>BLE_SM_ERR_PASSKEY</p></td>
<td><p>The user input of passkey failed, for example, the user cancelled the operation.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0502</p></td>
<td><p>0x02</p></td>
<td><p>BLE_SM_ERR_OOB</p></td>
<td><p>The OOB data is not available.</p></td>
</tr>
<tr class="row-even"><td><p>0x0503</p></td>
<td><p>0x03</p></td>
<td><p>BLE_SM_ERR_AUTHREQ</p></td>
<td><p>The pairing procedure cannot be performed as authentication requirements cannot be met due to IO capabilities of one or both devices.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0504</p></td>
<td><p>0x04</p></td>
<td><p>BLE_SM_ERR_CONFIRM_MISMATCH</p></td>
<td><p>The confirm value does not match the calculated compare value.</p></td>
</tr>
<tr class="row-even"><td><p>0x0505</p></td>
<td><p>0x05</p></td>
<td><p>BLE_SM_ERR_PAIR_NOT_SUPP</p></td>
<td><p>Pairing is not supported by the device.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0506</p></td>
<td><p>0x06</p></td>
<td><p>BLE_SM_ERR_ENC_KEY_SZ</p></td>
<td><p>The resultant encryption key size is insufficient for the security requirements of this device.</p></td>
</tr>
<tr class="row-even"><td><p>0x0507</p></td>
<td><p>0x07</p></td>
<td><p>BLE_SM_ERR_CMD_NOT_SUPP</p></td>
<td><p>The SMP command received is not supported on this device.</p></td>
</tr>
<tr class="row-odd"><td><p>0x0508</p></td>
<td><p>0x08</p></td>
<td><p>BLE_SM_ERR_UNSPECIFIED</p></td>
<td><p>Pairing failed due to an unspecified reason.</p></td>
</tr>
<tr class="row-even"><td><p>0x0509</p></td>
<td><p>0x09</p></td>
<td><p>BLE_SM_ERR_REPEATED</p></td>
<td><p>Pairing or authentication procedure is disallowed because too little time has elapsed since last pairing request or security request.</p></td>
</tr>
<tr class="row-odd"><td><p>0x050a</p></td>
<td><p>0x0a</p></td>
<td><p>BLE_SM_ERR_INVAL</p></td>
<td><p>The Invalid Parameters error code indicates that the command length is invalid or that a parameter is outside of the specified range.</p></td>
</tr>
<tr class="row-even"><td><p>0x050b</p></td>
<td><p>0x0b</p></td>
<td><p>BLE_SM_ERR_DHKEY</p></td>
<td><p>Indicates to the remote device that the DHKey Check value received doesn’t match the one calculated by the local device.</p></td>
</tr>
<tr class="row-odd"><td><p>0x050c</p></td>
<td><p>0x0c</p></td>
<td><p>BLE_SM_ERR_NUMCMP</p></td>
<td><p>Indicates that the confirm values in the numeric comparison protocol do not match.</p></td>
</tr>
<tr class="row-even"><td><p>0x050d</p></td>
<td><p>0x0d</p></td>
<td><p>BLE_SM_ERR_ALREADY</p></td>
<td><p>Indicates that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR transport in process.</p></td>
</tr>
<tr class="row-odd"><td><p>0x050e</p></td>
<td><p>0x0e</p></td>
<td><p>BLE_SM_ERR_CROSS_TRANS</p></td>
<td><p>Indicates that the BR/EDR Link Key generated on the BR/EDR transport cannot be used to derive and distribute keys for the LE transport.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="rst-footer-buttons row" role="navigation" aria-label="footer navigation">
<a href="ble_gap.html" class="btn btn-neutral float-right" title="NimBLE Host GAP Reference" accesskey="n">Next: NimBLE Host GAP Reference <span class="fa fa-arrow-circle-right"></span></a>
<a href="ble_hs.html" class="btn btn-neutral" title="NimBLE Host" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous: NimBLE Host</a>
</div>
</div>
</div>
</div>
<!-- ENDS CONTENT SECTION -->
</div>
<!-- ENDS .content -->
</div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col-xs-12">
<p class="copyright">Apache Mynewt is available under Apache License, version 2.0.</p>
</div>
<div class="col-xs-12">
<div class="logos">
<img src="../../_static/img/asf_logo_wide_small.png" alt="Apache" title="Apache">
<small class="footnote">
Apache Mynewt, Mynewt, Apache, the Apache feather logo, and the Apache Mynewt project logo are either
registered trademarks or trademarks of the Apache Software Foundation in the United States and other countries.
</small>
<a href="">
<img src="../../_static/img/add_to_slack.png" alt="Slack Icon" title="Join our Slack Community" />
</a>
</div>
</div>
</div>
</div>
</footer>
</div>
<!-- ENDS #wrapper -->
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../../',
VERSION:'latest',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt',
LINK_SUFFIX: '.html'
};
</script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/js/bootstrap-3.0.3.min.js"></script>
<script type="text/javascript" src="../../_static/js/affix.js"></script>
<script type="text/javascript" src="../../_static/js/main.js"></script>
</body>
</html>