nl:: Weave:: Binding:: Configuration
#include <src/lib/core/WeaveBinding.h>
提供声明式样式的接口,用于配置和准备 Binding 对象。
摘要
配置 Binding 时,应用必须至少调用以下每个配置组中的一个方法:“目标”、“传输”和“安全性”。您可以根据需要调用其他方法,以覆盖默认行为。
如果调用了互斥配置(例如,Transport_TCP(),后跟 Transport_UDP(),则最后调用的进程胜出。
公共函数 |
|
---|---|
ConfigureFromMessage(const WeaveMessageInfo *aMsgInfo, const Inet::IPPacketInfo *aPacketInfo)
|
配置绑定以允许与已接收消息的发送者进行通信。
|
DNS_Options(uint8_t dnsOptions)
|
解析对等方的主机名时,请使用指定的 DNS 选项。
|
Exchange_ResponseTimeoutMsec(uint32_t aResponseTimeoutMsec)
|
为通过此 Binding 对象创建的广告交易平台上下文设置默认响应超时时间。
|
GetError(void) const
|
返回配置 Binding 时发生的任何错误。
|
PrepareBinding(void)
|
准备绑定以便与对等端进行通信。
|
Security_AppGroupKey(uint32_t aAppGroupGlobalId, uint32_t aRootKeyId, bool aUseRotatingKey)
|
与对等设备通信时,发送和接收针对特定 Weave 应用组加密的消息。
|
Security_AuthenticationMode(WeaveAuthMode aAuthMode)
|
设置请求的身份验证模式,用于对对等方进行身份验证。
|
Security_CASESession(void)
|
与对等节点通信时,使用与对等节点建立的 CASE 会话密钥来发送和接收加密的消息。
|
Security_EncryptionType(uint8_t aEncType)
|
与对等设备通信时,收发使用指定消息加密类型加密的消息。
|
Security_Key(uint32_t aKeyId)
|
与对等方通信时,收发使用指定密钥加密的消息。
|
Security_None(void)
|
与对等设备通信时,发送和接收数据均不会加密(即
|
Security_PASESession(uint8_t aPasswordSource)
|
与对等节点通信时,使用与对等节点建立的 PASE 会话密钥来发送和接收加密的消息。
|
Security_SharedCASESession(void)
|
与对等设备通信时,使用与 Nest 核心路由器建立的共享 CASE 会话密钥来发送和接收加密的消息。
|
Security_SharedCASESession(uint64_t aRouterNodeId)
|
与对等设备通信时,使用与特定路由器节点建立的共享 CASE 会话密钥来发送和接收加密的消息。
|
Security_TAKESession()
|
与对等节点通信时,使用与对等节点建立的 TAKE 会话密钥收发加密消息。
|
TargetAddress_IP(nl::Inet::IPAddress aPeerAddress, uint16_t aPeerPort, InterfaceId aInterfaceId)
|
与对等方通信时,使用特定的 IP 地址、端口和网络接口。
|
TargetAddress_IP(const char *aHostName, uint16_t aPeerPort, InterfaceId aInterfaceId)
|
与对等设备通信时,使用特定的主机名、端口和网络接口。
|
TargetAddress_IP(const char *aHostName, size_t aHostNameLen, uint16_t aPeerPort, InterfaceId aInterfaceId)
|
与对等设备通信时,使用特定的主机名、端口和网络接口。
|
TargetAddress_WeaveFabric(uint16_t aSubnetId)
|
与对等方通信时,使用根据对等方的节点 ID 和指定子网得出的 Weave 结构地址。
|
TargetAddress_WeaveService(void)
|
与对等设备通信时,请使用从对等设备节点 ID 派生的 Weave 服务结构地址。
|
Target_NodeId(uint64_t aPeerNodeId)
|
配置绑定以与特定 Weave 节点 ID 进行通信。
|
Target_ServiceEndpoint(uint64_t aPeerNodeId)
|
配置绑定以与特定 Weave 服务端点进行通信。
|
Transport_DefaultWRMPConfig(const WRMPConfig & aWRMPConfig)
|
为通过此 Binding 对象创建的广告交易平台上下文设置默认 WRMP 配置。
|
Transport_ExistingConnection(WeaveConnection *apConnection)
|
使用现有的 Weave 连接与对等设备通信。
|
Transport_TCP(void)
|
使用 TCP 与对等端通信。
|
Transport_UDP(void)
|
使用 UDP 与对等端通信。
|
Transport_UDP_PathMTU(uint32_t aPathMTU)
|
设置传输到对等端的 UDP 数据包的预期路径 MTU。
|
Transport_UDP_WRM(void)
|
与对等设备通信时使用 Weave Reliable Messaging 协议。
|
公共函数
ConfigureFromMessage
Configuration & ConfigureFromMessage( const WeaveMessageInfo *aMsgInfo, const Inet::IPPacketInfo *aPacketInfo )
配置绑定以允许与已接收消息的发送者进行通信。
具体说明 | |||||
---|---|---|---|---|---|
参数 |
|
DNS_Options
Configuration & DNS_Options( uint8_t dnsOptions )
解析对等方的主机名时,请使用指定的 DNS 选项。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
对绑定对象的引用。
|
Exchange_ResponseTimeoutMsec
Configuration & Exchange_ResponseTimeoutMsec( uint32_t aResponseTimeoutMsec )
为通过此 Binding 对象创建的广告交易平台上下文设置默认响应超时时间。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
对绑定对象的引用。
|
Security_AppGroupKey
Configuration & Security_AppGroupKey( uint32_t aAppGroupGlobalId, uint32_t aRootKeyId, bool aUseRotatingKey )
与对等设备通信时,发送和接收针对特定 Weave 应用组加密的消息。
具体说明 | |||||||
---|---|---|---|---|---|---|---|
参数 |
|
||||||
返回值 |
对 Binding 对象的引用。
|
Security_AuthenticationMode
Configuration & Security_AuthenticationMode( WeaveAuthMode aAuthMode )
Security_CASESession
Configuration & Security_CASESession( void )
与对等节点通信时,使用与对等节点建立的 CASE 会话密钥来发送和接收加密的消息。
如果必要的会话不可用,则系统将在准备绑定时自动建立该会话。
具体说明 | |
---|---|
返回值 |
对绑定对象的引用。
|
Security_EncryptionType
Configuration & Security_EncryptionType( uint8_t aEncType )
Security_Key
Configuration & Security_Key( uint32_t aKeyId )
Security_None
Configuration & Security_None( void )
与对等设备通信时,发送和接收数据均不会加密(即
不安全)消息。
具体说明 | |
---|---|
返回值 |
对绑定对象的引用。
|
Security_PASESession
Configuration & Security_PASESession( uint8_t aPasswordSource )
与对等节点通信时,使用与对等节点建立的 PASE 会话密钥来发送和接收加密的消息。
如果必要的会话不可用,则系统将在准备绑定时自动建立该会话。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
对绑定对象的引用。
|
Security_SharedCASESession
Configuration & Security_SharedCASESession( void )
与对等设备通信时,使用与 Nest 核心路由器建立的共享 CASE 会话密钥来发送和接收加密的消息。
如果必要的会话不可用,则系统将在准备绑定时自动建立该会话。
具体说明 | |
---|---|
返回值 |
对绑定对象的引用。
|
Security_SharedCASESession
Configuration & Security_SharedCASESession( uint64_t aRouterNodeId )
与对等设备通信时,使用与特定路由器节点建立的共享 CASE 会话密钥来发送和接收加密的消息。
如果必要的会话不可用,则系统将在准备绑定时自动建立该会话。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
对绑定对象的引用。
|
Security_TAKESession
Configuration & Security_TAKESession()
与对等节点通信时,使用与对等节点建立的 TAKE 会话密钥收发加密消息。
如果必要的会话不可用,则系统将在准备绑定时自动建立该会话。
具体说明 | |
---|---|
返回值 |
对绑定对象的引用。
|
TargetAddress_IP
Configuration & TargetAddress_IP( nl::Inet::IPAddress aPeerAddress, uint16_t aPeerPort, InterfaceId aInterfaceId )
与对等方通信时,使用特定的 IP 地址、端口和网络接口。
具体说明 | |||||||
---|---|---|---|---|---|---|---|
参数 |
|
||||||
返回值 |
对绑定对象的引用。
|
TargetAddress_IP
Configuration & TargetAddress_IP( const char *aHostName, uint16_t aPeerPort, InterfaceId aInterfaceId )
与对等设备通信时,使用特定的主机名、端口和网络接口。
注意:调用方必须确保提供的主机名字符串在绑定准备阶段完成之前保持有效。
具体说明 | |||||||
---|---|---|---|---|---|---|---|
参数 |
|
||||||
返回值 |
对绑定对象的引用。
|
TargetAddress_IP
Configuration & TargetAddress_IP( const char *aHostName, size_t aHostNameLen, uint16_t aPeerPort, InterfaceId aInterfaceId )
与对等设备通信时,使用特定的主机名、端口和网络接口。
注意:调用方必须确保提供的主机名字符串在绑定准备阶段完成之前保持有效。
具体说明 | |||||||||
---|---|---|---|---|---|---|---|---|---|
参数 |
|
||||||||
返回值 |
对绑定对象的引用。
|
TargetAddress_WeaveFabric
Configuration & TargetAddress_WeaveFabric( uint16_t aSubnetId )
与对等方通信时,使用根据对等方的节点 ID 和指定子网得出的 Weave 结构地址。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
对绑定对象的引用。
|
TargetAddress_WeaveService
Configuration & TargetAddress_WeaveService( void )
与对等设备通信时,请使用从对等设备节点 ID 派生的 Weave 服务结构地址。
具体说明 | |
---|---|
返回值 |
对绑定对象的引用。
|
Target_NodeId
Configuration & Target_NodeId( uint64_t aPeerNodeId )
配置绑定以与特定 Weave 节点 ID 进行通信。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
对绑定对象的引用。
|
Target_ServiceEndpoint
Configuration & Target_ServiceEndpoint( uint64_t aPeerNodeId )
配置绑定以与特定 Weave 服务端点进行通信。
如果未以其他方式配置,对等地址将设置为服务端点的 Weave 结构地址。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
对绑定对象的引用。
|
Transport_DefaultWRMPConfig
Configuration & Transport_DefaultWRMPConfig( const WRMPConfig & aWRMPConfig )
Transport_ExistingConnection
Configuration & Transport_ExistingConnection( WeaveConnection *apConnection )
使用现有的 Weave 连接与对等设备通信。
注意:绑定准备成功时,连接对象上的引用计数将递增。因此,应用应负责确保连接对象在该时间之前一直保持活动状态。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
对绑定对象的引用。
|
Transport_UDP_PathMTU
Configuration & Transport_UDP_PathMTU( uint32_t aPathMTU )
设置传输到对等端的 UDP 数据包的预期路径 MTU。
对于某些 Weave 协议,此参数将用于动态调整 Weave 消息载荷大小。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
对绑定对象的引用。
|
Transport_UDP_WRM
Configuration & Transport_UDP_WRM( void )
与对等设备通信时使用 Weave Reliable Messaging 协议。
具体说明 | |
---|---|
返回值 |
对绑定对象的引用。
|