<?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>Is it safe to use Peer Manager&amp;#39;s Peer IDs for other FDS files?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34789/is-it-safe-to-use-peer-manager-s-peer-ids-for-other-fds-files</link><description>I&amp;#39;m developing a database with FDS that stores application-level data that must be able to be matched to bond data. After looking at the files for Peer Manager, ID Manager, and Peer Data Storage, I want to check with someone else who knows the SDK code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Jul 2018 07:38:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34789/is-it-safe-to-use-peer-manager-s-peer-ids-for-other-fds-files" /><item><title>RE: Is it safe to use Peer Manager's Peer IDs for other FDS files?</title><link>https://devzone.nordicsemi.com/thread/141609?ContentTypeID=1</link><pubDate>Fri, 27 Jul 2018 07:38:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fd4079f-bbef-46ef-bf54-28665ad1f857</guid><dc:creator>&amp;#216;yvind R&amp;#248;nningstad</dc:creator><description>&lt;p&gt;Note 1:&amp;nbsp; If you store data with those file IDs, make sure the to use unused data IDs (I would go for record keys below 0xC000 since data IDs are also offset by 0xC000 when converted to record keys). If you do, there should be no problem, except:&lt;/p&gt;
&lt;p&gt;Note 2: Your data will be deleted if the peer is deleted.&lt;/p&gt;
&lt;p&gt;Note 3: What you&amp;#39;re doing is non-standard, so what I&amp;#39;m saying is subject to change, though it&amp;#39;s somewhat unlikely :).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it safe to use Peer Manager's Peer IDs for other FDS files?</title><link>https://devzone.nordicsemi.com/thread/133629?ContentTypeID=1</link><pubDate>Mon, 28 May 2018 11:16:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b5fa6c0-7fc5-4738-8d8d-83efeaf0b644</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The peer ID is locked for the lifetime until deleted yes. Also I noticed your related thread on the topic that may be of interest for others:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34793/how-do-i-use-pm_peer_data_app_store"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/34793/how-do-i-use-pm_peer_data_app_store&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The peer ID in code is between 0 and 0x3FFF (in reality between 0 and&amp;nbsp; 255 because of&amp;nbsp;PM_PEER_ID_N_AVAILABLE_IDS in peer_manager_types), but peer ID is &amp;quot;converted&amp;quot; to file ID n + 0xC000 before it is stored in FDS. See below.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Function to convert peer IDs to file IDs.
static uint16_t peer_id_to_file_id(pm_peer_id_t peer_id)
{
    return (uint16_t)(peer_id + PEER_ID_TO_FILE_ID);
}


// Function to convert peer data id to type id.
static pm_peer_id_t file_id_to_peer_id(uint16_t file_id)
{
    return (pm_peer_id_t)(file_id + FILE_ID_TO_PEER_ID);
}


// Function to convert peer data IDs to record keys.
static uint16_t peer_data_id_to_record_key(pm_peer_data_id_t peer_data_id)
{
    return (uint16_t)(peer_data_id + DATA_ID_TO_RECORD_KEY);
}


// Function to convert record keys to peer data IDs.
static pm_peer_data_id_t record_key_to_peer_data_id(uint16_t record_key)
{
    return (pm_peer_data_id_t)(record_key + RECORD_KEY_TO_DATA_ID);
} &lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>