blob: b43e9895014fcdf08bf1bcb89750eb928fe6561a [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>GAP definitions - 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="GAP definitions">
<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 >
<a href="../../../ble_hs_return_codes/">Return codes</a>
</li>
<li ><a href="../../ble_gap/">GAP</a>
<ul>
<li><a href="
./
">Definitions</a>
<ul>
<li class="active">
<a href="./">GAP definitions</a>
</li>
</ul>
</li>
<li><a href="
../../functions/ble_gap_adv_active/
">Functions</a>
</li>
</ul>
</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; Definitions</li>
<li>&raquo; <a href="network/ble/ble_hs/ble_gap/ble_gap/">GAP</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; GAP definitions</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/apache/mynewt-site/blob/master/docs/network/ble/ble_hs/ble_gap/definitions/ble_gap_defs.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="gap-events"><font color="#F2853F" style="font-size:24pt">GAP events</font></h2>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">typedef</span> <span style="color: #A90D91">int</span> <span style="color: #000000">ble_gap_event_fn</span>(<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_event</span> <span style="color: #000000">*ctxt</span>, <span style="color: #A90D91">void</span> <span style="color: #000000">*arg</span>);
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #633820">#define BLE_GAP_EVENT_CONNECT 0</span>
<span style="color: #633820">#define BLE_GAP_EVENT_DISCONNECT 1</span>
<span style="color: #633820">#define BLE_GAP_EVENT_CONN_CANCEL 2</span>
<span style="color: #633820">#define BLE_GAP_EVENT_CONN_UPDATE 3</span>
<span style="color: #633820">#define BLE_GAP_EVENT_CONN_UPDATE_REQ 4</span>
<span style="color: #633820">#define BLE_GAP_EVENT_L2CAP_UPDATE_REQ 5</span>
<span style="color: #633820">#define BLE_GAP_EVENT_TERM_FAILURE 6</span>
<span style="color: #633820">#define BLE_GAP_EVENT_DISC 7</span>
<span style="color: #633820">#define BLE_GAP_EVENT_DISC_COMPLETE 8</span>
<span style="color: #633820">#define BLE_GAP_EVENT_ADV_COMPLETE 9</span>
<span style="color: #633820">#define BLE_GAP_EVENT_ENC_CHANGE 10</span>
<span style="color: #633820">#define BLE_GAP_EVENT_PASSKEY_ACTION 11</span>
<span style="color: #633820">#define BLE_GAP_EVENT_NOTIFY_RX 12</span>
<span style="color: #633820">#define BLE_GAP_EVENT_NOTIFY_TX 13</span>
<span style="color: #633820">#define BLE_GAP_EVENT_SUBSCRIBE 14</span>
<span style="color: #633820">#define BLE_GAP_EVENT_MTU 15</span>
<span style="color: #633820">#define BLE_GAP_EVENT_IDENTITY_RESOLVED 16</span>
<span style="color: #633820">#define BLE_GAP_EVENT_REPEAT_PAIRING 17</span>
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a GAP-related event. When such an event occurs, the host</span>
<span style="color: #177500"> * notifies the application by passing an instance of this structure to an</span>
<span style="color: #177500"> * application-specified callback.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_event</span> {
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Indicates the type of GAP event that occurred. This is one of the</span>
<span style="color: #177500"> * BLE_GAP_EVENT codes.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">type</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * A discriminated union containing additional details concerning the GAP</span>
<span style="color: #177500"> * event. The &#39;type&#39; field indicates which member of the union is valid.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">union</span> {
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a connection attempt. Valid for the following event</span>
<span style="color: #177500"> * types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_CONNECT</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/**</span>
<span style="color: #177500"> * The status of the connection attempt;</span>
<span style="color: #177500"> * o 0: the connection was successfully established.</span>
<span style="color: #177500"> * o BLE host error code: the connection attempt failed for</span>
<span style="color: #177500"> * the specified reason.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">int</span> <span style="color: #000000">status</span>;
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
} <span style="color: #000000">connect</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a terminated connection. Valid for the following event</span>
<span style="color: #177500"> * types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_DISCONNECT</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/**</span>
<span style="color: #177500"> * A BLE host return code indicating the reason for the</span>
<span style="color: #177500"> * disconnect.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">int</span> <span style="color: #000000">reason</span>;
<span style="color: #177500">/** Information about the connection prior to termination. */</span>
<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_conn_desc</span> <span style="color: #000000">conn</span>;
} <span style="color: #000000">disconnect</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents an advertising report received during a discovery</span>
<span style="color: #177500"> * procedure. Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_DISC</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_disc_desc</span> <span style="color: #000000">disc</span>;
<span style="color: #633820">#if MYNEWT_VAL(BLE_EXT_ADV)</span>
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents an extended advertising report received during a discovery</span>
<span style="color: #177500"> * procedure. Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_EXT_DISC</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_ext_disc_desc</span> <span style="color: #000000">ext_disc</span>;
<span style="color: #633820">#endif</span>
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents an attempt to update a connection&#39;s parameters. If the</span>
<span style="color: #177500"> * attempt was successful, the connection&#39;s descriptor reflects the</span>
<span style="color: #177500"> * updated parameters.</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_CONN_UPDATE</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/**</span>
<span style="color: #177500"> * The result of the connection update attempt;</span>
<span style="color: #177500"> * o 0: the connection was successfully updated.</span>
<span style="color: #177500"> * o BLE host error code: the connection update attempt failed</span>
<span style="color: #177500"> * for the specified reason.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">int</span> <span style="color: #000000">status</span>;
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
} <span style="color: #000000">conn_update</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a peer&#39;s request to update the connection parameters.</span>
<span style="color: #177500"> * This event is generated when a peer performs any of the following</span>
<span style="color: #177500"> * procedures:</span>
<span style="color: #177500"> * o L2CAP Connection Parameter Update Procedure</span>
<span style="color: #177500"> * o Link-Layer Connection Parameters Request Procedure</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * To reject the request, return a non-zero HCI error code. The value</span>
<span style="color: #177500"> * returned is the reject reason given to the controller.</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_L2CAP_UPDATE_REQ</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_CONN_UPDATE_REQ</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Indicates the connection parameters that the peer would like to</span>
<span style="color: #177500"> * use.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_upd_params</span> <span style="color: #000000">*peer_params</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Indicates the connection parameters that the local device would</span>
<span style="color: #177500"> * like to use. The application callback should fill this in. By</span>
<span style="color: #177500"> * default, this struct contains the requested parameters (i.e.,</span>
<span style="color: #177500"> * it is a copy of &#39;peer_params&#39;).</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_upd_params</span> <span style="color: #000000">*self_params</span>;
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
} <span style="color: #000000">conn_update_req</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a failed attempt to terminate an established connection.</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_TERM_FAILURE</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/**</span>
<span style="color: #177500"> * A BLE host return code indicating the reason for the failure.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">int</span> <span style="color: #000000">status</span>;
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
} <span style="color: #000000">term_failure</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents an attempt to change the encrypted state of a</span>
<span style="color: #177500"> * connection. If the attempt was successful, the connection</span>
<span style="color: #177500"> * descriptor reflects the updated encrypted state.</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_ENC_CHANGE</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Indicates the result of the encryption state change attempt;</span>
<span style="color: #177500"> * o 0: the encrypted state was successfully updated;</span>
<span style="color: #177500"> * o BLE host error code: the encryption state change attempt</span>
<span style="color: #177500"> * failed for the specified reason.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">int</span> <span style="color: #000000">status</span>;
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
} <span style="color: #000000">enc_change</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a passkey query needed to complete a pairing procedure.</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_PASSKEY_ACTION</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/** Contains details about the passkey query. */</span>
<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_passkey_params</span> <span style="color: #000000">params</span>;
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
} <span style="color: #000000">passkey</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a received ATT notification or indication.</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_NOTIFY_RX</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/**</span>
<span style="color: #177500"> * The contents of the notification or indication. If the</span>
<span style="color: #177500"> * application wishes to retain this mbuf for later use, it must</span>
<span style="color: #177500"> * set this pointer to NULL to prevent the stack from freeing it.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">os_mbuf</span> <span style="color: #000000">*om</span>;
<span style="color: #177500">/** The handle of the relevant ATT attribute. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">attr_handle</span>;
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Whether the received command is a notification or an</span>
<span style="color: #177500"> * indication;</span>
<span style="color: #177500"> * o 0: Notification;</span>
<span style="color: #177500"> * o 1: Indication.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">indication:</span><span style="color: #1C01CE">1</span>;
} <span style="color: #000000">notify_rx</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a transmitted ATT notification or indication, or a</span>
<span style="color: #177500"> * completed indication transaction.</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_NOTIFY_TX</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/**</span>
<span style="color: #177500"> * The status of the notification or indication transaction;</span>
<span style="color: #177500"> * o 0: Command successfully sent;</span>
<span style="color: #177500"> * o BLE_HS_EDONE: Confirmation (indication ack) received;</span>
<span style="color: #177500"> * o BLE_HS_ETIMEOUT: Confirmation (indication ack) never</span>
<span style="color: #177500"> * received;</span>
<span style="color: #177500"> * o Other return code: Error.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">int</span> <span style="color: #000000">status</span>;
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
<span style="color: #177500">/** The handle of the relevant characterstic value. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">attr_handle</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Whether the transmitted command is a notification or an</span>
<span style="color: #177500"> * indication;</span>
<span style="color: #177500"> * o 0: Notification;</span>
<span style="color: #177500"> * o 1: Indication.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">indication:</span><span style="color: #1C01CE">1</span>;
} <span style="color: #000000">notify_tx</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a state change in a peer&#39;s subscription status. In this</span>
<span style="color: #177500"> * comment, the term &quot;update&quot; is used to refer to either a notification</span>
<span style="color: #177500"> * or an indication. This event is triggered by any of the following</span>
<span style="color: #177500"> * occurrences:</span>
<span style="color: #177500"> * o Peer enables or disables updates via a CCCD write.</span>
<span style="color: #177500"> * o Connection is about to be terminated and the peer is</span>
<span style="color: #177500"> * subscribed to updates.</span>
<span style="color: #177500"> * o Peer is now subscribed to updates after its state was restored</span>
<span style="color: #177500"> * from persistence. This happens when bonding is restored.</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_SUBSCRIBE</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
<span style="color: #177500">/** The value handle of the relevant characteristic. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">attr_handle</span>;
<span style="color: #177500">/** One of the BLE_GAP_SUBSCRIBE_REASON codes. */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">reason</span>;
<span style="color: #177500">/** Whether the peer was previously subscribed to notifications. */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">prev_notify:</span><span style="color: #1C01CE">1</span>;
<span style="color: #177500">/** Whether the peer is currently subscribed to notifications. */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cur_notify:</span><span style="color: #1C01CE">1</span>;
<span style="color: #177500">/** Whether the peer was previously subscribed to indications. */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">prev_indicate:</span><span style="color: #1C01CE">1</span>;
<span style="color: #177500">/** Whether the peer is currently subscribed to indications. */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cur_indicate:</span><span style="color: #1C01CE">1</span>;
} <span style="color: #000000">subscribe</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a change in an L2CAP channel&#39;s MTU.</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_MTU</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Indicates the channel whose MTU has been updated; either</span>
<span style="color: #177500"> * BLE_L2CAP_CID_ATT or the ID of a connection-oriented channel.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">channel_id</span>;
<span style="color: #177500">/* The channel&#39;s new MTU. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">value</span>;
} <span style="color: #000000">mtu</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a change in peer&#39;s identity. This is issued after</span>
<span style="color: #177500"> * successful pairing when Identity Address Information was received.</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_IDENTITY_RESOLVED</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
} <span style="color: #000000">identity_resolved</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a peer&#39;s attempt to pair despite a bond already existing.</span>
<span style="color: #177500"> * The application has two options for handling this event type:</span>
<span style="color: #177500"> * o Retry: Return BLE_GAP_REPEAT_PAIRING_RETRY after deleting the</span>
<span style="color: #177500"> * conflicting bond. The stack will verify the bond has</span>
<span style="color: #177500"> * been deleted and continue the pairing procedure. If</span>
<span style="color: #177500"> * the bond is still present, this event will be reported</span>
<span style="color: #177500"> * again.</span>
<span style="color: #177500"> * o Ignore: Return BLE_GAP_REPEAT_PAIRING_IGNORE. The stack will</span>
<span style="color: #177500"> * silently ignore the pairing request.</span>
<span style="color: #177500"> *</span>
<span style="color: #177500"> * Valid for the following event types:</span>
<span style="color: #177500"> * o BLE_GAP_EVENT_REPEAT_PAIRING</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_repeat_pairing</span> <span style="color: #000000">repeat_pairing</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Represents a change of PHY. This is issue after successful</span>
<span style="color: #177500"> * change on PHY.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> {
<span style="color: #A90D91">int</span> <span style="color: #000000">status</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Indicates enabled TX/RX PHY. Possible values:</span>
<span style="color: #177500"> * o BLE_GAP_LE_PHY_1M</span>
<span style="color: #177500"> * o BLE_GAP_LE_PHY_2M</span>
<span style="color: #177500"> * o BLE_GAP_LE_PHY_CODED</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">tx_phy</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">rx_phy</span>;
} <span style="color: #000000">phy_updated</span>;
};
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #633820">#define BLE_GAP_CONN_MODE_NON 0</span>
<span style="color: #633820">#define BLE_GAP_CONN_MODE_DIR 1</span>
<span style="color: #633820">#define BLE_GAP_CONN_MODE_UND 2</span>
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #633820">#define BLE_GAP_DISC_MODE_NON 0</span>
<span style="color: #633820">#define BLE_GAP_DISC_MODE_LTD 1</span>
<span style="color: #633820">#define BLE_GAP_DISC_MODE_GEN 2</span>
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #177500">/*** Reason codes for the subscribe GAP event. */</span>
<span style="color: #177500">/** Peer&#39;s CCCD subscription state changed due to a descriptor write. */</span>
<span style="color: #633820">#define BLE_GAP_SUBSCRIBE_REASON_WRITE 1</span>
<span style="color: #177500">/** Peer&#39;s CCCD subscription state cleared due to connection termination. */</span>
<span style="color: #633820">#define BLE_GAP_SUBSCRIBE_REASON_TERM 2</span>
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Peer&#39;s CCCD subscription state changed due to restore from persistence</span>
<span style="color: #177500"> * (bonding restored).</span>
<span style="color: #177500"> */</span>
<span style="color: #633820">#define BLE_GAP_SUBSCRIBE_REASON_RESTORE 3</span>
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_sec_state</span> {
<span style="color: #A90D91">unsigned</span> <span style="color: #000000">encrypted:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">unsigned</span> <span style="color: #000000">authenticated:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">unsigned</span> <span style="color: #000000">bonded:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">unsigned</span> <span style="color: #000000">key_size:</span><span style="color: #1C01CE">5</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #177500">/**</span>
<span style="color: #177500"> * conn_mode: One of the following constants:</span>
<span style="color: #177500"> * o BLE_GAP_CONN_MODE_NON</span>
<span style="color: #177500"> * (non-connectable; 3.C.9.3.2).</span>
<span style="color: #177500"> * o BLE_GAP_CONN_MODE_DIR</span>
<span style="color: #177500"> * (directed-connectable; 3.C.9.3.3).</span>
<span style="color: #177500"> * o BLE_GAP_CONN_MODE_UND</span>
<span style="color: #177500"> * (undirected-connectable; 3.C.9.3.4).</span>
<span style="color: #177500"> * disc_mode: One of the following constants:</span>
<span style="color: #177500"> * o BLE_GAP_DISC_MODE_NON</span>
<span style="color: #177500"> * (non-discoverable; 3.C.9.2.2).</span>
<span style="color: #177500"> * o BLE_GAP_DISC_MODE_LTD</span>
<span style="color: #177500"> * (limited-discoverable; 3.C.9.2.3).</span>
<span style="color: #177500"> * o BLE_GAP_DISC_MODE_GEN</span>
<span style="color: #177500"> * (general-discoverable; 3.C.9.2.4).</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_adv_params</span> {
<span style="color: #177500">/*** Mandatory fields. */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">conn_mode</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">disc_mode</span>;
<span style="color: #177500">/*** Optional fields; assign 0 to make the stack calculate them. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">itvl_min</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">itvl_max</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">channel_map</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">filter_policy</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">high_duty_cycle:</span><span style="color: #1C01CE">1</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #633820">#define BLE_GAP_ROLE_MASTER 0</span>
<span style="color: #633820">#define BLE_GAP_ROLE_SLAVE 1</span>
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_conn_desc</span> {
<span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_sec_state</span> <span style="color: #000000">sec_state</span>;
<span style="color: #000000">ble_addr_t</span> <span style="color: #000000">our_id_addr</span>;
<span style="color: #000000">ble_addr_t</span> <span style="color: #000000">peer_id_addr</span>;
<span style="color: #000000">ble_addr_t</span> <span style="color: #000000">our_ota_addr</span>;
<span style="color: #000000">ble_addr_t</span> <span style="color: #000000">peer_ota_addr</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_itvl</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_latency</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">supervision_timeout</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">role</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">master_clock_accuracy</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_conn_params</span> {
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">scan_itvl</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">scan_window</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">itvl_min</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">itvl_max</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">latency</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">supervision_timeout</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">min_ce_len</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">max_ce_len</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_ext_disc_params</span> {
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">itvl</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">window</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">passive:</span><span style="color: #1C01CE">1</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_disc_params</span> {
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">itvl</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">window</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">filter_policy</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">limited:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">passive:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">filter_duplicates:</span><span style="color: #1C01CE">1</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_upd_params</span> {
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">itvl_min</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">itvl_max</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">latency</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">supervision_timeout</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">min_ce_len</span>;
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">max_ce_len</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_passkey_params</span> {
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">action</span>;
<span style="color: #A90D91">uint32_t</span> <span style="color: #000000">numcmp</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_disc_desc</span> {
<span style="color: #177500">/*** Common fields. */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">event_type</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">length_data</span>;
<span style="color: #000000">ble_addr_t</span> <span style="color: #000000">addr</span>;
<span style="color: #A90D91">int8_t</span> <span style="color: #000000">rssi</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">*data</span>;
<span style="color: #177500">/***</span>
<span style="color: #177500"> * LE direct advertising report fields; direct_addr is BLE_ADDR_ANY if</span>
<span style="color: #177500"> * direct address fields are not present.</span>
<span style="color: #177500"> */</span>
<span style="color: #000000">ble_addr_t</span> <span style="color: #000000">direct_addr</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_repeat_pairing</span> {
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
<span style="color: #177500">/** Properties of the existing bond. */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cur_key_size</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cur_authenticated:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cur_sc:</span><span style="color: #1C01CE">1</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Properties of the imminent secure link if the pairing procedure is</span>
<span style="color: #177500"> * allowed to continue.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">new_key_size</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">new_authenticated:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">new_sc:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">new_bonding:</span><span style="color: #1C01CE">1</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_disc_desc</span> {
<span style="color: #177500">/*** Common fields. */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">event_type</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">length_data</span>;
<span style="color: #000000">ble_addr_t</span> <span style="color: #000000">addr</span>;
<span style="color: #A90D91">int8_t</span> <span style="color: #000000">rssi</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">*data</span>;
<span style="color: #177500">/***</span>
<span style="color: #177500"> * LE direct advertising report fields; direct_addr is BLE_ADDR_ANY if</span>
<span style="color: #177500"> * direct address fields are not present.</span>
<span style="color: #177500"> */</span>
<span style="color: #000000">ble_addr_t</span> <span style="color: #000000">direct_addr</span>;
};
</code></pre></div>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code><span style="color: #A90D91">struct</span> <span style="color: #3F6E75">ble_gap_repeat_pairing</span> {
<span style="color: #177500">/** The handle of the relevant connection. */</span>
<span style="color: #A90D91">uint16_t</span> <span style="color: #000000">conn_handle</span>;
<span style="color: #177500">/** Properties of the existing bond. */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cur_key_size</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cur_authenticated:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cur_sc:</span><span style="color: #1C01CE">1</span>;
<span style="color: #177500">/**</span>
<span style="color: #177500"> * Properties of the imminent secure link if the pairing procedure is</span>
<span style="color: #177500"> * allowed to continue.</span>
<span style="color: #177500"> */</span>
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">new_key_size</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">new_authenticated:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">new_sc:</span><span style="color: #1C01CE">1</span>;
<span style="color: #A90D91">uint8_t</span> <span style="color: #000000">new_bonding:</span><span style="color: #1C01CE">1</span>;
};
</code></pre></div>
<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>