<?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>Time sync up</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68642/time-sync-up</link><description>hello ,i am using sdk16 with nrf52852 DK i can be able to get time using that nrf calendar example. Now i want to sync up the mobile time with Dk every time i connect with bluetooth we are developing our own customised app. My question is 
 1)if i get</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Dec 2020 17:32:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68642/time-sync-up" /><item><title>RE: Time sync up</title><link>https://devzone.nordicsemi.com/thread/283382?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2020 17:32:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ffb1305-b2ac-4bef-b1a4-062ea54b1a8b</guid><dc:creator>manikandan</dc:creator><description>&lt;p&gt;thanks it worked kindly check my new ticket i have another doubt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time sync up</title><link>https://devzone.nordicsemi.com/thread/282443?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2020 12:54:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:306058ad-3d26-4fee-a018-4f2a40abe4f3</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Manikandan&lt;/p&gt;
&lt;p&gt;1) That is odd. I just did my own test, and I have no issue setting the time in the nus data handler.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Maybe you can take a look at my example and see if you are doing it differently?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2604.ble_5F00_app_5F00_uart_5F00_calendar.zip"&gt;devzone.nordicsemi.com/.../2604.ble_5F00_app_5F00_uart_5F00_calendar.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2) In a Bluetooth connection the connection parameters is normally dictated by the central device, but the peripheral can request a change to the parameters.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the standard BLE examples this is facilitated by the ble_conn_params module, which allows you to request different connection parameters by calling the ble_conn_params_change_conn_params(..) function, as described &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_ble_conn_params.html?cp=7_1_3_2_4_3#lib_ble_conn_params_change_conn_params"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you want this to happen as a response to a packet sent from&amp;nbsp;Be aware that it is up to the central to decide if it accepts these parameters or not. For instance most smart phones have some limits on which connection parameters they will accept.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time sync up</title><link>https://devzone.nordicsemi.com/thread/282157?ContentTypeID=1</link><pubDate>Thu, 26 Nov 2020 17:13:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01abc187-6962-4da6-a5f2-ffdd43b96639</guid><dc:creator>manikandan</dc:creator><description>&lt;p&gt;1)no if i call it there its starts running from 1970 not with the date and time which i have set so what should i do??&lt;/p&gt;
&lt;p&gt;2) on a seprate note i have other question&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I want to set the BLE connection interval via BLE&amp;nbsp; command using an customised app. what i want to do is this&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS)&lt;/p&gt;
&lt;p&gt;#define MAX_CONN_INTERVAL MSEC_TO_UNITS(75, UNIT_1_25_MS)&lt;/p&gt;
&lt;p&gt;if i send 10 and 50 through bluetooth my program should run with 10 as min and 50 .&lt;/p&gt;
&lt;p&gt;I have tried sending&amp;nbsp; two numbers and setting that numbers to two variables and placed it there instead of 20 and 75 but that seems to be not working.&lt;/p&gt;
&lt;p&gt;1)is it possible to do this?&lt;/p&gt;
&lt;p&gt;2)possible means how can i do that&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Manikandan V&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time sync up</title><link>https://devzone.nordicsemi.com/thread/282103?ContentTypeID=1</link><pubDate>Thu, 26 Nov 2020 13:59:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bed64ae8-8b70-45d1-b7a4-28937c434ffb</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Manikandan&lt;/p&gt;
&lt;p&gt;Can&amp;#39;t you just run the nrf_cal_set_time(..) function in the nus_data_handler() function, when the data is received?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time sync up</title><link>https://devzone.nordicsemi.com/thread/281938?ContentTypeID=1</link><pubDate>Thu, 26 Nov 2020 07:23:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ece391a9-c212-4769-9565-9220b2563550</guid><dc:creator>manikandan</dc:creator><description>&lt;p&gt;okie i have done that now i have 6 variables from year to second how can i set time using these variables where should i call&amp;nbsp;&lt;span&gt;nrf_cal_set_time(year, month, day, hour, minute, second); this function to set the time and start my program with that particular time&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thanks and regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;manikandan v&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time sync up</title><link>https://devzone.nordicsemi.com/thread/281742?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2020 09:37:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:022e1090-8988-4565-8744-7283cdb72f1b</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;My initial thought is that you seem to be over complicating things a little.&lt;/p&gt;
&lt;p&gt;Can&amp;#39;t you just code year/month/day/hour/minute/second each into a separate byte without converting to and from ascii representation?&lt;/p&gt;
&lt;p&gt;Then you only need 6 bytes in total to represent a date and time update, and you can easily copy each byte from the rx_data.p_data buffer into the 6 variables (just remember to subtract 1970 from the year before sending it, and add it back here, since a single byte can&amp;#39;t store numbers &amp;gt; 255).&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time sync up</title><link>https://devzone.nordicsemi.com/thread/281518?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 11:26:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd763798-0e38-45c1-8441-33e627cf1431</guid><dc:creator>manikandan</dc:creator><description>&lt;p&gt;hello&amp;nbsp; i am using android and developed an customised app and doing something like this is&lt;/p&gt;
&lt;p&gt;for (uint32_t i = 0; i &amp;lt; p_evt-&amp;gt;params.rx_data.length; i++)&lt;br /&gt;{&lt;br /&gt;str[i]=p_evt-&amp;gt;params.rx_data.p_data[i];&lt;/p&gt;
&lt;p&gt;strcpy(buf,str);&lt;/p&gt;
&lt;p&gt;uint8_t j=0;&lt;br /&gt;char *pch = strtok (buf,&amp;quot;- :&amp;quot;);&lt;br /&gt;while (pch != NULL)&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;array[j]=pch;&lt;br /&gt;j=j+1;&lt;br /&gt;pch = strtok (NULL, &amp;quot;- :&amp;quot;);&lt;br /&gt;}&lt;br /&gt;year=atoi(array[0]);&lt;br /&gt;month=atoi(array[1]);&lt;br /&gt;day=atoi(array[2]);&lt;br /&gt;hour=atoi(array[3]);&lt;br /&gt;minute=atoi(array[4]);&lt;br /&gt;second=atoi(array[5]);&lt;br /&gt;....&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;note: i am sending the current time from app everytime i connect with bluetooth and getting the exact values in year,hour,...,seconds variable.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;but if&amp;nbsp; i call&amp;nbsp;nrf_cal_set_time(..) in main to starts from 1970&amp;nbsp; but not with the time i sent&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;my main looks like this&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;int main();&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;//all init&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nrf_cal_set_time(year, month, day, hour, minute, second);&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;while(1)&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;length=sprintf(cal_string,&amp;quot;%s&amp;quot;, nrf_cal_get_time_string(true));&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ble_nus_data_send(&amp;amp;m_nus,cal_string,&amp;amp;length,m_conn_handle);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;where should i call&amp;nbsp;&lt;span&gt;nrf_cal_set_time(..) in my program to make it run one time and start sending date and time from the time i sent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks and regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Manikandan V&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Time sync up</title><link>https://devzone.nordicsemi.com/thread/281477?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 09:49:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01f22752-cc67-4601-bc9a-15862634aa50</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Manikandan&lt;/p&gt;
&lt;p&gt;I believe I already answered these questions in one of your other cases.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you confirm whether or not you got some progress?&lt;/p&gt;
&lt;p&gt;If you have more questions about this I suggest we continue the discussion here, to avoid the other case getting too long an confusing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>