{"action":"created","comment":{"url":"https://api.github.com/repos/openthread/openthread/pulls/comments/197855216","pull_request_review_id":131680767,"id":197855216,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Nzg1NTIxNg==","diff_hunk":"@@ -679,6 +699,12 @@ void nrf_802154_received_raw(uint8_t *p_data, int8_t power, uint8_t lqi)\n     receivedFrame->mInfo.mRxInfo.mMsec = timestamp / US_PER_MS;\n     receivedFrame->mInfo.mRxInfo.mUsec = timestamp - receivedFrame->mMsec * US_PER_MS;\n #endif\n+#if OPENTHREAD_CONFIG_ENABLE_TIME_SYNC\n+    // Get the timestamp when the SFD was received.\n+    uint32_t offset =\n+        (int32_t)otPlatAlarmMicroGetNow() - (int32_t)nrf_802154_first_symbol_timestamp_get(time, p_data[0]);\n+    receivedFrame->mIeInfo->mTimestamp = otPlatTimeGet() - offset;","path":"examples/platforms/nrf52840/radio.c","position":86,"original_position":86,"commit_id":"66331fbbbba38c5968a438c078a199fa591df9af","original_commit_id":"66331fbbbba38c5968a438c078a199fa591df9af","user":{"login":"tomas-c","id":5213953,"node_id":"MDQ6VXNlcjUyMTM5NTM=","avatar_url":"https://avatars0.githubusercontent.com/u/5213953?v=4","gravatar_id":"","url":"https://api.github.com/users/tomas-c","html_url":"https://github.com/tomas-c","followers_url":"https://api.github.com/users/tomas-c/followers","following_url":"https://api.github.com/users/tomas-c/following{/other_user}","gists_url":"https://api.github.com/users/tomas-c/gists{/gist_id}","starred_url":"https://api.github.com/users/tomas-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomas-c/subscriptions","organizations_url":"https://api.github.com/users/tomas-c/orgs","repos_url":"https://api.github.com/users/tomas-c/repos","events_url":"https://api.github.com/users/tomas-c/events{/privacy}","received_events_url":"https://api.github.com/users/tomas-c/received_events","type":"User","site_admin":false},"body":"@chshu Isn't otPlatTimeGet() equal to otPlatAlarmMicroGetNow() ? It seems this effectively does:\r\n\r\n```\r\nreceivedFrame->mIeInfo->mTimestamp = (int32_t)nrf_802154_first_symbol_timestamp_get(time, p_data[0]);\r\n```","created_at":"2018-06-25T16:14:46Z","updated_at":"2018-06-25T16:14:46Z","html_url":"https://github.com/openthread/openthread/pull/2618#discussion_r197855216","pull_request_url":"https://api.github.com/repos/openthread/openthread/pulls/2618","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openthread/openthread/pulls/comments/197855216"},"html":{"href":"https://github.com/openthread/openthread/pull/2618#discussion_r197855216"},"pull_request":{"href":"https://api.github.com/repos/openthread/openthread/pulls/2618"}}},"pull_request":{"url":"https://api.github.com/repos/openthread/openthread/pulls/2618","id":175134393,"node_id":"MDExOlB1bGxSZXF1ZXN0MTc1MTM0Mzkz","html_url":"https://github.com/openthread/openthread/pull/2618","diff_url":"https://github.com/openthread/openthread/pull/2618.diff","patch_url":"https://github.com/openthread/openthread/pull/2618.patch","issue_url":"https://api.github.com/repos/openthread/openthread/issues/2618","number":2618,"state":"open","locked":false,"title":"[time-sync] network-wide time synchronization service","user":{"login":"chshu","id":20312411,"node_id":"MDQ6VXNlcjIwMzEyNDEx","avatar_url":"https://avatars0.githubusercontent.com/u/20312411?v=4","gravatar_id":"","url":"https://api.github.com/users/chshu","html_url":"https://github.com/chshu","followers_url":"https://api.github.com/users/chshu/followers","following_url":"https://api.github.com/users/chshu/following{/other_user}","gists_url":"https://api.github.com/users/chshu/gists{/gist_id}","starred_url":"https://api.github.com/users/chshu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chshu/subscriptions","organizations_url":"https://api.github.com/users/chshu/orgs","repos_url":"https://api.github.com/users/chshu/repos","events_url":"https://api.github.com/users/chshu/events{/privacy}","received_events_url":"https://api.github.com/users/chshu/received_events","type":"User","site_admin":false},"body":"OpenThread network-wide time synchronization service is an **experimental** feature, not part of the standard Thread protocol.\r\n\r\nFeature Overview:\r\n * All the nodes in the same Thread partition sync to the same Thread network-wide time;\r\n * Microsecond level time synchronization precision;\r\n * Flexible time accuracy and time sync period configuration;\r\n * APIs for application layer use case, support both CLI and NCP version.\r\n\r\nThe feature is wrapped by `OPENTHREAD_CONFIG_ENABLE_TIME_SYNC`, there's no change to current Thread 1.1 implementation if `OPENTHREAD_CONFIG_ENABLE_TIME_SYNC` is not enabled.\r\n\r\nIf `OPENTHREAD_CONFIG_ENABLE_TIME_SYNC` is enabled, the node could:\r\n * Attach to a time sync enabled network, otherwise\r\n * Attach to a standard Thread 1.1 network, otherwise\r\n * Form a new time sync enabled network\r\n\r\nIn addition, if `OPENTHREAD_CONFIG_TIME_SYNC_ESSENTIAL` is also enable, the node could only:\r\n * Attach to a time sync enabled network, otherwise\r\n * Form a new time sync enabled network\r\n\r\nNote:\r\nCurrently, the feature is only supported on nRF52840 and posix platforms. And the network time\r\nis only synced among Routers and REEDs, the SEDs will be supported later as an optional feature.","created_at":"2018-03-15T02:38:02Z","updated_at":"2018-06-25T16:14:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a8959d9996d33039f7717f7e274918fb2133b7d4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":397568980,"node_id":"MDU6TGFiZWwzOTc1Njg5ODA=","url":"https://api.github.com/repos/openthread/openthread/labels/P4","name":"P4","color":"AFDF00","default":false},{"id":355043113,"node_id":"MDU6TGFiZWwzNTUwNDMxMTM=","url":"https://api.github.com/repos/openthread/openthread/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/openthread/openthread/pulls/2618/commits","review_comments_url":"https://api.github.com/repos/openthread/openthread/pulls/2618/comments","review_comment_url":"https://api.github.com/repos/openthread/openthread/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openthread/openthread/issues/2618/comments","statuses_url":"https://api.github.com/repos/openthread/openthread/statuses/66331fbbbba38c5968a438c078a199fa591df9af","head":{"label":"chshu:pr/time-sync-service","ref":"pr/time-sync-service","sha":"66331fbbbba38c5968a438c078a199fa591df9af","user":{"login":"chshu","id":20312411,"node_id":"MDQ6VXNlcjIwMzEyNDEx","avatar_url":"https://avatars0.githubusercontent.com/u/20312411?v=4","gravatar_id":"","url":"https://api.github.com/users/chshu","html_url":"https://github.com/chshu","followers_url":"https://api.github.com/users/chshu/followers","following_url":"https://api.github.com/users/chshu/following{/other_user}","gists_url":"https://api.github.com/users/chshu/gists{/gist_id}","starred_url":"https://api.github.com/users/chshu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chshu/subscriptions","organizations_url":"https://api.github.com/users/chshu/orgs","repos_url":"https://api.github.com/users/chshu/repos","events_url":"https://api.github.com/users/chshu/events{/privacy}","received_events_url":"https://api.github.com/users/chshu/received_events","type":"User","site_admin":false},"repo":{"id":64193194,"node_id":"MDEwOlJlcG9zaXRvcnk2NDE5MzE5NA==","name":"openthread","full_name":"chshu/openthread","owner":{"login":"chshu","id":20312411,"node_id":"MDQ6VXNlcjIwMzEyNDEx","avatar_url":"https://avatars0.githubusercontent.com/u/20312411?v=4","gravatar_id":"","url":"https://api.github.com/users/chshu","html_url":"https://github.com/chshu","followers_url":"https://api.github.com/users/chshu/followers","following_url":"https://api.github.com/users/chshu/following{/other_user}","gists_url":"https://api.github.com/users/chshu/gists{/gist_id}","starred_url":"https://api.github.com/users/chshu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chshu/subscriptions","organizations_url":"https://api.github.com/users/chshu/orgs","repos_url":"https://api.github.com/users/chshu/repos","events_url":"https://api.github.com/users/chshu/events{/privacy}","received_events_url":"https://api.github.com/users/chshu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chshu/openthread","description":"OpenThread released by Nest is an open-source implementation of the Thread networking protocol","fork":true,"url":"https://api.github.com/repos/chshu/openthread","forks_url":"https://api.github.com/repos/chshu/openthread/forks","keys_url":"https://api.github.com/repos/chshu/openthread/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chshu/openthread/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chshu/openthread/teams","hooks_url":"https://api.github.com/repos/chshu/openthread/hooks","issue_events_url":"https://api.github.com/repos/chshu/openthread/issues/events{/number}","events_url":"https://api.github.com/repos/chshu/openthread/events","assignees_url":"https://api.github.com/repos/chshu/openthread/assignees{/user}","branches_url":"https://api.github.com/repos/chshu/openthread/branches{/branch}","tags_url":"https://api.github.com/repos/chshu/openthread/tags","blobs_url":"https://api.github.com/repos/chshu/openthread/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chshu/openthread/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chshu/openthread/git/refs{/sha}","trees_url":"https://api.github.com/repos/chshu/openthread/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chshu/openthread/statuses/{sha}","languages_url":"https://api.github.com/repos/chshu/openthread/languages","stargazers_url":"https://api.github.com/repos/chshu/openthread/stargazers","contributors_url":"https://api.github.com/repos/chshu/openthread/contributors","subscribers_url":"https://api.github.com/repos/chshu/openthread/subscribers","subscription_url":"https://api.github.com/repos/chshu/openthread/subscription","commits_url":"https://api.github.com/repos/chshu/openthread/commits{/sha}","git_commits_url":"https://api.github.com/repos/chshu/openthread/git/commits{/sha}","comments_url":"https://api.github.com/repos/chshu/openthread/comments{/number}","issue_comment_url":"https://api.github.com/repos/chshu/openthread/issues/comments{/number}","contents_url":"https://api.github.com/repos/chshu/openthread/contents/{+path}","compare_url":"https://api.github.com/repos/chshu/openthread/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chshu/openthread/merges","archive_url":"https://api.github.com/repos/chshu/openthread/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chshu/openthread/downloads","issues_url":"https://api.github.com/repos/chshu/openthread/issues{/number}","pulls_url":"https://api.github.com/repos/chshu/openthread/pulls{/number}","milestones_url":"https://api.github.com/repos/chshu/openthread/milestones{/number}","notifications_url":"https://api.github.com/repos/chshu/openthread/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chshu/openthread/labels{/name}","releases_url":"https://api.github.com/repos/chshu/openthread/releases{/id}","deployments_url":"https://api.github.com/repos/chshu/openthread/deployments","created_at":"2016-07-26T05:41:22Z","updated_at":"2018-06-05T00:15:46Z","pushed_at":"2018-06-21T16:11:38Z","git_url":"git://github.com/chshu/openthread.git","ssh_url":"git@github.com:chshu/openthread.git","clone_url":"https://github.com/chshu/openthread.git","svn_url":"https://github.com/chshu/openthread","homepage":"","size":48593,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openthread:master","ref":"master","sha":"0616997957d7e0a64a2022334859cf097c97f77c","user":{"login":"openthread","id":16142269,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MTQyMjY5","avatar_url":"https://avatars2.githubusercontent.com/u/16142269?v=4","gravatar_id":"","url":"https://api.github.com/users/openthread","html_url":"https://github.com/openthread","followers_url":"https://api.github.com/users/openthread/followers","following_url":"https://api.github.com/users/openthread/following{/other_user}","gists_url":"https://api.github.com/users/openthread/gists{/gist_id}","starred_url":"https://api.github.com/users/openthread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openthread/subscriptions","organizations_url":"https://api.github.com/users/openthread/orgs","repos_url":"https://api.github.com/users/openthread/repos","events_url":"https://api.github.com/users/openthread/events{/privacy}","received_events_url":"https://api.github.com/users/openthread/received_events","type":"Organization","site_admin":false},"repo":{"id":55808787,"node_id":"MDEwOlJlcG9zaXRvcnk1NTgwODc4Nw==","name":"openthread","full_name":"openthread/openthread","owner":{"login":"openthread","id":16142269,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MTQyMjY5","avatar_url":"https://avatars2.githubusercontent.com/u/16142269?v=4","gravatar_id":"","url":"https://api.github.com/users/openthread","html_url":"https://github.com/openthread","followers_url":"https://api.github.com/users/openthread/followers","following_url":"https://api.github.com/users/openthread/following{/other_user}","gists_url":"https://api.github.com/users/openthread/gists{/gist_id}","starred_url":"https://api.github.com/users/openthread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openthread/subscriptions","organizations_url":"https://api.github.com/users/openthread/orgs","repos_url":"https://api.github.com/users/openthread/repos","events_url":"https://api.github.com/users/openthread/events{/privacy}","received_events_url":"https://api.github.com/users/openthread/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openthread/openthread","description":"OpenThread released by Nest is an open-source implementation of the Thread networking protocol","fork":false,"url":"https://api.github.com/repos/openthread/openthread","forks_url":"https://api.github.com/repos/openthread/openthread/forks","keys_url":"https://api.github.com/repos/openthread/openthread/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openthread/openthread/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openthread/openthread/teams","hooks_url":"https://api.github.com/repos/openthread/openthread/hooks","issue_events_url":"https://api.github.com/repos/openthread/openthread/issues/events{/number}","events_url":"https://api.github.com/repos/openthread/openthread/events","assignees_url":"https://api.github.com/repos/openthread/openthread/assignees{/user}","branches_url":"https://api.github.com/repos/openthread/openthread/branches{/branch}","tags_url":"https://api.github.com/repos/openthread/openthread/tags","blobs_url":"https://api.github.com/repos/openthread/openthread/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openthread/openthread/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openthread/openthread/git/refs{/sha}","trees_url":"https://api.github.com/repos/openthread/openthread/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openthread/openthread/statuses/{sha}","languages_url":"https://api.github.com/repos/openthread/openthread/languages","stargazers_url":"https://api.github.com/repos/openthread/openthread/stargazers","contributors_url":"https://api.github.com/repos/openthread/openthread/contributors","subscribers_url":"https://api.github.com/repos/openthread/openthread/subscribers","subscription_url":"https://api.github.com/repos/openthread/openthread/subscription","commits_url":"https://api.github.com/repos/openthread/openthread/commits{/sha}","git_commits_url":"https://api.github.com/repos/openthread/openthread/git/commits{/sha}","comments_url":"https://api.github.com/repos/openthread/openthread/comments{/number}","issue_comment_url":"https://api.github.com/repos/openthread/openthread/issues/comments{/number}","contents_url":"https://api.github.com/repos/openthread/openthread/contents/{+path}","compare_url":"https://api.github.com/repos/openthread/openthread/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openthread/openthread/merges","archive_url":"https://api.github.com/repos/openthread/openthread/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openthread/openthread/downloads","issues_url":"https://api.github.com/repos/openthread/openthread/issues{/number}","pulls_url":"https://api.github.com/repos/openthread/openthread/pulls{/number}","milestones_url":"https://api.github.com/repos/openthread/openthread/milestones{/number}","notifications_url":"https://api.github.com/repos/openthread/openthread/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openthread/openthread/labels{/name}","releases_url":"https://api.github.com/repos/openthread/openthread/releases{/id}","deployments_url":"https://api.github.com/repos/openthread/openthread/deployments","created_at":"2016-04-08T20:47:41Z","updated_at":"2018-06-25T14:05:00Z","pushed_at":"2018-06-25T14:11:43Z","git_url":"git://github.com/openthread/openthread.git","ssh_url":"git@github.com:openthread/openthread.git","clone_url":"https://github.com/openthread/openthread.git","svn_url":"https://github.com/openthread/openthread","homepage":"","size":48414,"stargazers_count":1593,"watchers_count":1593,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":468,"mirror_url":null,"archived":false,"open_issues_count":53,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":468,"open_issues":53,"watchers":1593,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openthread/openthread/pulls/2618"},"html":{"href":"https://github.com/openthread/openthread/pull/2618"},"issue":{"href":"https://api.github.com/repos/openthread/openthread/issues/2618"},"comments":{"href":"https://api.github.com/repos/openthread/openthread/issues/2618/comments"},"review_comments":{"href":"https://api.github.com/repos/openthread/openthread/pulls/2618/comments"},"review_comment":{"href":"https://api.github.com/repos/openthread/openthread/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openthread/openthread/pulls/2618/commits"},"statuses":{"href":"https://api.github.com/repos/openthread/openthread/statuses/66331fbbbba38c5968a438c078a199fa591df9af"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tomas-c"}}