<?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>Adding Timestamp</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87434/adding-timestamp</link><description>Hi, 
 I am developing an application (Peripheral Sensor device: Acceleration measurement), I have included the characteritsics for the measurement and I am trying to include three packets of data to this characteristics value Timestamp, Value and Flag</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 May 2022 12:10:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87434/adding-timestamp" /><item><title>RE: Adding Timestamp</title><link>https://devzone.nordicsemi.com/thread/366224?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 12:10:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b4c58cb-4c83-444d-9fb8-fdc705de3276</guid><dc:creator>Sreejith Sundh</dc:creator><description>&lt;p&gt;Yes, but my master device has one service (act as a server service) only for time measurement and do notification once it read from some other time client device. So my server required to read that time server service from Master. Is it possible ? Simply does my server device can read from the master (when the master do notify)?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding Timestamp</title><link>https://devzone.nordicsemi.com/thread/366223?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 12:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3481da18-f8e6-4604-8e02-43d66e4dc84c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am not entirely sure I understand, but it&amp;#39;s only a server that can hold data, so a client can either write to the server or read from the server.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding Timestamp</title><link>https://devzone.nordicsemi.com/thread/366031?ContentTypeID=1</link><pubDate>Tue, 03 May 2022 14:35:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dff78036-2f9c-4a6d-84a3-c34a54656dae</guid><dc:creator>Sreejith Sundh</dc:creator><description>&lt;p&gt;Thanks once again for your suggestion. Yes I am planning to send like wise. But my question here is something other,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have to include timestamp without initializing or setting time manually. For this My client device has a service call as Current Time (So the client reads current time from some other device which is not my area), which do notifies when it reads current data.&lt;/p&gt;
