<?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>Getting the rssi value (on peripheral side) of a phone connected to the peripheral</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38445/getting-the-rssi-value-on-peripheral-side-of-a-phone-connected-to-the-peripheral</link><description>Dear Sir, 
 I have connected a phone to a peripheral device using NRFconnect App. 
 Now I want to know the rssi value of the phone on the peripheral side. 
 I want to get the peer address(of the phone) and corresponding rssi value. 
 
 I have done the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Sep 2018 13:12:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38445/getting-the-rssi-value-on-peripheral-side-of-a-phone-connected-to-the-peripheral" /><item><title>RE: Getting the rssi value (on peripheral side) of a phone connected to the peripheral</title><link>https://devzone.nordicsemi.com/thread/148633?ContentTypeID=1</link><pubDate>Thu, 13 Sep 2018 13:12:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ef8a175-e69f-44fe-a150-d216bd0014b8</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;A colleague of mine will help you out in the other thread.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting the rssi value (on peripheral side) of a phone connected to the peripheral</title><link>https://devzone.nordicsemi.com/thread/148555?ContentTypeID=1</link><pubDate>Thu, 13 Sep 2018 08:54:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2b17e77-338f-4302-b413-edf0c4bdfbc9</guid><dc:creator>GK</dc:creator><description>&lt;p&gt;HI Martin, Thank you for your time and reply.&lt;/p&gt;
