<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Zephyr equivalent for ble_link_ctx_manager</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115376/zephyr-equivalent-for-ble_link_ctx_manager</link><description>I&amp;#39;m currently porting an existing NRF SDK code base to NRF Connect SDK (Zephyr).. 
 
 Our existing code used ble_link_ctx_manager to maintain per connection state in a common service. How should I do the same with zephyr? 
 
 The sole use in this code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Oct 2024 16:03:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115376/zephyr-equivalent-for-ble_link_ctx_manager" /><item><title>RE: Zephyr equivalent for ble_link_ctx_manager</title><link>https://devzone.nordicsemi.com/thread/506769?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2024 16:03:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63557aaf-bd94-4bf5-9931-4009002656a8</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;Zephyr&amp;#39;s CCC callback implementation is only useful for very simple cases.&amp;nbsp; In my use cases I have to replace code in zephyr&amp;#39;s GATT implementation to get per connection value change callbacks.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Zephyr&amp;#39;s per peer link context is distributed throughout the GATT on each characteristic.&amp;nbsp; I haven&amp;#39;t yet determined whether they GATT state is preserved as it was with NRF SDK, I suspect there is a flag option to do this.&lt;/p&gt;
&lt;p&gt;In general the best way to get the per peer value of a ccc is to call:&lt;/p&gt;
&lt;p&gt;bool bt_gatt_is_subscribed(struct bt_conn *conn, const struct bt_gatt_attr *attr, uint16_t ccc_type);&lt;/p&gt;
&lt;p&gt;A more detailed discussion about ccc callbacks can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/discussions/79822"&gt;github.com/.../79822&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr equivalent for ble_link_ctx_manager</title><link>https://devzone.nordicsemi.com/thread/506205?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2024 21:51:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3455fb88-25f6-4775-a79b-61c41edb6299</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;I&amp;#39;m reading the implementation of gatt.c in zephyr, and I find it very strange.&amp;nbsp; If I have multiple connections active at the same time my GATT server should operate for each client according to the client&amp;#39;s ccc configuration.&lt;/p&gt;
&lt;p&gt;It appears the gatt.c ccc changed function treats callback would only fire in a couple of cases:&lt;/p&gt;
&lt;p&gt;* when all clients were 0 and then 1 client becomes non-zero&lt;/p&gt;
&lt;p&gt;* if only 1 client were non-zero and then it becomes zero&lt;/p&gt;
&lt;p&gt;In all other cases the ccc_changed callback would not fire since the combined value doesn&amp;#39;t really change.&amp;nbsp; Also when I receive the ccc_changed callback there is no indication of which client changed.&amp;nbsp; It all seems to be designed around a use case of a single connection.&lt;/p&gt;
&lt;p&gt;Honestly this sort of worries me, previously nordic&amp;#39;s SDK was the main reason I recommended my client&amp;#39;s to use your products.&amp;nbsp; That SDK has been abandoned and the replacement seems to be incomplete and faulty.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr equivalent for ble_link_ctx_manager</title><link>https://devzone.nordicsemi.com/thread/506024?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2024 08:01:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e76ab161-9cfa-473c-99dd-32e503accef8</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi Anthony,&lt;/p&gt;
&lt;p&gt;When moving from the nRF5 SDK to nRF Connect SDK, there is no point to point similar functions that are present. So in order to&amp;nbsp;manage per-connection state for GATT services like notification flags (which you previously handled with &lt;code&gt;ble_link_ctx_manager&lt;/code&gt;), you can take a look at the Zephyr APIs and utilize a combination of those in order to get your required functionality.&lt;/p&gt;
&lt;p&gt;Please take a look at the GATT service APIs in Zephyr:&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/apidoc/latest/group__bt__gatt__server.html"&gt;https://docs.zephyrproject.org/apidoc/latest/group__bt__gatt__server.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You have the&amp;nbsp; CCC (Client Characteristic Configuration) Descriptors in Zephyr which you can use.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Priyanka&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>