change(ble): Add Time Update service
1 unresolved thread
1 unresolved thread
This adds BLE a characteristic which allows to set the current time. The time is set in milliseconds since 1.1.1970 as 64 bit value.
Signed-off-by: Hauke Mehrtens hauke@hauke-m.de
Merge request reports
Activity
added 2 commits
assigned to @schneider
- Resolved by schneider
224 uint64_t timeNet; 225 uint64_t time; 226 uint32_t sec; 227 uint32_t ssec; 228 int res; 229 230 if (len < sizeof(uint64_t)) { 231 return ATT_ERR_LENGTH; 232 } 233 memcpy(&timeNet, pValue, sizeof(timeNet)); 234 235 time = __ntohl(timeNet); 236 sec = time / 1000; 237 ssec = (time % 1000); 238 ssec *= 256; 239 ssec /= 1000; I assume the sub seconds is a 256th of a second, but I am not sure.
Edited by Hauke Mehrtenschanged this line in version 3 of the diff
added 4-BLE label
added 2 commits
added 6 commits
-
966497ac...77a3af48 - 4 commits from branch
card10:master
- a064aaad - RTC: Add function to set time
- 0510b5d6 - change(ble): Add Time Update service
-
966497ac...77a3af48 - 4 commits from branch
mentioned in merge request !108 (merged)
Please register or sign in to reply