&lt;p&gt;Yes I got the help. But still I am facing issues with the implementation of whitelist.&lt;/p&gt;
&lt;p&gt;I have referred&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/18608/whitelisting-in-s132-v3-for-advertising-filter-policy/71827#71827"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/18608/whitelisting-in-s132-v3-for-advertising-filter-policy/71827#71827&lt;/a&gt;&amp;nbsp;this also.&lt;/p&gt;
&lt;p&gt;But still I am facing some issues.&lt;/p&gt;
&lt;p&gt;I have posted query here .&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38488/issue-in-implementing-whitelist"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/38488/issue-in-implementing-whitelist&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please give me some guidance if possible.&lt;/p&gt;
&lt;p&gt;Thanking you in advance,&lt;/p&gt;
&lt;p&gt;with regards,&lt;/p&gt;
&lt;p&gt;Geetha&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting the rssi value (on peripheral side) of a phone connected to the peripheral</title><link>https://devzone.nordicsemi.com/thread/148541?ContentTypeID=1</link><pubDate>Thu, 13 Sep 2018 08:16:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bf2adbc-2d5b-4291-82b4-8cc510fb6f8b</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;In the BLE_GAP_EVT_RSSI_CHANGED case, p_ble_evt-&amp;gt;evt.gap_evt.params.connected.peer_addr&amp;nbsp;doesn&amp;#39;t contain the data you think it is.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please have a look at the `ble_gap_evt_t` structure and note how &lt;a href="https://www.tutorialspoint.com/cprogramming/c_unions.htm"&gt;unions&lt;/a&gt; are used to store &lt;em&gt;different&lt;/em&gt; information for &lt;em&gt;different&lt;/em&gt; events, but in &lt;em&gt;the same place&lt;/em&gt; in memory:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief GAP event structure. */
typedef struct
{
  uint16_t conn_handle;                                     /**&amp;lt; Connection Handle on which event occurred. */
  union                                                     /**&amp;lt; union alternative identified by evt_id in enclosing struct. */
  {
    ble_gap_evt_connected_t                   connected;                    /**&amp;lt; Connected Event Parameters. */
    ble_gap_evt_disconnected_t                disconnected;                 /**&amp;lt; Disconnected Event Parameters. */
    ble_gap_evt_conn_param_update_t           conn_param_update;            /**&amp;lt; Connection Parameter Update Parameters. */
    ble_gap_evt_sec_params_request_t          sec_params_request;           /**&amp;lt; Security Parameters Request Event Parameters. */
    ble_gap_evt_sec_info_request_t            sec_info_request;             /**&amp;lt; Security Information Request Event Parameters. */
    ble_gap_evt_passkey_display_t             passkey_display;              /**&amp;lt; Passkey Display Event Parameters. */
    ble_gap_evt_key_pressed_t                 key_pressed;                  /**&amp;lt; Key Pressed Event Parameters. */
    ble_gap_evt_auth_key_request_t            auth_key_request;             /**&amp;lt; Authentication Key Request Event Parameters. */
    ble_gap_evt_lesc_dhkey_request_t          lesc_dhkey_request;           /**&amp;lt; LE Secure Connections DHKey calculation request. */
    ble_gap_evt_auth_status_t                 auth_status;                  /**&amp;lt; Authentication Status Event Parameters. */
    ble_gap_evt_conn_sec_update_t             conn_sec_update;              /**&amp;lt; Connection Security Update Event Parameters. */
    ble_gap_evt_timeout_t                     timeout;                      /**&amp;lt; Timeout Event Parameters. */
    ble_gap_evt_rssi_changed_t                rssi_changed;                 /**&amp;lt; RSSI Event Parameters. */
    ble_gap_evt_adv_report_t                  adv_report;                   /**&amp;lt; Advertising Report Event Parameters. */
    ble_gap_evt_sec_request_t                 sec_request;                  /**&amp;lt; Security Request Event Parameters. */
    ble_gap_evt_conn_param_update_request_t   conn_param_update_request;    /**&amp;lt; Connection Parameter Update Parameters. */
    ble_gap_evt_scan_req_report_t             scan_req_report;              /**&amp;lt; Scan Request Report Parameters. */
    ble_gap_evt_phy_update_request_t          phy_update_request;           /**&amp;lt; PHY Update Request Event Parameters. */
    ble_gap_evt_phy_update_t                  phy_update;                   /**&amp;lt; PHY Update Parameters. */
    ble_gap_evt_data_length_update_request_t  data_length_update_request;   /**&amp;lt; Data Length Update Request Event Parameters. */
    ble_gap_evt_data_length_update_t          data_length_update;           /**&amp;lt; Data Length Update Event Parameters. */
  } params;                                                                 /**&amp;lt; Event Parameters. */
} ble_gap_evt_t;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This means that on a BLE_GAP_EVT_RSSI_CHANGED event, you cannot expect to find information about a BLE_GAP_EVT_CONNECTED in the &lt;span&gt;p_ble_evt variable&lt;/span&gt;. The value at&amp;nbsp;&lt;span&gt;p_ble_evt-&amp;gt;evt.gap_evt.params.connected.peer_addr is old at best, and total garbage&amp;nbsp;at worst.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Regarding how to get RSSI and peer address from nearby phones I see that you got help on that here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38148/connecting-the-ble-device-to-a-phone-app-with-highest-signal-strength/"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/38148/connecting-the-ble-device-to-a-phone-app-with-highest-signal-strength/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting the rssi value (on peripheral side) of a phone connected to the peripheral</title><link>https://devzone.nordicsemi.com/thread/148322?ContentTypeID=1</link><pubDate>Wed, 12 Sep 2018 07:34:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c083438-5ef5-4de8-b9fa-3684ae87cc75</guid><dc:creator>GK</dc:creator><description>&lt;p&gt;I am trying to implement the following scenario.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One periheral&lt;/p&gt;
&lt;p&gt;Multiple phones.&lt;/p&gt;
&lt;p&gt;Each phone tries to connect to the peripheral.&lt;/p&gt;
&lt;p&gt;I want to connect to the one with highest rssi value.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I was planning to do the following&lt;/p&gt;
&lt;p&gt;Once the advertising start , the initial 30 seconds I will use to collect the addresses of the phones (whoever tries to connect to the peripheral) and their rssi values. (here i will do connect-disconnect operation to get the details, for 30 secs(for example i am taking this value))&lt;/p&gt;
&lt;p&gt;Then sort it and select the one with highest rssi.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After 30 seconds when everyone tries to connect I will check the address of each one and will allow only the one whose adddress match with the selected one ( which has the highest rssi value).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Will you please tell me if there is any other ways to tackle this scenario(if my approach is not good)?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting the rssi value (on peripheral side) of a phone connected to the peripheral</title><link>https://devzone.nordicsemi.com/thread/148319?ContentTypeID=1</link><pubDate>Wed, 12 Sep 2018 07:26:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d0e2b3e-12fe-49fe-b62b-6476298bc1d6</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Why do you need to know the peer address?&lt;/p&gt;
&lt;p&gt;A BLE (non mesh) &lt;em&gt;connection&lt;/em&gt; is only ever 1-to-1 - so there is no need to distinguish different peers &lt;em&gt;in the connection&lt;/em&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>