<?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>Logging node metadata over RTT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46479/logging-node-metadata-over-rtt</link><description>Hi, I am using Heartbeat messages with the light switch example, and want to log the nrf_mesh_rx_metadata_t in heartbeat_opcode_handle() to RTT viewer so I can write it to a file. I think I have to do this by attaching it to NRF_MESH_EVT_HB_MESSAGE_RECEIVED</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 May 2019 13:22:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46479/logging-node-metadata-over-rtt" /><item><title>RE: Logging node metadata over RTT</title><link>https://devzone.nordicsemi.com/thread/184917?ContentTypeID=1</link><pubDate>Thu, 02 May 2019 13:22:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0268a051-085a-494e-a908-72de48d599d0</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;I see.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you use the example in my previous post, adding this to your example should work for retrieving the RSSI.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In heartbeat.c under the heartbeat_opcode_handle (), add:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;evt.params.message.p_metadata = p_rx_metadata;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In main.c under the mesh_evt_cb() and the NRF_MESH_EVT_HB_MESSAGE_RECEIVED add:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;RSSI = %d\n&amp;quot;, p_evt-&amp;gt;params.message.p_metadata-&amp;gt;params.scanner.rssi);&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This should print the RSSI for the heartbeat message you receive.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&amp;nbsp;&lt;br /&gt;Joakim.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging node metadata over RTT</title><link>https://devzone.nordicsemi.com/thread/184741?ContentTypeID=1</link><pubDate>Thu, 02 May 2019 02:42:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45c805ae-6fbb-4ff8-82c5-5171bb55b32d</guid><dc:creator>samjaklic</dc:creator><description>&lt;p&gt;I am mostly interested in logging the RSSI, and the two nodes that were involved in the heartbeat (sent, received). Each way that I try to call the logging subroutine, it causes a compile-time error. Is there example code of how to send this information to the logger?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Logging node metadata over RTT</title><link>https://devzone.nordicsemi.com/thread/184617?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2019 13:59:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23358559-0d9f-4f07-9e8e-32ce72ac2f18</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi.&amp;nbsp;&lt;/p&gt;
[quote user=""]want to log the&amp;nbsp;&lt;em&gt;&lt;strong&gt;nrf_mesh_rx_metadata_t&amp;nbsp;&lt;/strong&gt;in&amp;nbsp;&lt;strong&gt;heartbeat_opcode_handle()&lt;/strong&gt;&lt;/em&gt; to RTT viewer so I can write it to a file.[/quote]
&lt;p&gt;&amp;nbsp;Which data is it that you are interested in?&lt;/p&gt;
&lt;p&gt;Your approach sounds correct.&amp;nbsp;&lt;br /&gt;There is an unofficial example using heartbeat messages available on devzone that you can take a look at. (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/39270/ble-mesh-heartbeat-example/"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/39270/ble-mesh-heartbeat-example/&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]but I have tried and failed with many different methods.[/quote]
&lt;p&gt;&amp;nbsp;Depending on which data you are interested in, how did you try to solve this?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>