<?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>define queue in a structure</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118786/define-queue-in-a-structure</link><description>I have searched this website,there is only 1 post,but that is not my scenario. 
 I think this is a normal use case: 
 There is a struct: 
 
 I want to allocate a queue for each struct.(I have to connect up to 20 BLE peripherals in a single nRF52840 module</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Feb 2025 14:56:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118786/define-queue-in-a-structure" /><item><title>RE: define queue in a structure</title><link>https://devzone.nordicsemi.com/thread/522251?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2025 14:56:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4487c8e7-2b4e-4417-be2d-2dc17095c81c</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I might be misunderstanding you scenario here, but most of these GATT based queues are handled with the nrf_ble_gq library, which is used by most examples in nRF5 SDK v17. Please correct me if I have not understood your scenario fully.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a high-level documentation that explains the BLE GATT queue:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_ble_gatt_queue.html"&gt;https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_ble_gatt_queue.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="OldXiao"]&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But not understand the Log code, actually don&amp;#39;t get the whole LOG module structure.&lt;/p&gt;[/quote]
&lt;p&gt;Have you tried enabling logging (and set sdk_config.h::NRF_QUEUE_CONFIG_LOG_ENABLED to &amp;#39;1&amp;#39;) to see how it behaves for the specific module?&lt;/p&gt;
&lt;p&gt;Have you checked the documentation chapter on the subject?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_nrf_log.html"&gt;https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_nrf_log.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="OldXiao"]Except log function, it looks like we can just define a nrf_queue_t instance,allocate memory,and then we can process with queue functions.[/quote]
&lt;p&gt;Have you looked at how this is implemented in other central implemented services, like ble_nus_c for instance? Follow the p_gatt_queue and other vars/API calls to the nrf_ble_gq module.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: define queue in a structure</title><link>https://devzone.nordicsemi.com/thread/522120?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2025 03:30:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a23dc14b-be56-4585-a675-de50f44a0655</guid><dc:creator>OldXiao</dc:creator><description>&lt;p&gt;I misunderstanded the&amp;nbsp;&amp;nbsp;nrf_queue_cb_t type,I thought it is a callback function.It is not.&lt;/p&gt;
&lt;p&gt;But not understand the Log code, actually don&amp;#39;t get the whole LOG module structure.&lt;/p&gt;
&lt;p&gt;Except log function, it looks like we can just define a nrf_queue_t instance,allocate memory,and then we can process with queue functions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>