nl:: Weave:: Profiles:: BDX_Development:: BDXTransfer
#include <src/lib/profiles/bulk-data-transfer/Development/BDXTransferState.h>
此结构包含表示有效 BDX 传输的数据成员。
摘要
BdxProtocol 使用这些对象来维护协议状态。它们由 BdxServer 管理,BdxServer 负责创建和初始化新的转移作业,包括管理 Connections 和 ExchangeContexts。
公共属性 |
|
---|---|
mAmInitiator
|
bool
|
mAmSender
|
bool
|
mAppState
|
void *
|
mBlockCounter
|
uint32_t
我们预计下一个块编号在发送时(转移正式开始后)会收到 BlockQuery 或 BlockACK。
|
mBytesSent
|
uint64_t
|
mExchangeContext
|
|
mFileDesignator
|
file/block 相关数据成员 TODO:移除此内容?或者我们是否应该就此字符串可能外观及使用方式建立协定?具体来说,它是否由 PacketBuffer 支持?如果是,它可能不会一直停留整个 Xfer,因为这样会占用大量计算机。
|
mFirstQuery
|
bool
|
mHandlers
|
|
mIsAccepted
|
bool
|
mIsCompletedSuccessfully
|
bool
|
mIsInitiated
|
bool
|
mIsWideRange
|
bool
|
mLength
|
uint64_t
|
mMaxBlockSize
|
uint16_t
|
mNext)(BDXTransfer &)
|
|
mStartOffset
|
uint64_t
|
mTransferMode
|
uint8_t
|
mVersion
|
uint8_t
|
公共函数 |
|
---|---|
DispatchErrorHandler(WEAVE_ERROR anErrorCode)
|
void
如果设置了错误处理程序,则调用它。
|
DispatchGetBlockHandler(uint64_t *aLength, uint8_t **aDataBlock, bool *aLastBlock)
|
void
如果 get 块处理程序已设置,则调用它。
|
DispatchPutBlockHandler(uint64_t aLength, uint8_t *aDataBlock, bool aLastBlock)
|
void
如果设置了 put 块处理程序,则调用它。
|
DispatchReceiveAccept(ReceiveAccept *aReceiveAcceptMsg)
|
调度程序只会检查是否已设置处理程序,如果是,则调用处理程序。
|
DispatchRejectHandler(StatusReport *aReport)
|
void
如果已设置拒绝处理程序,则调用该处理程序。
|
DispatchSendAccept(SendAccept *aSendAcceptMsg)
|
如果已设置发送接受处理程序,则调用该处理程序。
|
DispatchXferDoneHandler(void)
|
void
如果已设置传输完成处理程序,则调用该处理程序。
|
DispatchXferErrorHandler(StatusReport *aXferError)
|
void
如果设置了传输错误处理程序,则调用该处理程序。
|
GetDefaultFlags(bool aExpectResponse)
|
uint16_t
此函数返回将随邮件发送的默认标记。
|
IsAsync(void)
|
bool
Returns true if this transfer is asynchronous, false otherwise. |
IsDriver(void)
|
bool
Returns true if this entity (node) is the driver for this transfer, false otherwise. |
Reset(void)
|
void
Sets all pointers to NULL, resets counters, etc. |
SetHandlers(BDXHandlers aHandlers)
|
void
此函数会在此 BDXTransfer 对象上设置处理程序。
|
Shutdown(void)
|
void
Shuts down the current transfer, including closing any open ExchangeContext. |
公共属性
mAmInitiator
bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mAmInitiator
mAmSender
bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mAmSender
mAppState
void * nl::Weave::Profiles::BDX_Development::BDXTransfer::mAppState
mBlockCounter
uint32_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mBlockCounter
我们预计下一个块编号在发送时(转移正式开始后)会收到 BlockQuery 或 BlockACK。
收到消息时,它是我们预期收到的下一个 BlockSend,或者是我们发送的最新 BlockQuery(在传输正式开始且第一个查询已发送之后)。
mBytesSent
uint64_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mBytesSent
mExchangeContext
ExchangeContext * nl::Weave::Profiles::BDX_Development::BDXTransfer::mExchangeContext
mFileDesignator
ReferencedString nl::Weave::Profiles::BDX_Development::BDXTransfer::mFileDesignator
file/block 相关数据成员 TODO:移除此内容?或者我们是否应该就此字符串可能外观及使用方式建立协定?具体来说,它是否由 PacketBuffer 支持?如果是,它可能不会一直停留整个 Xfer,因为这样会占用大量计算机。
mFirstQuery
bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mFirstQuery
mHandlers
BDXHandlers nl::Weave::Profiles::BDX_Development::BDXTransfer::mHandlers
mIsAccepted
bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mIsAccepted
mIsCompletedSuccessfully
bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mIsCompletedSuccessfully
mIsInitiated
bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mIsInitiated
mIsWideRange
bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mIsWideRange
mLength
uint64_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mLength
mMaxBlockSize
uint16_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mMaxBlockSize
mNext
WEAVE_ERROR(* nl::Weave::Profiles::BDX_Development::BDXTransfer::mNext)(BDXTransfer &)
mStartOffset
uint64_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mStartOffset
mTransferMode
uint8_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mTransferMode
mVersion
uint8_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mVersion
公共函数
DispatchErrorHandler
void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchErrorHandler( WEAVE_ERROR anErrorCode )
如果设置了错误处理程序,则调用它。
如果未设置,则默认情况下还会关闭传输。
具体说明 | |||
---|---|---|---|
参数 |
|
DispatchGetBlockHandler
void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchGetBlockHandler( uint64_t *aLength, uint8_t **aDataBlock, bool *aLastBlock )
如果 get 块处理程序已设置,则调用它。
具体说明 | |||||||
---|---|---|---|---|---|---|---|
参数 |
|
DispatchPutBlockHandler
void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchPutBlockHandler( uint64_t aLength, uint8_t *aDataBlock, bool aLastBlock )
如果设置了 put 块处理程序,则调用它。
具体说明 | |||||||
---|---|---|---|---|---|---|---|
参数 |
|
DispatchReceiveAccept
WEAVE_ERROR nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchReceiveAccept( ReceiveAccept *aReceiveAcceptMsg )
调度程序只会检查是否已设置处理程序,如果是,则调用处理程序。
如果已设置接收接受处理程序,则调用该处理程序。
因此,这些应用作调用回调的公共接口,绝不应被外部应用直接触摸。BDXTransfer 的未来修订版本可能会使用委托对象,而不是存储指向每个回调的各个指针。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
错误值
|
DispatchRejectHandler
void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchRejectHandler( StatusReport *aReport )
如果已设置拒绝处理程序,则调用该处理程序。
如果未设置,则默认情况下还会关闭传输。
具体说明 | |||
---|---|---|---|
参数 |
|
DispatchSendAccept
WEAVE_ERROR nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchSendAccept( SendAccept *aSendAcceptMsg )
DispatchXferDoneHandler
void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchXferDoneHandler( void )
如果已设置传输完成处理程序,则调用该处理程序。
如果未设置,则默认情况下还会关闭传输。
DispatchXferErrorHandler
void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchXferErrorHandler( StatusReport *aXferError )
如果设置了传输错误处理程序,则调用该处理程序。
如果未设置,则默认情况下还会关闭传输。
具体说明 | |||
---|---|---|---|
参数 |
|
GetDefaultFlags
uint16_t nl::Weave::Profiles::BDX_Development::BDXTransfer::GetDefaultFlags( bool aExpectResponse )
此函数返回将随邮件发送的默认标记。
具体说明 | |||
---|---|---|---|
参数 |
|
||
返回值 |
要发送的标志
|
IsAsync
bool nl::Weave::Profiles::BDX_Development::BDXTransfer::IsAsync( void )
Returns true if this transfer is asynchronous, false otherwise.
具体说明 | |
---|---|
返回值 |
如果传输是异步的,则返回 true。
|
IsDriver
bool nl::Weave::Profiles::BDX_Development::BDXTransfer::IsDriver( void )
Returns true if this entity (node) is the driver for this transfer, false otherwise.
具体说明 | |
---|---|
返回值 |
当且仅当此实体是本次转移的司机时为 true
|
重置
void nl::Weave::Profiles::BDX_Development::BDXTransfer::Reset( void )
Sets all pointers to NULL, resets counters, etc.
关机时调用。
SetHandlers
void nl::Weave::Profiles::BDX_Development::BDXTransfer::SetHandlers( BDXHandlers aHandlers )
此函数会在此 BDXTransfer 对象上设置处理程序。
您应该始终使用此方法,而不是手动进行设置,因为处理程序函数指针的存储方式底层实现不是公共 API 的一部分。
具体说明 | |||
---|---|---|---|
参数 |
|
关停
void nl::Weave::Profiles::BDX_Development::BDXTransfer::Shutdown( void )
Shuts down the current transfer, including closing any open ExchangeContext.
利用此机会释放与此传输和应用逻辑关联的任何资源。