nl:: Weave:: Profiles:: Time:: TimeZoneUtcOffset
#include <src/lib/profiles/time/WeaveTime.h>
时区的世界协调时间 (UTC) 偏移的编解码器。
摘要
构造函数和构造函数 |
|
---|---|
TimeZoneUtcOffset()
|
公共属性 |
|
---|---|
mSize
|
uint8_t
mUtcOffsetRecord 中的有效条目数
|
mUtcOffsetRecord[WEAVE_CONFIG_TIME_NUM_UTC_OFFSET_RECORD]
|
UTC 时差条目
|
公共静态属性 |
|
---|---|
BufferSizeForEncoding = 2 + 8 + 4 + (WEAVE_CONFIG_TIME_NUM_UTC_OFFSET_RECORD - 1) * 8
|
const uint32_t
TimeZoneUtcOffset::BufferSizeForEncoding 是一个编译时常量,可用于声明字节数组。
|
公共函数 |
|
---|---|
Decode(const uint8_t *const aInputBuf, const uint32_t aDataSize)
|
解码从 Weave TLV 提取的字节字符串的世界协调时间 (UTC) 偏移。
|
Encode(uint8_t *const aOutputBuf, uint32_t *const aDataSize)
|
将 UTC 偏移编码为缓冲区。
|
GetCurrentLocalTime(timesync_t *const aLocalTime, const timesync_t aUtcTime) const
|
使用存储的 UTC 时差将 UTC 时间转换为本地时间。
|
结构体 |
|
---|---|
nl:: |
转化信息 |
公共属性
mSize
uint8_t mSize
mUtcOffsetRecord 中的有效条目数
公共静态属性
缓冲区大小编码
const uint32_t BufferSizeForEncoding = 2 + 8 + 4 + (WEAVE_CONFIG_TIME_NUM_UTC_OFFSET_RECORD - 1) * 8
TimeZoneUtcOffset::BufferSizeForEncoding 是一个编译时常量,可用于声明字节数组。
调用方应准备足够的缓冲区空间,以便成功完成编码,而 BufferSizeForEncoding 是可能需要的最长缓冲区。
公共函数
解码
WEAVE_ERROR Decode( const uint8_t *const aInputBuf, const uint32_t aDataSize )
解码从 Weave TLV 提取的字节字符串的世界协调时间 (UTC) 偏移。
数据类型与 WeaveTLV.h 相同
详细信息 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
成功 WEAVE_NO_ERROR
|
编码
WEAVE_ERROR Encode( uint8_t *const aOutputBuf, uint32_t *const aDataSize )
将 UTC 偏移编码为缓冲区。
数据类型与 WeaveTLV.h 相同
详细信息 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
成功 WEAVE_NO_ERROR
|
GetCurrentLocalTime
WEAVE_ERROR GetCurrentLocalTime( timesync_t *const aLocalTime, const timesync_t aUtcTime ) const
使用存储的 UTC 时差将 UTC 时间转换为本地时间。
详细信息 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
成功时为 WEAVE_NO_ERROR。WEAVE_ERROR_KEY_NOT_FOUND(如果找不到)
|
TimeZoneUtcOffset
TimeZoneUtcOffset()