nl:: Weave:: Profiles:: SoftwareUpdate:: ImageQueryResponse
#include <src/lib/profiles/software-update/SoftwareUpdateProfile.h>
支持创建和解码图片查询响应消息的类。
摘要
图片查询响应消息采用以下格式:
时长 | 字段名称 |
变量 | URI |
变量 | 版本规范 |
变量 | 完整性规范 |
1 个字节 | 更新方案 |
1 个字节 | 更新选项 |
钻头 | 含义 |
0..2 | 更新优先级 |
3..4 | 更新使用情况 |
5 | 报告状态。设置后,系统会请求客户端生成可选的 DownloadNotifications 和 UpdateNotifications 消息。 |
5..7 | 预留 |
构造函数和析构函数 |
|
---|---|
ImageQueryResponse()
ImageQueryResponse 的默认构造函数。
|
公共属性 |
|
---|---|
integritySpec
|
包含软件更新映像完整性信息(完整性类型和哈希)的字段。
|
reportStatus
|
bool
请求通过可选的 DownloadNotifications 和 UpdateNotifications 消息告知服务器软件更新的进度。
|
updateCondition
|
关于在什么条件下继续软件更新的说明。
|
updatePriority
|
指示设备何时执行软件更新的说明。
|
updateScheme
|
uint8_t
用于下载软件更新映像的更新方案。
|
uri
|
长度可变的 UTF-8 字符串,其中包含软件映像的位置。
|
versionSpec
|
可变长度的 UTF-8 字符串,其中包含供应商专用软件版本标识。
|
公共函数 |
|
---|---|
init(ReferencedString &, ReferencedString &, IntegritySpec &, uint8_t, UpdatePriority, UpdateCondition, bool)
|
使用提供的值显式初始化 ImageQueryResponse 对象。
|
operator==(const ImageQueryResponse &) const
|
bool
等式运算符。
|
pack(PacketBuffer *)
|
将 ImageQueryResponse 序列化到提供的 PacketBuffer 中。
|
print(void)
|
void
|
公共静态函数 |
|
---|---|
parse(PacketBuffer *, ImageQueryResponse &)
|
将 PacketBuffer 中提供的图片查询响应消息反序列化为提供的 ImageQueryResponse。
|
公共属性
reportStatus
bool reportStatus
请求通过可选的 DownloadNotifications 和 UpdateNotifications 消息告知服务器软件更新的进度。
uri
ReferencedString uri
长度可变的 UTF-8 字符串,其中包含软件映像的位置。
此字符串的内容必须符合 RFC 3986 规范。对于与明确定义的互联网协议(HTTP、HTTPS、SFTP)对应的更新方案,URI 的架构元素必须符合该协议方案的规范网址编码。字符串长度不得超过 65565,且字符串不得超过单个 Weave 消息,该消息可能会受到 MTU 限制的约束。
公共函数
ImageQueryResponse
ImageQueryResponse()
ImageQueryResponse 的默认构造函数。
您可以通过 init() 方法或对消息中的对象进行反序列化来填充 ImageQueryResponse。
init
WEAVE_ERROR init( ReferencedString &, ReferencedString &, IntegritySpec &, uint8_t, UpdatePriority, UpdateCondition, bool )
使用提供的值显式初始化 ImageQueryResponse 对象。
具体说明 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
参数 |
|
||||||||||||||
返回值 |
WEAVE_NO_ERROR 无条件。
|
运算符==
bool operator==( const ImageQueryResponse & ) const
等式运算符。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
如果两个对象中的所有字段相等,则返回 true,否则返回 false
|
包
WEAVE_ERROR pack( PacketBuffer * )
将 ImageQueryResponse 序列化到提供的 PacketBuffer 中。
具体说明 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
|
输出
void print( void )
公共静态函数
parse
WEAVE_ERROR parse( PacketBuffer *, ImageQueryResponse & )
将 PacketBuffer 中提供的图片查询响应消息反序列化为提供的 ImageQueryResponse。
具体说明 | |||||
---|---|---|---|---|---|
参数 |
|
||||
返回值 |
WEAVE_NO_ERROR 成功时
|
||||
返回值 |
WEAVE_ERROR_BUFFER_TOO_SMALL 如果消息太小,无法包含 ImageQuery 的所有字段
|
||||
返回值 |
WEAVE_ERROR_INVALID_INTEGRITY_TYPE 如果提供的完整性类型不是 IntegrityTypes 中指定的值之一
|