blob: 9b320db12a5d33489aeff35748ac7574af70982b [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 GATT Server Reference &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 Identity Reference" href="ble_hs_id.html"/>
<link rel="prev" title="NimBLE Host GATT Client Reference" href="ble_gattc.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 GATT Server Reference
<div class="sourcelink">
<a href="https://github.com/apache/mynewt-nimble/edit/master/docs/ble_hs/ble_gatts.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" >
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"><a class="reference internal" href="ble_hs_return_codes.html">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 current"><a class="current reference internal" href="#">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="">
<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-gatt-server-reference">
<h1>NimBLE Host GATT Server Reference<a class="headerlink" href="#nimble-host-gatt-server-reference" title="Permalink to this headline"></a></h1>
<div class="section" id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<p>The Generic Attribute Profile (GATT) manages all activities involving services, characteristics, and descriptors. The
server half of the GATT API handles registration and responding to GATT clients.</p>
</div>
<div class="section" id="api">
<h2>API<a class="headerlink" href="#api" title="Permalink to this headline"></a></h2>
<dl class="c type">
<dt id="c.ble_gatt_mtu_fn">
<span class="target" id="group__bt__gatt_1gad09ed5e1b02e63818286f1d25598f7c4"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatt_mtu_fn</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_error" title="ble_gatt_error"><span class="pre">ble_gatt_error</span></a> <span class="pre">*</span><em><span class="pre">error</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">mtu</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Function prototype for the GATT MTU exchange callback. </p>
</dd></dl>
<dl class="c type">
<dt id="c.ble_gatt_disc_svc_fn">
<span class="target" id="group__bt__gatt_1ga0b15c28c4487eebff452b8cabdf7e889"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatt_disc_svc_fn</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_error" title="ble_gatt_error"><span class="pre">ble_gatt_error</span></a> <span class="pre">*</span><em><span class="pre">error</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_svc" title="ble_gatt_svc"><span class="pre">ble_gatt_svc</span></a> <span class="pre">*</span><em><span class="pre">service</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Function prototype for the GATT service discovery callback. </p>
</dd></dl>
<dl class="c type">
<dt id="c.ble_gatt_attr_fn">
<span class="target" id="group__bt__gatt_1gaf1ef9a1287d92512841ff26bd8898bea"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatt_attr_fn</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_error" title="ble_gatt_error"><span class="pre">ble_gatt_error</span></a> <span class="pre">*</span><em><span class="pre">error</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr" title="ble_gatt_attr"><span class="pre">ble_gatt_attr</span></a> <span class="pre">*</span><em><span class="pre">attr</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>The host will free the attribute mbuf automatically after the callback is executed. </p>
<p>The application can take ownership of the mbuf and prevent it from being freed by assigning NULL to attr-&gt;om. </p>
</dd></dl>
<dl class="c type">
<dt id="c.ble_gatt_attr_mult_fn">
<span class="target" id="group__bt__gatt_1gac4ea4e46068a9f41fd4faf3b4990514f"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatt_attr_mult_fn</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_error" title="ble_gatt_error"><span class="pre">ble_gatt_error</span></a> <span class="pre">*</span><em><span class="pre">error</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr" title="ble_gatt_attr"><span class="pre">ble_gatt_attr</span></a> <span class="pre">*</span><em><span class="pre">attrs</span></em>, <span class="pre">uint8_t</span> <em><span class="pre">num_attrs</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>The host will free the attribute mbuf automatically after the callback is executed. </p>
<p>The application can take ownership of the mbuf and prevent it from being freed by assigning NULL to attr-&gt;om. </p>
</dd></dl>
<dl class="c type">
<dt id="c.ble_gatt_reliable_attr_fn">
<span class="target" id="group__bt__gatt_1ga32f035740012749729d31cdb7e8264bf"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatt_reliable_attr_fn</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_error" title="ble_gatt_error"><span class="pre">ble_gatt_error</span></a> <span class="pre">*</span><em><span class="pre">error</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr" title="ble_gatt_attr"><span class="pre">ble_gatt_attr</span></a> <span class="pre">*</span><em><span class="pre">attrs</span></em>, <span class="pre">uint8_t</span> <em><span class="pre">num_attrs</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>The host will free the attribute mbufs automatically after the callback is executed. </p>
<p>The application can take ownership of the mbufs and prevent them from being freed by assigning NULL to each attribute’s om field. </p>
</dd></dl>
<dl class="c type">
<dt id="c.ble_gatt_chr_fn">
<span class="target" id="group__bt__gatt_1ga5b947c2b9a01b6ed61495c5b8ab9c0de"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatt_chr_fn</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_error" title="ble_gatt_error"><span class="pre">ble_gatt_error</span></a> <span class="pre">*</span><em><span class="pre">error</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_chr" title="ble_gatt_chr"><span class="pre">ble_gatt_chr</span></a> <span class="pre">*</span><em><span class="pre">chr</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Function prototype for the GATT characteristic callback. </p>
</dd></dl>
<dl class="c type">
<dt id="c.ble_gatt_dsc_fn">
<span class="target" id="group__bt__gatt_1ga277b6a606e487efeb16d0afa56d1ffb2"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatt_dsc_fn</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_error" title="ble_gatt_error"><span class="pre">ble_gatt_error</span></a> <span class="pre">*</span><em><span class="pre">error</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">chr_val_handle</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_dsc" title="ble_gatt_dsc"><span class="pre">ble_gatt_dsc</span></a> <span class="pre">*</span><em><span class="pre">dsc</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Function prototype for the GATT descriptor callback. </p>
</dd></dl>
<dl class="c type">
<dt id="c.ble_gatt_access_fn">
<span class="target" id="group__bt__gatt_1gaaf7ba4a23b6387783d837b11e8e1a6b3"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatt_access_fn</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">attr_handle</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_access_ctxt" title="ble_gatt_access_ctxt"><span class="pre">ble_gatt_access_ctxt</span></a> <span class="pre">*</span><em><span class="pre">ctxt</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Type definition for GATT access callback function. </p>
</dd></dl>
<dl class="c type">
<dt id="c.ble_gatt_chr_flags">
<span class="target" id="group__bt__gatt_1gaf407eef20aab2f2621e1ab3403b3347d"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">uint16_t</span> <code class="sig-name descname"><span class="pre">ble_gatt_chr_flags</span></code><br /></dt>
<dd><p>Type definition for GATT characteristic flags. </p>
</dd></dl>
<dl class="c type">
<dt id="c.ble_gatt_register_fn">
<span class="target" id="group__bt__gatt_1ga5037f6bf90d5e3f57dcc51040f3209a2"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">void</span> <code class="sig-name descname"><span class="pre">ble_gatt_register_fn</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_register_ctxt" title="ble_gatt_register_ctxt"><span class="pre">ble_gatt_register_ctxt</span></a> <span class="pre">*</span><em><span class="pre">ctxt</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Type definition for GATT registration callback function. </p>
</dd></dl>
<dl class="c type">
<dt id="c.ble_gatt_svc_foreach_fn">
<span class="target" id="group__bt__gatt_1gad5aaaa4de2073fa6e7bb2fa020b7b481"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">void</span> <span class="pre">(</span><span class="pre">*</span><code class="sig-name descname"><span class="pre">ble_gatt_svc_foreach_fn</span></code><span class="pre">)</span><span class="sig-paren">(</span><em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_svc_def" title="ble_gatt_svc_def"><span class="pre">ble_gatt_svc_def</span></a> <span class="pre">*</span><span class="pre">svc</span>, <span class="pre">uint16_t</span> <span class="pre">handle</span>, <span class="pre">uint16_t</span> <span class="pre">end_group_handle</span>, <span class="pre">void</span> <span class="pre">*</span><span class="pre">arg</span><span class="sig-paren">)</span><br /></dt>
<dd><p>Type definition for GATT service iteration callback function. </p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_exchange_mtu">
<span class="target" id="group__bt__gatt_1gaf4911e0181c0fc9ef792d830cfdeb605"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_exchange_mtu</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_mtu_fn" title="ble_gatt_mtu_fn"><span class="pre">ble_gatt_mtu_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Exchange MTU. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_disc_all_svcs">
<span class="target" id="group__bt__gatt_1gace43e36eec9515aeeab52e8d4634ba5c"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_disc_all_svcs</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_disc_svc_fn" title="ble_gatt_disc_svc_fn"><span class="pre">ble_gatt_disc_svc_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Discover All Primary Services. </p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function. </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_disc_svc_by_uuid">
<span class="target" id="group__bt__gatt_1ga1babf0ff9d4318599cf614e106165b13"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_disc_svc_by_uuid</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><em><span class="pre">uuid</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_disc_svc_fn" title="ble_gatt_disc_svc_fn"><span class="pre">ble_gatt_disc_svc_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Discover Primary Service by Service UUID. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">uuid</span></code>: The 128-bit UUID of the service to discover. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_find_inc_svcs">
<span class="target" id="group__bt__gatt_1ga4991e2809f0c09174d65e242ce621a44"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_find_inc_svcs</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">start_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">end_handle</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_disc_svc_fn" title="ble_gatt_disc_svc_fn"><span class="pre">ble_gatt_disc_svc_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Find Included Services. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">start_handle</span></code>: The handle to begin the search at (generally the service definition handle). </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">end_handle</span></code>: The handle to end the search at (generally the last handle in the service). </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_disc_all_chrs">
<span class="target" id="group__bt__gatt_1ga5e7beef44aee96f104ae9f68c9e6a8a8"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_disc_all_chrs</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">start_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">end_handle</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_chr_fn" title="ble_gatt_chr_fn"><span class="pre">ble_gatt_chr_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Discover All Characteristics of a Service. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">start_handle</span></code>: The handle to begin the search at (generally the service definition handle). </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">end_handle</span></code>: The handle to end the search at (generally the last handle in the service). </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_disc_chrs_by_uuid">
<span class="target" id="group__bt__gatt_1gad4ac769b099e5abd0b449faf1ce4f7d0"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_disc_chrs_by_uuid</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">start_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">end_handle</span></em>, <em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><em><span class="pre">uuid</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_chr_fn" title="ble_gatt_chr_fn"><span class="pre">ble_gatt_chr_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Discover Characteristics by UUID. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">start_handle</span></code>: The handle to begin the search at (generally the service definition handle). </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">end_handle</span></code>: The handle to end the search at (generally the last handle in the service). </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">uuid</span></code>: The 128-bit UUID of the characteristic to discover. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_disc_all_dscs">
<span class="target" id="group__bt__gatt_1ga91edf2856f9002cfa65645137c08adbc"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_disc_all_dscs</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">start_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">end_handle</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_dsc_fn" title="ble_gatt_dsc_fn"><span class="pre">ble_gatt_dsc_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Discover All Characteristic Descriptors. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">start_handle</span></code>: The handle of the characteristic value attribute. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">end_handle</span></code>: The last handle in the characteristic definition. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_read">
<span class="target" id="group__bt__gatt_1ga7a064cdd6d5d497aec20522ed424b4f3"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_read</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">attr_handle</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr_fn" title="ble_gatt_attr_fn"><span class="pre">ble_gatt_attr_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Read Characteristic Value. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">attr_handle</span></code>: The handle of the characteristic value to read. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_read_by_uuid">
<span class="target" id="group__bt__gatt_1ga808ca4477a0465371ae218159259af83"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_read_by_uuid</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">start_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">end_handle</span></em>, <em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><em><span class="pre">uuid</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr_fn" title="ble_gatt_attr_fn"><span class="pre">ble_gatt_attr_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Read Using Characteristic UUID. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">start_handle</span></code>: The first handle to search (generally the handle of the service definition). </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">end_handle</span></code>: The last handle to search (generally the last handle in the service definition). </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">uuid</span></code>: The 128-bit UUID of the characteristic to read. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_read_long">
<span class="target" id="group__bt__gatt_1gaffe79a92f711b48213f0a7e06df08f94"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_read_long</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">offset</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr_fn" title="ble_gatt_attr_fn"><span class="pre">ble_gatt_attr_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Read Long Characteristic Values. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">handle</span></code>: The handle of the characteristic value to read. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">offset</span></code>: The offset within the characteristic value to start reading. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_read_mult">
<span class="target" id="group__bt__gatt_1ga5e1f5f65194ff1111149f44cefe75ebb"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_read_mult</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">const</span></em> <span class="pre">uint16_t</span> <span class="pre">*</span><em><span class="pre">handles</span></em>, <span class="pre">uint8_t</span> <em><span class="pre">num_handles</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr_fn" title="ble_gatt_attr_fn"><span class="pre">ble_gatt_attr_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Read Multiple Characteristic Values. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">handles</span></code>: An array of 16-bit attribute handles to read. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">num_handles</span></code>: The number of entries in the “handles” array. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_read_mult_var">
<span class="target" id="group__bt__gatt_1ga2185917de585c65317a86492834679fc"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_read_mult_var</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">const</span></em> <span class="pre">uint16_t</span> <span class="pre">*</span><em><span class="pre">handles</span></em>, <span class="pre">uint8_t</span> <em><span class="pre">num_handles</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr_mult_fn" title="ble_gatt_attr_mult_fn"><span class="pre">ble_gatt_attr_mult_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd></dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_write_no_rsp">
<span class="target" id="group__bt__gatt_1ga9aa492327926f7a1afb2325b648b5a57"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_write_no_rsp</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">attr_handle</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><em><span class="pre">om</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Write Without Response. </p>
<p>This function consumes the supplied mbuf regardless of the outcome.</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">attr_handle</span></code>: The handle of the characteristic value to write to. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">om</span></code>: The value to write to the characteristic.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_write_no_rsp_flat">
<span class="target" id="group__bt__gatt_1gaaaa6a0636d070d8723ebc4469373ec31"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_write_no_rsp_flat</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">attr_handle</span></em>, <em class="property"><span class="pre">const</span></em> <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">data</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">data_len</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Write Without Response. </p>
<p>This function consumes the supplied mbuf regardless of the outcome.</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">attr_handle</span></code>: The handle of the characteristic value to write to. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">data</span></code>: The value to write to the characteristic. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">data_len</span></code>: The number of bytes to write.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_write">
<span class="target" id="group__bt__gatt_1gaeeef16e4de8e87e6c7c2fe5e8a1ef0ed"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_write</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">attr_handle</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><em><span class="pre">om</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr_fn" title="ble_gatt_attr_fn"><span class="pre">ble_gatt_attr_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Write Characteristic Value. </p>
<p>This function consumes the supplied mbuf regardless of the outcome.</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">attr_handle</span></code>: The handle of the characteristic value to write to. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">om</span></code>: The value to write to the characteristic. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_write_flat">
<span class="target" id="group__bt__gatt_1ga3d3dd778f7808144bbdd940060c417ad"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_write_flat</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">attr_handle</span></em>, <em class="property"><span class="pre">const</span></em> <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">data</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">data_len</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr_fn" title="ble_gatt_attr_fn"><span class="pre">ble_gatt_attr_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Write Characteristic Value (flat buffer version). </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">attr_handle</span></code>: The handle of the characteristic value to write to. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">data</span></code>: The value to write to the characteristic. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">data_len</span></code>: The number of bytes to write. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_write_long">
<span class="target" id="group__bt__gatt_1gada6f22a58f6d1e1a559cd4423c655a67"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_write_long</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">attr_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">offset</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><em><span class="pre">om</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr_fn" title="ble_gatt_attr_fn"><span class="pre">ble_gatt_attr_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Write Long Characteristic Values. </p>
<p>This function consumes the supplied mbuf regardless of the outcome.</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">attr_handle</span></code>: The handle of the characteristic value to write to. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">offset</span></code>: The offset at which to begin writing the value. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">om</span></code>: The value to write to the characteristic. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_write_reliable">
<span class="target" id="group__bt__gatt_1ga4da6b7452bc1a6a0a9a083664dc0cc35"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_write_reliable</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_attr" title="ble_gatt_attr"><span class="pre">ble_gatt_attr</span></a> <span class="pre">*</span><em><span class="pre">attrs</span></em>, <span class="pre">int</span> <em><span class="pre">num_attrs</span></em>, <a class="reference internal" href="ble_gattc.html#c.ble_gatt_reliable_attr_fn" title="ble_gatt_reliable_attr_fn"><span class="pre">ble_gatt_reliable_attr_fn</span></a> <span class="pre">*</span><em><span class="pre">cb</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">cb_arg</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Initiates GATT procedure: Reliable Writes. </p>
<p>This function consumes the supplied mbufs regardless of the outcome.</p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">attrs</span></code>: An array of attribute descriptors; specifies which characteristics to write to and what data to write to them. The mbuf pointer in each attribute is set to NULL by this function. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">num_attrs</span></code>: The number of characteristics to write; equal to the number of elements in the ‘attrs’ array. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb</span></code>: The function to call to report procedure status updates; null for no callback. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">cb_arg</span></code>: The optional argument to pass to the callback function. </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_notify_custom">
<span class="target" id="group__bt__gatt_1ga8399bad2b2e9980d61356f294d9db51a"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_notify_custom</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">att_handle</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><em><span class="pre">om</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Sends a “free-form” characteristic notification. </p>
<p>This function consumes the supplied mbuf regardless of the outcome.</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">att_handle</span></code>: The attribute handle to indicate in the outgoing notification. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">om</span></code>: The value to write to the characteristic.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_notify_custom">
<span class="target" id="group__bt__gatt_1gaf0f2e0bb27743682937e355269b837c8"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_notify_custom</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">att_handle</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><em><span class="pre">om</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Deprecated. </p>
<p>Should not be used. Use ble_gatts_notify_custom instead. </p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_notify">
<span class="target" id="group__bt__gatt_1gac654b57fd729eeb69b3bede70f08b7f3"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_notify</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">chr_val_handle</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Sends a characteristic notification. </p>
<p>The content of the message is read from the specified characteristic.</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">chr_val_handle</span></code>: The value attribute handle of the characteristic to include in the outgoing notification.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_notify">
<span class="target" id="group__bt__gatt_1gab89b4b772ab1a571d0b58ecc5f0aa8cb"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_notify</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">chr_val_handle</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Deprecated. </p>
<p>Should not be used. Use ble_gatts_notify instead. </p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_indicate_custom">
<span class="target" id="group__bt__gatt_1ga8110528b7e565549cc9d5eef8d916c92"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_indicate_custom</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">chr_val_handle</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><em><span class="pre">txom</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Sends a “free-form” characteristic indication. </p>
<p>The provided mbuf contains the indication payload. This function consumes the supplied mbuf regardless of the outcome.</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">chr_val_handle</span></code>: The value attribute handle of the characteristic to include in the outgoing indication. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">txom</span></code>: The data to include in the indication.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_indicate_custom">
<span class="target" id="group__bt__gatt_1ga864cb0f2dcc73b13e21935142ccf7f0f"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_indicate_custom</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">chr_val_handle</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><em><span class="pre">txom</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Deprecated. </p>
<p>Should not be used. Use ble_gatts_indicate_custom instead. </p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_indicate">
<span class="target" id="group__bt__gatt_1ga4c1f7c12a52fdf608055187d6b3f9a20"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_indicate</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">chr_val_handle</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Sends a characteristic indication. </p>
<p>The content of the message is read from the specified characteristic.</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; nonzero on failure. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: The connection over which to execute the procedure. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">chr_val_handle</span></code>: The value attribute handle of the characteristic to include in the outgoing indication.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_indicate">
<span class="target" id="group__bt__gatt_1gac658e0cc31faad2957899be32fe3f6d1"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_indicate</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <span class="pre">uint16_t</span> <em><span class="pre">chr_val_handle</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Deprecated. </p>
<p>Should not be used. Use ble_gatts_indicate instead. </p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gattc_init">
<span class="target" id="group__bt__gatt_1ga17ff3332664e2ca30a787398b0308e90"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gattc_init</span></code><span class="sig-paren">(</span><span class="pre">void</span><span class="sig-paren">)</span><br /></dt>
<dd><p>Initialize the BLE GATT client. </p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_add_svcs">
<span class="target" id="group__bt__gatt_1ga99d2d13bc754b0974e9e44e0c688545e"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_add_svcs</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_svc_def" title="ble_gatt_svc_def"><span class="pre">ble_gatt_svc_def</span></a> <span class="pre">*</span><em><span class="pre">svcs</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Queues a set of service definitions for registration. </p>
<p>All services queued in this manner get registered when <a class="reference internal" href="#group__bt__gatt_1ga0f275519237f258d4a8006277083467f"><span class="std std-ref">ble_gatts_start()</span></a> is called.</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; BLE_HS_ENOMEM on heap exhaustion. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">svcs</span></code>: An array of service definitions to queue for registration. This array must be terminated with an entry whose ‘type’ equals 0.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_svc_set_visibility">
<span class="target" id="group__bt__gatt_1gad0e3d52f2097b3281a704cdb4a1516fd"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_svc_set_visibility</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">handle</span></em>, <span class="pre">int</span> <em><span class="pre">visible</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Set visibility of local GATT service. </p>
<p>Invisible services are not removed from database but are not discoverable by peer devices. Service Changed should be handled by application when needed by calling ble_svc_gatt_changed().</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; BLE_HS_ENOENT if service wasn’t found. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">handle</span></code>: Handle of service </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">visible</span></code>: non-zero if service should be visible</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_count_cfg">
<span class="target" id="group__bt__gatt_1ga7d2193ce113c74dd4789133c0747e1c6"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_count_cfg</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_svc_def" title="ble_gatt_svc_def"><span class="pre">ble_gatt_svc_def</span></a> <span class="pre">*</span><em><span class="pre">defs</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Adjusts a host configuration object’s settings to accommodate the specified service definition array. </p>
<p>This function adds the counts to the appropriate fields in the supplied configuration object without clearing them first, so it can be called repeatedly with different inputs to calculate totals. Be sure to zero the GATT server settings prior to the first call to this function.</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; BLE_HS_EINVAL if the svcs array contains an invalid resource definition. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">defs</span></code>: The service array containing the resource definitions to be counted.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_chr_updated">
<span class="target" id="group__bt__gatt_1ga87841c2cd3d616d48d68280fcacf9eb1"></span><span class="pre">void</span> <code class="sig-name descname"><span class="pre">ble_gatts_chr_updated</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">chr_val_handle</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Send notification (or indication) to any connected devices that have subscribed for notification (or indication) for specified characteristic. </p>
<p><dl class="simple">
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">chr_val_handle</span></code>: Characteristic value handle </p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_find_svc">
<span class="target" id="group__bt__gatt_1ga39715082ecd724f10e54b0d71fffadb7"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_find_svc</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><em><span class="pre">uuid</span></em>, <span class="pre">uint16_t</span> <span class="pre">*</span><em><span class="pre">out_handle</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Retrieves the attribute handle associated with a local GATT service. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; BLE_HS_ENOENT if the specified service could not be found. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">uuid</span></code>: The UUID of the service to look up. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">out_handle</span></code>: On success, populated with the handle of the service attribute. Pass null if you don’t need this value.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_find_chr">
<span class="target" id="group__bt__gatt_1ga5df36730cb2a06ab7ec64d56961d4c5c"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_find_chr</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><em><span class="pre">svc_uuid</span></em>, <em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><em><span class="pre">chr_uuid</span></em>, <span class="pre">uint16_t</span> <span class="pre">*</span><em><span class="pre">out_def_handle</span></em>, <span class="pre">uint16_t</span> <span class="pre">*</span><em><span class="pre">out_val_handle</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Retrieves the pair of attribute handles associated with a local GATT characteristic. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; BLE_HS_ENOENT if the specified service or characteristic could not be found. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">svc_uuid</span></code>: The UUID of the parent service. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">chr_uuid</span></code>: The UUID of the characteristic to look up. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">out_def_handle</span></code>: On success, populated with the handle of the characteristic definition attribute. Pass null if you don’t need this value. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">out_val_handle</span></code>: On success, populated with the handle of the characteristic value attribute. Pass null if you don’t need this value.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_find_dsc">
<span class="target" id="group__bt__gatt_1gaa191e0eff69ca3cdd648abf6e23c02ad"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_find_dsc</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><em><span class="pre">svc_uuid</span></em>, <em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><em><span class="pre">chr_uuid</span></em>, <em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><em><span class="pre">dsc_uuid</span></em>, <span class="pre">uint16_t</span> <span class="pre">*</span><em><span class="pre">out_dsc_handle</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Retrieves the attribute handle associated with a local GATT descriptor. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; BLE_HS_ENOENT if the specified service, characteristic, or descriptor could not be found. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">svc_uuid</span></code>: The UUID of the grandparent service. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">chr_uuid</span></code>: The UUID of the parent characteristic. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">dsc_uuid</span></code>: The UUID of the descriptor ro look up. </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">out_dsc_handle</span></code>: On success, populated with the handle of the descriptor attribute. Pass null if you don’t need this value.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_show_local">
<span class="target" id="group__bt__gatt_1gafdbaf12c8efe8043d2f3e0c4304ed7d4"></span><span class="pre">void</span> <code class="sig-name descname"><span class="pre">ble_gatts_show_local</span></code><span class="sig-paren">(</span><span class="pre">void</span><span class="sig-paren">)</span><br /></dt>
<dd><p>Prints dump of local GATT database. </p>
<p>This is useful to log local state of database in human readable form. </p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_reset">
<span class="target" id="group__bt__gatt_1ga8323f213e39075eea63e048903b03d6d"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_reset</span></code><span class="sig-paren">(</span><span class="pre">void</span><span class="sig-paren">)</span><br /></dt>
<dd><p>Resets the GATT server to its initial state. </p>
<p>On success, this function removes all supported services, characteristics, and descriptors. This function requires that: o No peers are connected, and o No GAP operations are active (advertise, discover, or connect).</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; BLE_HS_EBUSY if the GATT server could not be reset due to existing connections or active GAP procedures. </p>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_start">
<span class="target" id="group__bt__gatt_1ga0f275519237f258d4a8006277083467f"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_start</span></code><span class="sig-paren">(</span><span class="pre">void</span><span class="sig-paren">)</span><br /></dt>
<dd><p>Makes all registered services available to peers. </p>
<p>This function gets called automatically by the NimBLE host on startup; manual calls are only necessary for replacing the set of supported services with a new one. This function requires that: o No peers are connected, and o No GAP operations are active (advertise, discover, or connect).</p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; A BLE host core return code on unexpected error. </p>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c function">
<dt id="c.ble_gatts_peer_cl_sup_feat_update">
<span class="target" id="group__bt__gatt_1ga89bd4caaa8e8b0997351e6e2cb3af70c"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">ble_gatts_peer_cl_sup_feat_update</span></code><span class="sig-paren">(</span><span class="pre">uint16_t</span> <em><span class="pre">conn_handle</span></em>, <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><em><span class="pre">om</span></em><span class="sig-paren">)</span><br /></dt>
<dd><p>Saves Client Supported Features for specified connection. </p>
<p><dl class="simple">
<dt><strong>Return</strong></dt><dd><p>0 on success; BLE_HS_ENOTCONN if no matching connection was found BLE_HS_EINVAL if supplied buffer is empty or if any Client Supported Feature was attempted to be disabled. A BLE host core return code on unexpected error. </p>
</dd>
<dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple">
<li><p><code class="docutils literal notranslate"><span class="pre">conn_handle</span></code>: Connection handle identifying connection for which Client Supported Features should be saved </p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">om</span></code>: The mbuf chain to set value from.</p></li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
<dl class="c struct">
<dt id="c.ble_gatt_error">
<span class="target" id="structble__gatt__error"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">ble_gatt_error</span></code><br /></dt>
<dd><em>#include &lt;ble_gatt.h&gt;</em><p>Represents a GATT error. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt id="c.ble_gatt_error.status">
<span class="target" id="structble__gatt__error_1a28b88a589c7d3d53e64aec3615f1aec6"></span><span class="pre">uint16_t</span> <code class="sig-name descname"><span class="pre">status</span></code><br /></dt>
<dd><p>The GATT status code indicating the type of error. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_error.att_handle">
<span class="target" id="structble__gatt__error_1a942fda98566300acd4b8bf1186b07ff2"></span><span class="pre">uint16_t</span> <code class="sig-name descname"><span class="pre">att_handle</span></code><br /></dt>
<dd><p>The attribute handle associated with the error. </p>
</dd></dl>
</div>
</dd></dl>
<dl class="c struct">
<dt id="c.ble_gatt_svc">
<span class="target" id="structble__gatt__svc"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">ble_gatt_svc</span></code><br /></dt>
<dd><em>#include &lt;ble_gatt.h&gt;</em><p>Represents a GATT Service. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt id="c.ble_gatt_svc.start_handle">
<span class="target" id="structble__gatt__svc_1ac821e2f98432145e1ca6c8de0b9e1cdc"></span><span class="pre">uint16_t</span> <code class="sig-name descname"><span class="pre">start_handle</span></code><br /></dt>
<dd><p>The start handle of the GATT service. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_svc.end_handle">
<span class="target" id="structble__gatt__svc_1a06a3a893124590e7b94858a6d58ba405"></span><span class="pre">uint16_t</span> <code class="sig-name descname"><span class="pre">end_handle</span></code><br /></dt>
<dd><p>The end handle of the GATT service. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_svc.uuid">
<span class="target" id="structble__gatt__svc_1a2f13def79e347d7fb0770377bb781ac3"></span><span class="pre">ble_uuid_any_t</span> <code class="sig-name descname"><span class="pre">uuid</span></code><br /></dt>
<dd><p>The UUID of the GATT service. </p>
</dd></dl>
</div>
</dd></dl>
<dl class="c struct">
<dt id="c.ble_gatt_attr">
<span class="target" id="structble__gatt__attr"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">ble_gatt_attr</span></code><br /></dt>
<dd><em>#include &lt;ble_gatt.h&gt;</em><p>Represents a GATT attribute. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt id="c.ble_gatt_attr.handle">
<span class="target" id="structble__gatt__attr_1a7f2a432793521436d8f8e8184d0d4179"></span><span class="pre">uint16_t</span> <code class="sig-name descname"><span class="pre">handle</span></code><br /></dt>
<dd><p>The handle of the GATT attribute. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_attr.offset">
<span class="target" id="structble__gatt__attr_1a8ca0e0b3f0f719ab2a6ebc1f1c49b4d9"></span><span class="pre">uint16_t</span> <code class="sig-name descname"><span class="pre">offset</span></code><br /></dt>
<dd><p>The offset of the data within the attribute. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_attr.om">
<span class="target" id="structble__gatt__attr_1a07c00ea1452b33028c2f633b3619d7a9"></span><em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><code class="sig-name descname"><span class="pre">om</span></code><br /></dt>
<dd><p>Pointer to the data buffer represented by an <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#structos__mbuf"><span class="std std-ref">os_mbuf</span></a>. </p>
</dd></dl>
</div>
</dd></dl>
<dl class="c struct">
<dt id="c.ble_gatt_chr">
<span class="target" id="structble__gatt__chr"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">ble_gatt_chr</span></code><br /></dt>
<dd><em>#include &lt;ble_gatt.h&gt;</em><p>Represents a GATT characteristic. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt id="c.ble_gatt_chr.def_handle">
<span class="target" id="structble__gatt__chr_1ac3c49174672548fdb32ced5b6014ff19"></span><span class="pre">uint16_t</span> <code class="sig-name descname"><span class="pre">def_handle</span></code><br /></dt>
<dd><p>The handle of the GATT characteristic definition. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_chr.val_handle">
<span class="target" id="structble__gatt__chr_1af15736114bcd4bde7856a6a96b0881d7"></span><span class="pre">uint16_t</span> <code class="sig-name descname"><span class="pre">val_handle</span></code><br /></dt>
<dd><p>The handle of the GATT characteristic value. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_chr.properties">
<span class="target" id="structble__gatt__chr_1aaa1a5ffcc66e08edada0a90c39f1ea45"></span><span class="pre">uint8_t</span> <code class="sig-name descname"><span class="pre">properties</span></code><br /></dt>
<dd><p>The properties of the GATT characteristic. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_chr.uuid">
<span class="target" id="structble__gatt__chr_1a752837164eb21f18a2e9c7ab219d7fb6"></span><span class="pre">ble_uuid_any_t</span> <code class="sig-name descname"><span class="pre">uuid</span></code><br /></dt>
<dd><p>The UUID of the GATT characteristic. </p>
</dd></dl>
</div>
</dd></dl>
<dl class="c struct">
<dt id="c.ble_gatt_dsc">
<span class="target" id="structble__gatt__dsc"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">ble_gatt_dsc</span></code><br /></dt>
<dd><em>#include &lt;ble_gatt.h&gt;</em><p>Represents a GATT descriptor. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt id="c.ble_gatt_dsc.handle">
<span class="target" id="structble__gatt__dsc_1a241c53074f998848a520b973030b723d"></span><span class="pre">uint16_t</span> <code class="sig-name descname"><span class="pre">handle</span></code><br /></dt>
<dd><p>The handle of the GATT descriptor. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_dsc.uuid">
<span class="target" id="structble__gatt__dsc_1addabfb7705a30f6d2069579a49de5707"></span><span class="pre">ble_uuid_any_t</span> <code class="sig-name descname"><span class="pre">uuid</span></code><br /></dt>
<dd><p>The UUID of the GATT descriptor. </p>
</dd></dl>
</div>
</dd></dl>
<dl class="c struct">
<dt id="c.ble_gatt_chr_def">
<span class="target" id="structble__gatt__chr__def"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">ble_gatt_chr_def</span></code><br /></dt>
<dd><em>#include &lt;ble_gatt.h&gt;</em><p>Represents the definition of a GATT characteristic. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt id="c.ble_gatt_chr_def.uuid">
<span class="target" id="structble__gatt__chr__def_1a5f6d6b0ab4b2a902f878d887be09a418"></span><em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">uuid</span></code><br /></dt>
<dd><p>Pointer to characteristic UUID; use BLE_UUIDxx_DECLARE macros to declare proper UUID; NULL if there are no more characteristics in the service. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_chr_def.access_cb">
<span class="target" id="structble__gatt__chr__def_1aeb03d06fbf8890990fc48064ea9b99ca"></span><a class="reference internal" href="ble_gattc.html#c.ble_gatt_access_fn" title="ble_gatt_access_fn"><span class="pre">ble_gatt_access_fn</span></a> <span class="pre">*</span><code class="sig-name descname"><span class="pre">access_cb</span></code><br /></dt>
<dd><p>Callback that gets executed when this characteristic is read or written. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_chr_def.arg">
<span class="target" id="structble__gatt__chr__def_1aaf44e3632a992cee7121e43d079937f1"></span><span class="pre">void</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">arg</span></code><br /></dt>
<dd><p>Optional argument for callback. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_chr_def.descriptors">
<span class="target" id="structble__gatt__chr__def_1ab461821c6c6c609594f6a9ba5d66cf85"></span><em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_dsc_def" title="ble_gatt_dsc_def"><span class="pre">ble_gatt_dsc_def</span></a> <span class="pre">*</span><code class="sig-name descname"><span class="pre">descriptors</span></code><br /></dt>
<dd><p>Array of this characteristic’s descriptors. </p>
<p>NULL if no descriptors. Do not include CCCD; it gets added automatically if this characteristic’s notify or indicate flag is set. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_chr_def.flags">
<span class="target" id="structble__gatt__chr__def_1af44fb3dd5aac5978474c71c8d53fb1a8"></span><a class="reference internal" href="ble_gattc.html#c.ble_gatt_chr_flags" title="ble_gatt_chr_flags"><span class="pre">ble_gatt_chr_flags</span></a> <code class="sig-name descname"><span class="pre">flags</span></code><br /></dt>
<dd><p>Specifies the set of permitted operations for this characteristic. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_chr_def.min_key_size">
<span class="target" id="structble__gatt__chr__def_1a7443502f7f92434378ae8029d8ad7adc"></span><span class="pre">uint8_t</span> <code class="sig-name descname"><span class="pre">min_key_size</span></code><br /></dt>
<dd><p>Specifies minimum required key size to access this characteristic. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_chr_def.val_handle">
<span class="target" id="structble__gatt__chr__def_1a2b914f50c9fa0fa40840694533ac3bce"></span><span class="pre">uint16_t</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">val_handle</span></code><br /></dt>
<dd><p>At registration time, this is filled in with the characteristic’s value attribute handle. </p>
</dd></dl>
</div>
</dd></dl>
<dl class="c struct">
<dt id="c.ble_gatt_svc_def">
<span class="target" id="structble__gatt__svc__def"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">ble_gatt_svc_def</span></code><br /></dt>
<dd><em>#include &lt;ble_gatt.h&gt;</em><p>Represents the definition of a GATT service. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt id="c.ble_gatt_svc_def.type">
<span class="target" id="structble__gatt__svc__def_1a9be931eb1bb79e3de7c85796643e9147"></span><span class="pre">uint8_t</span> <code class="sig-name descname"><span class="pre">type</span></code><br /></dt>
<dd><p>One of the following: o BLE_GATT_SVC_TYPE_PRIMARY - primary service o BLE_GATT_SVC_TYPE_SECONDARY - secondary service o 0 - No more services in this array. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_svc_def.uuid">
<span class="target" id="structble__gatt__svc__def_1a326400fe845d4cef20a2a798c55b0ec2"></span><em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">uuid</span></code><br /></dt>
<dd><p>Pointer to service UUID; use BLE_UUIDxx_DECLARE macros to declare proper UUID; NULL if there are no more characteristics in the service. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_svc_def.includes">
<span class="target" id="structble__gatt__svc__def_1af07d8fdee6466970d5098e91a4564b71"></span><em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_svc_def" title="ble_gatt_svc_def"><span class="pre">ble_gatt_svc_def</span></a> <span class="pre">*</span><span class="pre">*</span><code class="sig-name descname"><span class="pre">includes</span></code><br /></dt>
<dd><p>Array of pointers to other service definitions. </p>
<p>These services are reported as “included services” during service discovery. Terminate the array with NULL. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_svc_def.characteristics">
<span class="target" id="structble__gatt__svc__def_1a6064cddf48875874b4080690ad13181f"></span><em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_chr_def" title="ble_gatt_chr_def"><span class="pre">ble_gatt_chr_def</span></a> <span class="pre">*</span><code class="sig-name descname"><span class="pre">characteristics</span></code><br /></dt>
<dd><p>Array of characteristic definitions corresponding to characteristics belonging to this service. </p>
</dd></dl>
</div>
</dd></dl>
<dl class="c struct">
<dt id="c.ble_gatt_dsc_def">
<span class="target" id="structble__gatt__dsc__def"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">ble_gatt_dsc_def</span></code><br /></dt>
<dd><em>#include &lt;ble_gatt.h&gt;</em><p>Represents the definition of a GATT descriptor. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt id="c.ble_gatt_dsc_def.uuid">
<span class="target" id="structble__gatt__dsc__def_1acd3c4189279d06a838d10a076d3b8061"></span><em class="property"><span class="pre">const</span></em> <span class="pre">ble_uuid_t</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">uuid</span></code><br /></dt>
<dd><p>Pointer to descriptor UUID; use BLE_UUIDxx_DECLARE macros to declare proper UUID; NULL if there are no more characteristics in the service. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_dsc_def.att_flags">
<span class="target" id="structble__gatt__dsc__def_1afe6c14fef4ca9ac12a8c5bb398ef59bc"></span><span class="pre">uint8_t</span> <code class="sig-name descname"><span class="pre">att_flags</span></code><br /></dt>
<dd><p>Specifies the set of permitted operations for this descriptor. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_dsc_def.min_key_size">
<span class="target" id="structble__gatt__dsc__def_1ac763db49c2d70974ec56a99ff66c4b9b"></span><span class="pre">uint8_t</span> <code class="sig-name descname"><span class="pre">min_key_size</span></code><br /></dt>
<dd><p>Specifies minimum required key size to access this descriptor. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_dsc_def.access_cb">
<span class="target" id="structble__gatt__dsc__def_1a74b1573962142f074d824da348d30e33"></span><a class="reference internal" href="ble_gattc.html#c.ble_gatt_access_fn" title="ble_gatt_access_fn"><span class="pre">ble_gatt_access_fn</span></a> <span class="pre">*</span><code class="sig-name descname"><span class="pre">access_cb</span></code><br /></dt>
<dd><p>Callback that gets executed when the descriptor is read or written. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_dsc_def.arg">
<span class="target" id="structble__gatt__dsc__def_1aa935c429057d68ea9acd6e4d34b78a76"></span><span class="pre">void</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">arg</span></code><br /></dt>
<dd><p>Optional argument for callback. </p>
</dd></dl>
</div>
</dd></dl>
<dl class="c struct">
<dt id="c.ble_gatt_access_ctxt">
<span class="target" id="structble__gatt__access__ctxt"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">ble_gatt_access_ctxt</span></code><br /></dt>
<dd><em>#include &lt;ble_gatt.h&gt;</em><p>Context for an access to a GATT characteristic or descriptor. </p>
<p>When a client reads or writes a locally registered characteristic or descriptor, an instance of this struct gets passed to the application callback. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt id="c.ble_gatt_access_ctxt.op">
<span class="target" id="structble__gatt__access__ctxt_1a50c09404c2984437ce989b8d012b695d"></span><span class="pre">uint8_t</span> <code class="sig-name descname"><span class="pre">op</span></code><br /></dt>
<dd><p>Indicates the gatt operation being performed. </p>
<p>This is equal to one of the following values: o BLE_GATT_ACCESS_OP_READ_CHR o BLE_GATT_ACCESS_OP_WRITE_CHR o BLE_GATT_ACCESS_OP_READ_DSC o BLE_GATT_ACCESS_OP_WRITE_DSC </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_access_ctxt.om">
<span class="target" id="structble__gatt__access__ctxt_1a742c19ded0d054e529b2111070c2b047"></span><em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../os/core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><code class="sig-name descname"><span class="pre">om</span></code><br /></dt>
<dd><p>A container for the GATT access data. </p>
<p>o For reads: The application populates this with the value of the characteristic or descriptor being read. o For writes: This is already populated with the value being written by the peer. If the application wishes to retain this mbuf for later use, the access callback must set this pointer to NULL to prevent the stack from freeing it. </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_access_ctxt.&#64;63">
<span class="target" id="structble__gatt__access__ctxt_1aabdfe934f7689f29213554b85a39b7f1"></span><em class="property"><span class="pre">union</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_access_ctxt" title="ble_gatt_access_ctxt"><span class="pre">ble_gatt_access_ctxt</span></a><span class="pre">.</span><strong><span class="pre">[anonymous]</span></strong> <strong><span class="pre">[anonymous]</span></strong><br /></dt>
<dd><p>The GATT operation being performed dictates which field in this union is valid. </p>
<p>If a characteristic is being accessed, the chr field is valid. Otherwise a descriptor is being accessed, in which case the dsc field is valid. </p>
</dd></dl>
</div>
</dd></dl>
<dl class="c struct">
<dt id="c.ble_gatt_register_ctxt">
<span class="target" id="structble__gatt__register__ctxt"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">ble_gatt_register_ctxt</span></code><br /></dt>
<dd><em>#include &lt;ble_gatt.h&gt;</em><p>Context passed to the registration callback; represents the GATT service, characteristic, or descriptor being registered. </p>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p>
<dl class="c var">
<dt id="c.ble_gatt_register_ctxt.op">
<span class="target" id="structble__gatt__register__ctxt_1af9e6ed3f16cd367ed63430ff0db54042"></span><span class="pre">uint8_t</span> <code class="sig-name descname"><span class="pre">op</span></code><br /></dt>
<dd><p>Indicates the gatt registration operation just performed. </p>
<p>This is equal to one of the following values: o BLE_GATT_REGISTER_OP_SVC o BLE_GATT_REGISTER_OP_CHR o BLE_GATT_REGISTER_OP_DSC </p>
</dd></dl>
<dl class="c var">
<dt id="c.ble_gatt_register_ctxt.&#64;65">
<span class="target" id="structble__gatt__register__ctxt_1a143f9251f9811c311a3becba6e57752e"></span><em class="property"><span class="pre">union</span></em> <a class="reference internal" href="ble_gattc.html#c.ble_gatt_register_ctxt" title="ble_gatt_register_ctxt"><span class="pre">ble_gatt_register_ctxt</span></a><span class="pre">.</span><strong><span class="pre">[anonymous]</span></strong> <strong><span class="pre">[anonymous]</span></strong><br /></dt>
<dd><p>The value of the op field determines which field in this union is valid. </p>
</dd></dl>
</div>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="rst-footer-buttons row" role="navigation" aria-label="footer navigation">
<a href="ble_hs_id.html" class="btn btn-neutral float-right" title="NimBLE Host Identity Reference" accesskey="n">Next: NimBLE Host Identity Reference <span class="fa fa-arrow-circle-right"></span></a>
<a href="ble_gattc.html" class="btn btn-neutral" title="NimBLE Host GATT Client Reference" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous: NimBLE Host GATT Client Reference</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>