&lt;p&gt;My device is peripheral role, but I would like to read the characteristic value of those Current Time Service of client. Is it possible? So that I would get current time withour setting manually then I can use this value to update my timestamp with help of RTC.&lt;/p&gt;
&lt;p&gt;in short, My peripheral device need to read one of the characteristic value from Client (which do notification once it get correct current time data). Is there any suggestion on it, I mean implementation of this logic possible or not?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards,&lt;/p&gt;
&lt;p&gt;Sreejith&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding Timestamp</title><link>https://devzone.nordicsemi.com/thread/366017?ContentTypeID=1</link><pubDate>Tue, 03 May 2022 13:50:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:513dd3f2-2bae-408f-a9ef-0a3d45e83ff1</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;You will have to solve this the best you see fit. Though from what I can understand this is a proprieatry application, this means that you can have proprieatry characteristics with a data format that fit your needs, e.g. a characteristic can be defined by you to hold both time data and measurements, and this combined data can be sent as one notification for each measurement. This is much effective than using many characteristics, since having more characteristics typically mean you will have to read/write/notify more packets on air, instead of one packet (notification) that can consist of a format that you define (code and decode as you best see fit).&lt;/p&gt;
&lt;p&gt;That said, there should be no problem to also have several services and characteristics, though it might be more difficult to possible know at what time a measurement have been performed in specific if you don&amp;#39;t somehow combine the two into one packet as suggested.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding Timestamp</title><link>https://devzone.nordicsemi.com/thread/365917?ContentTypeID=1</link><pubDate>Tue, 03 May 2022 09:13:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68dcfe67-5899-4ef5-a446-1467fd72448e</guid><dc:creator>Sreejith Sundh</dc:creator><description>[quote userid="2111" url="~/f/nordic-q-a/87434/adding-timestamp/365804#365804"]What do you plan to use it for?[/quote]
&lt;p&gt;I would like to add timestamp (32 bit Unix timestamp in seconds) along with my measured acceleration data. What I currently done is that I used the NRF CALENDAR example and the initial time I set manually and now it works perfectly. But I wish to include a new custom time service (in my peripheral device) which has one&amp;nbsp;characteristic named as current time char which is possible to read and write. But I would like to read a value from the client characteristic and write to the above mentioned current time char. Is it possible? does the cts_c example helps here? I am little confused that a peripheral device (which has about 5 services) can act as client to read only time?&lt;/p&gt;
&lt;p&gt;I do really appreciate your help.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards,&lt;/p&gt;
&lt;p&gt;Sreejith&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding Timestamp</title><link>https://devzone.nordicsemi.com/thread/365808?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 13:55:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ded65047-b12c-4ca4-8241-a83c8a0770cc</guid><dc:creator>Sreejith Sundh</dc:creator><description>&lt;p&gt;All together I need to include unix timestamp (in uint32_t Seconds) along with the Measurement data. This is my requirement. So that I have included the NRF_CALENDAR example to get time, it works only when comment the following lines in nrf_calendar.c&lt;/p&gt;
&lt;p&gt;NRF_CLOCK-&amp;gt;LFCLKSRC = CLOCK_LFCLKSRC_SRC_RC &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos;&lt;br /&gt;NRF_CLOCK-&amp;gt;LFCLKSRC = CLOCK_LFCLKSRC_SRC_RC &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos;&lt;br /&gt;NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;&lt;br /&gt;NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;&lt;br /&gt;while(NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;when I uncomment, it shows INVALID error, I could not get what is the problem here, when I comment it I am getting timetsamp but that lasts only for 60 seconds after that all measurements were stopped and no more reading....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding Timestamp</title><link>https://devzone.nordicsemi.com/thread/365804?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 13:36:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1ea04dc-f201-4372-bc6e-409c1840e9f4</guid><dc:creator>Kenneth</dc:creator><description>[quote user="Sreejith Sundh"]When I use the Current_Time_service every time (atleast first time) before starting the measurement I have to synchronize with the client to get current time, isn&amp;#39;t it?&amp;nbsp;[/quote]
&lt;p&gt;What do you plan to use it for? Typically application just send notification as they are measured without any time stamp.&lt;/p&gt;
&lt;p&gt;KEnneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding Timestamp</title><link>https://devzone.nordicsemi.com/thread/365756?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 12:09:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb83e484-fc48-409c-bca9-0fccc982ef1a</guid><dc:creator>Sreejith Sundh</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;Thanks for your response.&lt;/p&gt;
&lt;p&gt;When I use the Current_Time_service every time (atleast first time) before starting the measurement I have to synchronize with the client to get current time, isn&amp;#39;t it?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have tried to use the NRF_CALENDAR example, but during the initialization function &amp;quot;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;NRF_CLOCK&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;LFCLKSRC&lt;/span&gt;&lt;span&gt; = CLOCK_LFCLKSRC_SRC_Xtal &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos; The code enters in to infinte loop and shows an error &amp;lt;error&amp;gt; app: SOFTDEVICE: INVALID MEMORY ACCESS. How can I solve this error, is it because of any SDK_CONFIG problem?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;Thanks and looking forward for your response.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Thanks and Regards,&lt;/div&gt;
&lt;div&gt;Sreejith&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding Timestamp</title><link>https://devzone.nordicsemi.com/thread/365747?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 11:56:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce0c1291-7c1e-470d-852a-683f978399dd</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you are interested in the current time profile you may find these links useful:&lt;br /&gt;example:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_cts_c.html"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_cts_c.html&lt;/a&gt;&amp;nbsp;&lt;br /&gt;16-bit UUIDs:&amp;nbsp;&lt;a href="https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf"&gt;https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf&lt;/a&gt;&amp;nbsp;&lt;br /&gt;current time service:&amp;nbsp;&lt;a href="https://www.bluetooth.com/specifications/specs/current-time-service-1-1/"&gt;https://www.bluetooth.com/specifications/specs/current-time-service-1-1/&lt;/a&gt;&amp;nbsp;&lt;br /&gt;current time profile:&amp;nbsp;&lt;a href="https://www.bluetooth.com/specifications/specs/time-profile-1-0/"&gt;https://www.bluetooth.com/specifications/specs/time-profile-1-0/&lt;/a&gt;&amp;nbsp;&lt;br /&gt;gatt specification supplement, &lt;a href="https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=539729"&gt;https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=539729&lt;/a&gt;&amp;nbsp;(3.64 Date Time described the structure)&lt;/p&gt;
&lt;p&gt;As you can see from the above the resolution is in best case 1/256th second, so the resolution is ~4ms, and the server would need to update this every 1/256times a second for it to be this accurate (this to ensure that if the peer read this value it will always get the most accurate one).&amp;nbsp;You could read this value periodically from the peer, and then have a 1ms tick counter on the peer that updated the time locally every 1ms and attach the time to your measurements if you like.&lt;/p&gt;
&lt;p&gt;It is unfortunately much higher than the 20ppm I can see you are asking for, which I don&amp;#39;t see any way to implement.&lt;/p&gt;
&lt;p&gt;The easiest may instead just be to have a local time on the peer (where you specificy the resolution and timer) that start from 0 when you power up the peer, and attach this relative time for all measurements, and let the central somehow solve the timing (e.g. every time when it receives measurements with a relative time that started from 0 orignally, the central could at least place the measurements on a time line with high accuracy between eachother). The problem with this approach would be that you potentially have an unknown fixed offset of a few ms for all measurements, but the timing between the samples would be known.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>