blob: 0a6a63f5e7b08c60d94f9ee6b9997ca97f1d6116 [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">
<!-- This is broken by doc revisioning.
-->
<link rel="shortcut icon" href="../../../../img/favicon.ico">
<title>Return codes - Apache Mynewt</title>
<link href="../../../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
<link rel="stylesheet" href="../../../../css/highlight.css">
<link href="../../../../css/base.css" rel="stylesheet">
<link href="../../../../css/custom.css" rel="stylesheet">
<link href="../../../../css/v2.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<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="Return codes">
<div class="container">
<div class="row v2-main-banner">
<a class="logo-cell" href="/">
<img class="logo" src="/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.12.0, Apache NimBLE 1.7.0 </a> released (April 4, 2024)
</div>
</div>
</div>
</div>
<nav id="navbar" class="navbar navbar-inverse affix-top" data-spy="affix" data-offset-top="150" 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
class=""
>
<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
class=""
>
<a href="/about/">About</a>
</li>
<li
class=""
>
<a href="/talks/">Talks</a>
</li>
<li
class="active"
>
<a href="/documentation/">Documentation</a>
</li>
<li
class=""
>
<a href="/download/">Download</a>
</li>
<li
class=""
>
<a href="/community/">Community</a>
</li>
<li
class=""
>
<a href="/events/">Events</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-3 v2-sidebar sidebar-container"><div id="docSidebar" class="hidden-print" role="complementary">
<div class="top">
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search documentation" />
</div>
</form>
</div>
</div>
<ul class="toc-nav">
<li class="doc-version"><select class="form-control" onchange="if (this.value) window.location.href=this.value">
<option value="/latest">
Version: master
</option>
<option value="/v1_12_0/" >
Version: 1.12.0
</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/" >
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" selected="selected" >
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></li>
<li ><a href="../../../../os/introduction/">Mynewt Documentation</a>
<ul>
<li ><a href="../../../../os/get_started/get_started/">Basic Setup</a>
</li>
<li >
<a href="../../../../os/get_started/vocabulary/">Concepts</a>
</li>
<li ><a href="../../../../os/tutorials/tutorials/">Tutorials</a>
</li>
<li ><a href="../../../../os/os_user_guide/">OS User Guide</a>
</li>
<li><a href="
../../ble_intro/
">BLE User Guide</a>
<ul>
<li >
<a href="../../ble_intro/">NimBLE Introduction</a>
</li>
<li >
<a href="../../ble_sec/">NimBLE Security</a>
</li>
<li ><a href="../../ble_setup/ble_setup_intro/">NimBLE Setup</a>
</li>
<li ><a href="../ble_hs/">NimBLE Host API</a>
<ul>
<li class="active">
<a href="./">Return codes</a>
</li>
<li ><a href="../ble_gap/ble_gap/">GAP</a>
</li>
<li ><a href="../ble_gattc/ble_gattc/">GATT client</a>
</li>
<li ><a href="../ble_gatts/ble_gatts/">GATT server</a>
</li>
<li ><a href="../ble_hs_id/ble_hs_id/">Identity</a>
</li>
<li ><a href="../ble_att/ble_att/">ATT</a>
</li>
<li ><a href="../other/other/">Other</a>
</li>
</ul>
</li>
<li ><a href="../../bletiny/bletiny_api/">bletiny app Usage API</a>
</li>
<li ><a href="../../btshell/btshell_api/">btshell app Usage API</a>
</li>
</ul>
</li>
<li ><a href="../../../../newt/newt_intro/">Newt Tool Guide</a>
</li>
<li ><a href="../../../../newtmgr/overview/">Newt Manager Guide</a>
</li>
<li >
<a href="../../../../known_issues/">Known Issues</a>
</li>
</ul>
</li>
<li><a href="
../../../../newt/install/prev_releases/
">Appendix</a>
</li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<div class="doc-header">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="/documentation/">Docs</a></li>
<li>&raquo; <a href="network/ble/ble_hs/ble_hs/">NimBLE Host API</a></li>
<li>&raquo; <a href="network/ble/ble_intro/">BLE User Guide</a></li>
<li>&raquo; <a href="os/introduction/">Mynewt Documentation</a></li>
<li>&raquo; Return codes</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/apache/mynewt-site/blob/master/docs/network/ble/ble_hs/ble_hs_return_codes.md"
class="icon icon-github"> Edit on GitHub</a>
</li>
</ul>
</div>
</div>
<div class="alert alert-warning">
<p>
Version 1.2.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>
<h2 id="nimble-host-return-codes"><font color="F2853F" style="font-size:24pt">NimBLE Host Return Codes</font></h2>
<ul>
<li><a href="#introduction">Introduction</a><ul>
<li><a href="#summary">Summary</a></li>
<li><a href="#example">Example</a></li>
</ul>
</li>
<li><a href="#return-code-reference">Return Code Reference</a><ul>
<li><a href="#return-codes-core">Return codes - Core</a></li>
<li><a href="#return-codes-att">Return codes - ATT</a></li>
<li><a href="#return-codes-hci">Return codes - HCI</a></li>
<li><a href="#return-codes-l2cap">Return codes - L2CAP</a></li>
<li><a href="#return-codes-security-manager-(us)">Return codes - Security manager (us)</a></li>
<li><a href="#return-codes-security-manager-(peer)">Return codes - Security manager (peer)</a></li>
</ul>
</li>
</ul>
<h3 id="introduction">Introduction</h3>
<h4 id="summary">Summary</h4>
<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>
<p>| Set | Condition | Notes|
|-----|-------------|
| Core | Errors detected internally by the NimBLE host. |
| ATT | 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. |
| HCI | 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.
| L2CAP | 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.
| Security manager (us) | 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. |
| Security manager (peer) | 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>
<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>
<thead>
<tr>
<th>Layer</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td>ATT</td>
<td>Invalid handle.</td>
</tr>
<tr>
<td>HCI</td>
<td>Unknown HCI command.</td>
</tr>
<tr>
<td>L2CAP</td>
<td>Signalling MTU exceeded.</td>
</tr>
<tr>
<td>SM</td>
<td>Passkey entry failed.</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>
<thead>
<tr>
<th>Macro</th>
<th>Status code set</th>
<th>Base value</th>
</tr>
</thead>
<tbody>
<tr>
<td>BLE_HS_ATT_ERR()</td>
<td>ATT</td>
<td>0x100</td>
</tr>
<tr>
<td>BLE_HS_HCI_ERR()</td>
<td>HCI</td>
<td>0x200</td>
</tr>
<tr>
<td>BLE_HS_L2C_ERR()</td>
<td>L2CAP</td>
<td>0x300</td>
</tr>
<tr>
<td>BLE_HS_SM_US_ERR()</td>
<td>Security manager (us)</td>
<td>0x400</td>
</tr>
<tr>
<td>BLE_HS_SM_PEER_ERR()</td>
<td>Security manager (peer)</td>
<td>0x500</td>
</tr>
</tbody>
</table>
<h4 id="example">Example</h4>
<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="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">void</span>
<span style="color: #000000">encrypt_connection</span>(<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>)
{
<span style="color: #A90D91">int</span> <span style="color: #000000">rc</span>;
<span style="color: #177500">/* Perform a blocking GAP encryption procedure. */</span>
<span style="color: #000000">rc</span> <span style="color: #000000">=</span> <span style="color: #000000">my_blocking_enc_proc</span>(<span style="color: #000000">conn_handle</span>);
<span style="color: #A90D91">switch</span> (<span style="color: #000000">rc</span>) {
<span style="color: #A90D91">case</span> <span style="color: #1C01CE">0</span>:
<span style="color: #000000">console_printf</span>(<span style="color: #C41A16">&quot;success - link successfully encrypted\n&quot;</span>);
<span style="color: #A90D91">break</span>;
<span style="color: #A90D91">case</span> <span style="color: #000000">BLE_HS_ENOTCONN</span>:
<span style="color: #000000">console_printf</span>(<span style="color: #C41A16">&quot;failure - no connection with handle %d\n&quot;</span>,
<span style="color: #000000">conn_handle</span>);
<span style="color: #A90D91">break</span>;
<span style="color: #A90D91">case</span> <span style="color: #000000">BLE_HS_ERR_SM_US_BASE</span>(<span style="color: #000000">BLE_SM_ERR_CONFIRM_MISMATCH</span>):
<span style="color: #000000">console_printf</span>(<span style="color: #C41A16">&quot;failure - mismatch in peer&#39;s confirm and random &quot;</span>
<span style="color: #C41A16">&quot;commands.\n&quot;</span>);
<span style="color: #A90D91">break</span>;
<span style="color: #A90D91">case</span> <span style="color: #000000">BLE_HS_ERR_SM_PEER_BASE</span>(<span style="color: #000000">BLE_SM_ERR_CONFIRM_MISMATCH</span>):
<span style="color: #000000">console_printf</span>(<span style="color: #C41A16">&quot;failure - peer reports mismatch in our confirm and &quot;</span>
<span style="color: #C41A16">&quot;random commands.\n&quot;</span>);
<span style="color: #A90D91">break</span>;
<span style="color: #A90D91">default</span><span style="color: #000000">:</span>
<span style="color: #000000">console_printf</span>(<span style="color: #C41A16">&quot;failure - other error: 0x%04x\n&quot;</span>, <span style="color: #000000">rc</span>);
<span style="color: #A90D91">break</span>;
}
}
</code></pre></div>
<h3 id="return-code-reference">Return Code Reference</h3>
<h4 id="header">Header</h4>
<p>All NimBLE host return codes are made accessible by including the following header:</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #633820">#include</span> <span style="color: #177500">&quot;host/ble_hs.h&quot;</span>
</code></pre></div>
<h4 id="return-codes-core">Return codes - Core</h4>
<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>
<thead>
<tr>
<th>Value</th>
<th>Name</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x00</td>
<td><em>N/A</em></td>
<td>Success</td>
</tr>
<tr>
<td>0x01</td>
<td>BLE_HS_EAGAIN</td>
<td>Temporary failure; try again.</td>
</tr>
<tr>
<td>0x02</td>
<td>BLE_HS_EALREADY</td>
<td>Operation already in progress or completed.</td>
</tr>
<tr>
<td>0x03</td>
<td>BLE_HS_EINVAL</td>
<td>One or more arguments are invalid.</td>
</tr>
<tr>
<td>0x04</td>
<td>BLE_HS_EMSGSIZE</td>
<td>The provided buffer is too small.</td>
</tr>
<tr>
<td>0x05</td>
<td>BLE_HS_ENOENT</td>
<td>No entry matching the specified criteria.</td>
</tr>
<tr>
<td>0x06</td>
<td>BLE_HS_ENOMEM</td>
<td>Operation failed due to resource exhaustion.</td>
</tr>
<tr>
<td>0x07</td>
<td>BLE_HS_ENOTCONN</td>
<td>No open connection with the specified handle.</td>
</tr>
<tr>
<td>0x08</td>
<td>BLE_HS_ENOTSUP</td>
<td>Operation disabled at compile time.</td>
</tr>
<tr>
<td>0x09</td>
<td>BLE_HS_EAPP</td>
<td>Application callback behaved unexpectedly.</td>
</tr>
<tr>
<td>0x0a</td>
<td>BLE_HS_EBADDATA</td>
<td>Command from peer is invalid.</td>
</tr>
<tr>
<td>0x0b</td>
<td>BLE_HS_EOS</td>
<td>Mynewt OS error.</td>
</tr>
<tr>
<td>0x0c</td>
<td>BLE_HS_ECONTROLLER</td>
<td>Event from controller is invalid.</td>
</tr>
<tr>
<td>0x0d</td>
<td>BLE_HS_ETIMEOUT</td>
<td>Operation timed out.</td>
</tr>
<tr>
<td>0x0e</td>
<td>BLE_HS_EDONE</td>
<td>Operation completed successfully.</td>
</tr>
<tr>
<td>0x0f</td>
<td>BLE_HS_EBUSY</td>
<td>Operation cannot be performed until procedure completes.</td>
</tr>
<tr>
<td>0x10</td>
<td>BLE_HS_EREJECT</td>
<td>Peer rejected a connection parameter update request.</td>
</tr>
<tr>
<td>0x11</td>
<td>BLE_HS_EUNKNOWN</td>
<td>Unexpected failure; catch all.</td>
</tr>
<tr>
<td>0x12</td>
<td>BLE_HS_EROLE</td>
<td>Operation requires different role (e.g., central vs. peripheral).</td>
</tr>
<tr>
<td>0x13</td>
<td>BLE_HS_ETIMEOUT_HCI</td>
<td>HCI request timed out; controller unresponsive.</td>
</tr>
<tr>
<td>0x14</td>
<td>BLE_HS_ENOMEM_EVT</td>
<td>Controller failed to send event due to memory exhaustion (combined host-controller only).</td>
</tr>
<tr>
<td>0x15</td>
<td>BLE_HS_ENOADDR</td>
<td>Operation requires an identity address but none configured.</td>
</tr>
<tr>
<td>0x16</td>
<td>BLE_HS_ENOTSYNCED</td>
<td>Attempt to use the host before it is synced with controller.</td>
</tr>
<tr>
<td>0x17</td>
<td>BLE_HS_EAUTHEN</td>
<td>Insufficient authentication.</td>
</tr>
<tr>
<td>0x18</td>
<td>BLE_HS_EAUTHOR</td>
<td>Insufficient authorization.</td>
</tr>
<tr>
<td>0x19</td>
<td>BLE_HS_EENCRYPT</td>
<td>Insufficient encryption level.</td>
</tr>
<tr>
<td>0x1a</td>
<td>BLE_HS_EENCRYPT_KEY_SZ</td>
<td>Insufficient key size.</td>
</tr>
<tr>
<td>0x1b</td>
<td>BLE_HS_ESTORE_CAP</td>
<td>Storage at capacity.</td>
</tr>
<tr>
<td>0x1c</td>
<td>BLE_HS_ESTORE_FAIL</td>
<td>Storage IO error.</td>
</tr>
</tbody>
</table>
<h4 id="return-codes-att">Return codes - ATT</h4>
<table>
<thead>
<tr>
<th>NimBLE Value</th>
<th>Formal Value</th>
<th>Name</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x0101</td>
<td>0x01</td>
<td>BLE_ATT_ERR_INVALID_HANDLE</td>
<td>The attribute handle given was not valid on this server.</td>
</tr>
<tr>
<td>0x0102</td>
<td>0x02</td>
<td>BLE_ATT_ERR_READ_NOT_PERMITTED</td>
<td>The attribute cannot be read.</td>
</tr>
<tr>
<td>0x0103</td>
<td>0x03</td>
<td>BLE_ATT_ERR_WRITE_NOT_PERMITTED</td>
<td>The attribute cannot be written.</td>
</tr>
<tr>
<td>0x0104</td>
<td>0x04</td>
<td>BLE_ATT_ERR_INVALID_PDU</td>
<td>The attribute PDU was invalid.</td>
</tr>
<tr>
<td>0x0105</td>
<td>0x05</td>
<td>BLE_ATT_ERR_INSUFFICIENT_AUTHEN</td>
<td>The attribute requires authentication before it can be read or written.</td>
</tr>
<tr>
<td>0x0106</td>
<td>0x06</td>
<td>BLE_ATT_ERR_REQ_NOT_SUPPORTED</td>
<td>Attribute server does not support the request received from the client.</td>
</tr>
<tr>
<td>0x0107</td>
<td>0x07</td>
<td>BLE_ATT_ERR_INVALID_OFFSET</td>
<td>Offset specified was past the end of the attribute.</td>
</tr>
<tr>
<td>0x0108</td>
<td>0x08</td>
<td>BLE_ATT_ERR_INSUFFICIENT_AUTHOR</td>
<td>The attribute requires authorization before it can be read or written.</td>
</tr>
<tr>
<td>0x0109</td>
<td>0x09</td>
<td>BLE_ATT_ERR_PREPARE_QUEUE_FULL</td>
<td>Too many prepare writes have been queued.</td>
</tr>
<tr>
<td>0x010a</td>
<td>0x0a</td>
<td>BLE_ATT_ERR_ATTR_NOT_FOUND</td>
<td>No attribute found within the given attribute handle range.</td>
</tr>
<tr>
<td>0x010b</td>
<td>0x0b</td>
<td>BLE_ATT_ERR_ATTR_NOT_LONG</td>
<td>The attribute cannot be read or written using the Read Blob Request.</td>
</tr>
<tr>
<td>0x010c</td>
<td>0x0c</td>
<td>BLE_ATT_ERR_INSUFFICIENT_KEY_SZ</td>
<td>The Encryption Key Size used for encrypting this link is insufficient.</td>
</tr>
<tr>
<td>0x010d</td>
<td>0x0d</td>
<td>BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN</td>
<td>The attribute value length is invalid for the operation.</td>
</tr>
<tr>
<td>0x010e</td>
<td>0x0e</td>
<td>BLE_ATT_ERR_UNLIKELY</td>
<td>The attribute request that was requested has encountered an error that was unlikely, and therefore could not be completed as requested.</td>
</tr>
<tr>
<td>0x010f</td>
<td>0x0f</td>
<td>BLE_ATT_ERR_INSUFFICIENT_ENC</td>
<td>The attribute requires encryption before it can be read or written.</td>
</tr>
<tr>
<td>0x0110</td>
<td>0x10</td>
<td>BLE_ATT_ERR_UNSUPPORTED_GROUP</td>
<td>The attribute type is not a supported grouping attribute as defined by a higher layer specification.</td>
</tr>
<tr>
<td>0x0111</td>
<td>0x11</td>
<td>BLE_ATT_ERR_INSUFFICIENT_RES</td>
<td>Insufficient Resources to complete the request.</td>
</tr>
</tbody>
</table>
<h4 id="return-codes-hci">Return codes - HCI</h4>
<table>
<thead>
<tr>
<th>NimBLE Value</th>
<th>Formal Value</th>
<th>Name</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x0201</td>
<td>0x01</td>
<td>BLE_ERR_UNKNOWN_HCI_CMD</td>
<td>Unknown HCI Command</td>
</tr>
<tr>
<td>0x0202</td>
<td>0x02</td>
<td>BLE_ERR_UNK_CONN_ID</td>
<td>Unknown Connection Identifier</td>
</tr>
<tr>
<td>0x0203</td>
<td>0x03</td>
<td>BLE_ERR_HW_FAIL</td>
<td>Hardware Failure</td>
</tr>
<tr>
<td>0x0204</td>
<td>0x04</td>
<td>BLE_ERR_PAGE_TMO</td>
<td>Page Timeout</td>
</tr>
<tr>
<td>0x0205</td>
<td>0x05</td>
<td>BLE_ERR_AUTH_FAIL</td>
<td>Authentication Failure</td>
</tr>
<tr>
<td>0x0206</td>
<td>0x06</td>
<td>BLE_ERR_PINKEY_MISSING</td>
<td>PIN or Key Missing</td>
</tr>
<tr>
<td>0x0207</td>
<td>0x07</td>
<td>BLE_ERR_MEM_CAPACITY</td>
<td>Memory Capacity Exceeded</td>
</tr>
<tr>
<td>0x0208</td>
<td>0x08</td>
<td>BLE_ERR_CONN_SPVN_TMO</td>
<td>Connection Timeout</td>
</tr>
<tr>
<td>0x0209</td>
<td>0x09</td>
<td>BLE_ERR_CONN_LIMIT</td>
<td>Connection Limit Exceeded</td>
</tr>
<tr>
<td>0x020a</td>
<td>0x0a</td>
<td>BLE_ERR_SYNCH_CONN_LIMIT</td>
<td>Synchronous Connection Limit To A Device Exceeded</td>
</tr>
<tr>
<td>0x020b</td>
<td>0x0b</td>
<td>BLE_ERR_ACL_CONN_EXISTS</td>
<td>ACL Connection Already Exists</td>
</tr>
<tr>
<td>0x020c</td>
<td>0x0c</td>
<td>BLE_ERR_CMD_DISALLOWED</td>
<td>Command Disallowed</td>
</tr>
<tr>
<td>0x020d</td>
<td>0x0d</td>
<td>BLE_ERR_CONN_REJ_RESOURCES</td>
<td>Connection Rejected due to Limited Resources</td>
</tr>
<tr>
<td>0x020e</td>
<td>0x0e</td>
<td>BLE_ERR_CONN_REJ_SECURITY</td>
<td>Connection Rejected Due To Security Reasons</td>
</tr>
<tr>
<td>0x020f</td>
<td>0x0f</td>
<td>BLE_ERR_CONN_REJ_BD_ADDR</td>
<td>Connection Rejected due to Unacceptable BD_ADDR</td>
</tr>
<tr>
<td>0x0210</td>
<td>0x10</td>
<td>BLE_ERR_CONN_ACCEPT_TMO</td>
<td>Connection Accept Timeout Exceeded</td>
</tr>
<tr>
<td>0x0211</td>
<td>0x11</td>
<td>BLE_ERR_UNSUPPORTED</td>
<td>Unsupported Feature or Parameter Value</td>
</tr>
<tr>
<td>0x0212</td>
<td>0x12</td>
<td>BLE_ERR_INV_HCI_CMD_PARMS</td>
<td>Invalid HCI Command Parameters</td>
</tr>
<tr>
<td>0x0213</td>
<td>0x13</td>
<td>BLE_ERR_REM_USER_CONN_TERM</td>
<td>Remote User Terminated Connection</td>
</tr>
<tr>
<td>0x0214</td>
<td>0x14</td>
<td>BLE_ERR_RD_CONN_TERM_RESRCS</td>
<td>Remote Device Terminated Connection due to Low Resources</td>
</tr>
<tr>
<td>0x0215</td>
<td>0x15</td>
<td>BLE_ERR_RD_CONN_TERM_PWROFF</td>
<td>Remote Device Terminated Connection due to Power Off</td>
</tr>
<tr>
<td>0x0216</td>
<td>0x16</td>
<td>BLE_ERR_CONN_TERM_LOCAL</td>
<td>Connection Terminated By Local Host</td>
</tr>
<tr>
<td>0x0217</td>
<td>0x17</td>
<td>BLE_ERR_REPEATED_ATTEMPTS</td>
<td>Repeated Attempts</td>
</tr>
<tr>
<td>0x0218</td>
<td>0x18</td>
<td>BLE_ERR_NO_PAIRING</td>
<td>Pairing Not Allowed</td>
</tr>
<tr>
<td>0x0219</td>
<td>0x19</td>
<td>BLE_ERR_UNK_LMP</td>
<td>Unknown LMP PDU</td>
</tr>
<tr>
<td>0x021a</td>
<td>0x1a</td>
<td>BLE_ERR_UNSUPP_REM_FEATURE</td>
<td>Unsupported Remote Feature / Unsupported LMP Feature</td>
</tr>
<tr>
<td>0x021b</td>
<td>0x1b</td>
<td>BLE_ERR_SCO_OFFSET</td>
<td>SCO Offset Rejected</td>
</tr>
<tr>
<td>0x021c</td>
<td>0x1c</td>
<td>BLE_ERR_SCO_ITVL</td>
<td>SCO Interval Rejected</td>
</tr>
<tr>
<td>0x021d</td>
<td>0x1d</td>
<td>BLE_ERR_SCO_AIR_MODE</td>
<td>SCO Air Mode Rejected</td>
</tr>
<tr>
<td>0x021e</td>
<td>0x1e</td>
<td>BLE_ERR_INV_LMP_LL_PARM</td>
<td>Invalid LMP Parameters / Invalid LL Parameters</td>
</tr>
<tr>
<td>0x021f</td>
<td>0x1f</td>
<td>BLE_ERR_UNSPECIFIED</td>
<td>Unspecified Error</td>
</tr>
<tr>
<td>0x0220</td>
<td>0x20</td>
<td>BLE_ERR_UNSUPP_LMP_LL_PARM</td>
<td>Unsupported LMP Parameter Value / Unsupported LL Parameter Value</td>
</tr>
<tr>
<td>0x0221</td>
<td>0x21</td>
<td>BLE_ERR_NO_ROLE_CHANGE</td>
<td>Role Change Not Allowed</td>
</tr>
<tr>
<td>0x0222</td>
<td>0x22</td>
<td>BLE_ERR_LMP_LL_RSP_TMO</td>
<td>LMP Response Timeout / LL Response Timeout</td>
</tr>
<tr>
<td>0x0223</td>
<td>0x23</td>
<td>BLE_ERR_LMP_COLLISION</td>
<td>LMP Error Transaction Collision</td>
</tr>
<tr>
<td>0x0224</td>
<td>0x24</td>
<td>BLE_ERR_LMP_PDU</td>
<td>LMP PDU Not Allowed</td>
</tr>
<tr>
<td>0x0225</td>
<td>0x25</td>
<td>BLE_ERR_ENCRYPTION_MODE</td>
<td>Encryption Mode Not Acceptable</td>
</tr>
<tr>
<td>0x0226</td>
<td>0x26</td>
<td>BLE_ERR_LINK_KEY_CHANGE</td>
<td>Link Key cannot be Changed</td>
</tr>
<tr>
<td>0x0227</td>
<td>0x27</td>
<td>BLE_ERR_UNSUPP_QOS</td>
<td>Requested QoS Not Supported</td>
</tr>
<tr>
<td>0x0228</td>
<td>0x28</td>
<td>BLE_ERR_INSTANT_PASSED</td>
<td>Instant Passed</td>
</tr>
<tr>
<td>0x0229</td>
<td>0x29</td>
<td>BLE_ERR_UNIT_KEY_PAIRING</td>
<td>Pairing With Unit Key Not Supported</td>
</tr>
<tr>
<td>0x022a</td>
<td>0x2a</td>
<td>BLE_ERR_DIFF_TRANS_COLL</td>
<td>Different Transaction Collision</td>
</tr>
<tr>
<td>0x022c</td>
<td>0x2c</td>
<td>BLE_ERR_QOS_PARM</td>
<td>QoS Unacceptable Parameter</td>
</tr>
<tr>
<td>0x022d</td>
<td>0x2d</td>
<td>BLE_ERR_QOS_REJECTED</td>
<td>QoS Rejected</td>
</tr>
<tr>
<td>0x022e</td>
<td>0x2e</td>
<td>BLE_ERR_CHAN_CLASS</td>
<td>Channel Classification Not Supported</td>
</tr>
<tr>
<td>0x022f</td>
<td>0x2f</td>
<td>BLE_ERR_INSUFFICIENT_SEC</td>
<td>Insufficient Security</td>
</tr>
<tr>
<td>0x0230</td>
<td>0x30</td>
<td>BLE_ERR_PARM_OUT_OF_RANGE</td>
<td>Parameter Out Of Mandatory Range</td>
</tr>
<tr>
<td>0x0232</td>
<td>0x32</td>
<td>BLE_ERR_PENDING_ROLE_SW</td>
<td>Role Switch Pending</td>
</tr>
<tr>
<td>0x0234</td>
<td>0x34</td>
<td>BLE_ERR_RESERVED_SLOT</td>
<td>Reserved Slot Violation</td>
</tr>
<tr>
<td>0x0235</td>
<td>0x35</td>
<td>BLE_ERR_ROLE_SW_FAIL</td>
<td>Role Switch Failed</td>
</tr>
<tr>
<td>0x0236</td>
<td>0x36</td>
<td>BLE_ERR_INQ_RSP_TOO_BIG</td>
<td>Extended Inquiry Response Too Large</td>
</tr>
<tr>
<td>0x0237</td>
<td>0x37</td>
<td>BLE_ERR_SEC_SIMPLE_PAIR</td>
<td>Secure Simple Pairing Not Supported By Host</td>
</tr>
<tr>
<td>0x0238</td>
<td>0x38</td>
<td>BLE_ERR_HOST_BUSY_PAIR</td>
<td>Host Busy - Pairing</td>
</tr>
<tr>
<td>0x0239</td>
<td>0x39</td>
<td>BLE_ERR_CONN_REJ_CHANNEL</td>
<td>Connection Rejected due to No Suitable Channel Found</td>
</tr>
<tr>
<td>0x023a</td>
<td>0x3a</td>
<td>BLE_ERR_CTLR_BUSY</td>
<td>Controller Busy</td>
</tr>
<tr>
<td>0x023b</td>
<td>0x3b</td>
<td>BLE_ERR_CONN_PARMS</td>
<td>Unacceptable Connection Parameters</td>
</tr>
<tr>
<td>0x023c</td>
<td>0x3c</td>
<td>BLE_ERR_DIR_ADV_TMO</td>
<td>Directed Advertising Timeout</td>
</tr>
<tr>
<td>0x023d</td>
<td>0x3d</td>
<td>BLE_ERR_CONN_TERM_MIC</td>
<td>Connection Terminated due to MIC Failure</td>
</tr>
<tr>
<td>0x023e</td>
<td>0x3e</td>
<td>BLE_ERR_CONN_ESTABLISHMENT</td>
<td>Connection Failed to be Established</td>
</tr>
<tr>
<td>0x023f</td>
<td>0x3f</td>
<td>BLE_ERR_MAC_CONN_FAIL</td>
<td>MAC Connection Failed</td>
</tr>
<tr>
<td>0x0240</td>
<td>0x40</td>
<td>BLE_ERR_COARSE_CLK_ADJ</td>
<td>Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging</td>
</tr>
</tbody>
</table>
<h4 id="return-codes-l2cap">Return codes - L2CAP</h4>
<table>
<thead>
<tr>
<th>NimBLE Value</th>
<th>Formal Value</th>
<th>Name</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x0300</td>
<td>0x00</td>
<td>BLE_L2CAP_SIG_ERR_CMD_NOT_UNDERSTOOD</td>
<td>Invalid or unsupported incoming L2CAP sig command.</td>
</tr>
<tr>
<td>0x0301</td>
<td>0x01</td>
<td>BLE_L2CAP_SIG_ERR_MTU_EXCEEDED</td>
<td>Incoming packet too large.</td>
</tr>
<tr>
<td>0x0302</td>
<td>0x02</td>
<td>BLE_L2CAP_SIG_ERR_INVALID_CID</td>
<td>No channel with specified ID.</td>
</tr>
</tbody>
</table>
<h4 id="return-codes-security-manager-us">Return codes - Security manager (us)</h4>
<table>
<thead>
<tr>
<th>NimBLE Value</th>
<th>Formal Value</th>
<th>Name</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x0401</td>
<td>0x01</td>
<td>BLE_SM_ERR_PASSKEY</td>
<td>The user input of passkey failed, for example, the user cancelled the operation.</td>
</tr>
<tr>
<td>0x0402</td>
<td>0x02</td>
<td>BLE_SM_ERR_OOB</td>
<td>The OOB data is not available.</td>
</tr>
<tr>
<td>0x0403</td>
<td>0x03</td>
<td>BLE_SM_ERR_AUTHREQ</td>
<td>The pairing procedure cannot be performed as authentication requirements cannot be met due to IO capabilities of one or both devices.</td>
</tr>
<tr>
<td>0x0404</td>
<td>0x04</td>
<td>BLE_SM_ERR_CONFIRM_MISMATCH</td>
<td>The confirm value does not match the calculated compare value.</td>
</tr>
<tr>
<td>0x0405</td>
<td>0x05</td>
<td>BLE_SM_ERR_PAIR_NOT_SUPP</td>
<td>Pairing is not supported by the device.</td>
</tr>
<tr>
<td>0x0406</td>
<td>0x06</td>
<td>BLE_SM_ERR_ENC_KEY_SZ</td>
<td>The resultant encryption key size is insufficient for the security requirements of this device.</td>
</tr>
<tr>
<td>0x0407</td>
<td>0x07</td>
<td>BLE_SM_ERR_CMD_NOT_SUPP</td>
<td>The SMP command received is not supported on this device.</td>
</tr>
<tr>
<td>0x0408</td>
<td>0x08</td>
<td>BLE_SM_ERR_UNSPECIFIED</td>
<td>Pairing failed due to an unspecified reason.</td>
</tr>
<tr>
<td>0x0409</td>
<td>0x09</td>
<td>BLE_SM_ERR_REPEATED</td>
<td>Pairing or authentication procedure is disallowed because too little time has elapsed since last pairing request or security request.</td>
</tr>
<tr>
<td>0x040a</td>
<td>0x0a</td>
<td>BLE_SM_ERR_INVAL</td>
<td>The Invalid Parameters error code indicates that the command length is invalid or that a parameter is outside of the specified range.</td>
</tr>
<tr>
<td>0x040b</td>
<td>0x0b</td>
<td>BLE_SM_ERR_DHKEY</td>
<td>Indicates to the remote device that the DHKey Check value received doesn’t match the one calculated by the local device.</td>
</tr>
<tr>
<td>0x040c</td>
<td>0x0c</td>
<td>BLE_SM_ERR_NUMCMP</td>
<td>Indicates that the confirm values in the numeric comparison protocol do not match.</td>
</tr>
<tr>
<td>0x040d</td>
<td>0x0d</td>
<td>BLE_SM_ERR_ALREADY</td>
<td>Indicates that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR transport in process.</td>
</tr>
<tr>
<td>0x040e</td>
<td>0x0e</td>
<td>BLE_SM_ERR_CROSS_TRANS</td>
<td>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.</td>
</tr>
</tbody>
</table>
<h4 id="return-codes-security-manager-peer">Return codes - Security manager (peer)</h4>
<table>
<thead>
<tr>
<th>NimBLE Value</th>
<th>Formal Value</th>
<th>Name</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td>0x0501</td>
<td>0x01</td>
<td>BLE_SM_ERR_PASSKEY</td>
<td>The user input of passkey failed, for example, the user cancelled the operation.</td>
</tr>
<tr>
<td>0x0502</td>
<td>0x02</td>
<td>BLE_SM_ERR_OOB</td>
<td>The OOB data is not available.</td>
</tr>
<tr>
<td>0x0503</td>
<td>0x03</td>
<td>BLE_SM_ERR_AUTHREQ</td>
<td>The pairing procedure cannot be performed as authentication requirements cannot be met due to IO capabilities of one or both devices.</td>
</tr>
<tr>
<td>0x0504</td>
<td>0x04</td>
<td>BLE_SM_ERR_CONFIRM_MISMATCH</td>
<td>The confirm value does not match the calculated compare value.</td>
</tr>
<tr>
<td>0x0505</td>
<td>0x05</td>
<td>BLE_SM_ERR_PAIR_NOT_SUPP</td>
<td>Pairing is not supported by the device.</td>
</tr>
<tr>
<td>0x0506</td>
<td>0x06</td>
<td>BLE_SM_ERR_ENC_KEY_SZ</td>
<td>The resultant encryption key size is insufficient for the security requirements of this device.</td>
</tr>
<tr>
<td>0x0507</td>
<td>0x07</td>
<td>BLE_SM_ERR_CMD_NOT_SUPP</td>
<td>The SMP command received is not supported on this device.</td>
</tr>
<tr>
<td>0x0508</td>
<td>0x08</td>
<td>BLE_SM_ERR_UNSPECIFIED</td>
<td>Pairing failed due to an unspecified reason.</td>
</tr>
<tr>
<td>0x0509</td>
<td>0x09</td>
<td>BLE_SM_ERR_REPEATED</td>
<td>Pairing or authentication procedure is disallowed because too little time has elapsed since last pairing request or security request.</td>
</tr>
<tr>
<td>0x050a</td>
<td>0x0a</td>
<td>BLE_SM_ERR_INVAL</td>
<td>The Invalid Parameters error code indicates that the command length is invalid or that a parameter is outside of the specified range.</td>
</tr>
<tr>
<td>0x050b</td>
<td>0x0b</td>
<td>BLE_SM_ERR_DHKEY</td>
<td>Indicates to the remote device that the DHKey Check value received doesn’t match the one calculated by the local device.</td>
</tr>
<tr>
<td>0x050c</td>
<td>0x0c</td>
<td>BLE_SM_ERR_NUMCMP</td>
<td>Indicates that the confirm values in the numeric comparison protocol do not match.</td>
</tr>
<tr>
<td>0x050d</td>
<td>0x0d</td>
<td>BLE_SM_ERR_ALREADY</td>
<td>Indicates that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR transport in process.</td>
</tr>
<tr>
<td>0x050e</td>
<td>0x0e</td>
<td>BLE_SM_ERR_CROSS_TRANS</td>
<td>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.</td>
</tr>
</tbody>
</table>
<div class="row">
<ul class="nav nav-pills" style="margin-bottom: 10px">
<li>
</li>
<li class="pull-right">
</li>
</ul>
</div>
<footer 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">
<a href="https://www.apache.org/">
<img src="/img/asf_logo_wide_small.png" alt="Apache" title="Apache">
</a>
<p>
Copyright © 2015-2021 The Apache Software Foundation.<br>
<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>
</p>
<a href="">
<img src="https://www.countit.com/images/add_to_slack.png" alt="Slack Icon" title="Join our Slack Community" />
</a>
</div>
</div>
<a href="https://www.apache.org/licenses/">
<button class="button-footer-asf">
License
</button>
</a>
<a href="https://www.apache.org/foundation/sponsorship.html">
<button class="button-footer-asf">
Sponsorship
</button>
</a>
<a href="https://www.apache.org/foundation/thanks.html">
<button class="button-footer-asf">
Thanks
</button>
</a>
<a href="https://www.apache.org/security/">
<button class="button-footer-asf">
Security
</button>
</a>
<a href="https://apache.org/events/current-event">
<button class="button-footer-asf">
ASF Events
</button>
</a>
</footer>
</div>
</div>
</div>
<script src="../../../../js/jquery-1.10.2.min.js"></script>
<script src="../../../../js/bootstrap-3.0.3.min.js"></script>
<script src="../../../../js/highlight.pack.js"></script>
<script src="../../../../js/base.js"></script>
<script src="../../../../js/custom.js"></script>
<script src="search/main.js"></script>
</body>
</html>