nl::Weave::Profiles::BDX_Development::BDXTransfer

#include <src/lib/profiles/bulk-data-transfer/Development/BDXTransferState.h>

此结构包含表示活跃 BDX 传输的数据成员。

摘要

BdxProtocol 会使用这些对象来维护协议状态。它们由 BdxServer 管理,BdxServer 负责处理新转移作业的创建和初始化,包括管理连接和 ExchangeContext。

公共属性

mAmInitiator
bool
mAmSender
bool
mAppState
void *
mBlockCounter
uint32_t
我们预期在发送(转移正式开始后)后接收的 BlockQuery 或 BlockACK 的下一个块编号。
mBytesSent
uint64_t
mExchangeContext
mFileDesignator
文件/块相关数据 TODO:移除此字符串?还是我们只需确定此字符串可能是什么样子以及如何使用该协定?具体来说,它是否由 PacketBuffer 提供支持?如果是,它应该不会停留在整个 xfer 中,因为这会占用 pbuf
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
如果已设置放置块处理程序,请调用它。
DispatchReceiveAccept(ReceiveAccept *aReceiveAcceptMsg)
调度程序只是检查处理程序是否已设置,如果已经设置,则进行调用。
DispatchRejectHandler(StatusReport *aReport)
void
如果设置了拒绝处理程序,请调用它。
DispatchSendAccept(SendAccept *aSendAcceptMsg)
如果设置了发送接受处理程序,请调用它。
DispatchXferDoneHandler(void)
void
如果已设置 Transfer Done 处理程序,请调用它。
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.

公共属性

启动工具

bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mAmInitiator

mAmSender

bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mAmSender

移动应用状态

void * nl::Weave::Profiles::BDX_Development::BDXTransfer::mAppState

mBlockCounter

uint32_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mBlockCounter

我们预期在发送(转移正式开始后)后接收的 BlockQuery 或 BlockACK 的下一个块编号。

收到信息后,它是指我们预计会收到的下一个 BlockSend 或我们发送的最新 BlockQuery(在传输正式开始并且首个发送查询后)。

兆字节已发送

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

文件/块相关数据 TODO:移除此字符串?还是我们只需确定此字符串可能是什么样子以及如何使用该协定?具体来说,它是否由 PacketBuffer 提供支持?如果是,它应该不会停留在整个 xfer 中,因为这会占用 pbuf

mFirstQuery

bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mFirstQuery

mHandler

BDXHandlers nl::Weave::Profiles::BDX_Development::BDXTransfer::mHandlers

mIaccept

bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mIsAccepted

已成功完成

bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mIsCompletedSuccessfully

已启动

bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mIsInitiated

mIsWideRange

bool nl::Weave::Profiles::BDX_Development::BDXTransfer::mIsWideRange

米长度

uint64_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mLength

mMaxBlockSize

uint16_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mMaxBlockSize

下一个

WEAVE_ERROR(* nl::Weave::Profiles::BDX_Development::BDXTransfer::mNext)(BDXTransfer &)

mStartOffset

uint64_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mStartOffset

mTransfer 模式

uint8_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mTransferMode

移动版本

uint8_t nl::Weave::Profiles::BDX_Development::BDXTransfer::mVersion

公共函数

DispatchErrorHandler 类中的方法

void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchErrorHandler(
  WEAVE_ERROR anErrorCode
)

如果设置了错误处理程序,请调用它。

如果未设置,则也关闭作为默认行为的传输。

详细信息
参数
[in] anErrorCode
要处理的错误代码

DispatchGetBlockHandler

void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchGetBlockHandler(
  uint64_t *aLength,
  uint8_t **aDataBlock,
  bool *aLastBlock
)

如果已设置 get 块处理程序,请调用它。

详细信息
参数
[in] aLength
代码块长度
[in] aDataBlock
指向数据块的指针
[in] aLastBlock
如果这是转移作业的最后一个块,则为 true

DispatchPutBlockHandler:

void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchPutBlockHandler(
  uint64_t aLength,
  uint8_t *aDataBlock,
  bool aLastBlock
)

如果已设置放置块处理程序,请调用它。

详细信息
参数
[in] aLength
代码块长度
[in] aDataBlock
指向数据块的指针
[in] aLastBlock
如果这是转移作业的最后一个块,则为 true

DispatchReceiveAccept

WEAVE_ERROR nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchReceiveAccept(
  ReceiveAccept *aReceiveAcceptMsg
)

调度程序只是检查处理程序是否已设置,如果已经设置,则进行调用。

如果已设置接收接受处理程序,请调用它。

因此,这些应用作调用回调的公共接口,绝不应直接由外部应用接触。BDXTransfer 的未来修订版本可能会使用代理对象,而不是存储每个回调的单独指针。

详细信息
参数
[in] aReceiveAcceptMsg
要处理的 ReceiveAccept 消息
返回值
错误值

DispatchRejectedHandler:

void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchRejectHandler(
  StatusReport *aReport
)

如果设置了拒绝处理程序,请调用它。

如果未设置,则也关闭作为默认行为的传输。

详细信息
参数
[in] aReport
要处理的 StatusReport 消息

DispatchSendAccept

WEAVE_ERROR nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchSendAccept(
  SendAccept *aSendAcceptMsg
)

如果设置了发送接受处理程序,请调用它。

详细信息
参数
[in] aSendAcceptMsg
要处理的 SendAccept 消息
返回值
错误值

DispatchXferDoneHandler

void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchXferDoneHandler(
  void
)

如果已设置 Transfer Done 处理程序,请调用它。

如果未设置,则也关闭作为默认行为的传输。

DispatchXferErrorHandler 类中的方法

void nl::Weave::Profiles::BDX_Development::BDXTransfer::DispatchXferErrorHandler(
  StatusReport *aXferError
)

如果已设置传输错误处理程序,请调用它。

如果未设置,则也关闭作为默认行为的传输。

详细信息
参数
[in] aXferError
要处理的错误的状态报告

GetDefaultFlags

uint16_t nl::Weave::Profiles::BDX_Development::BDXTransfer::GetDefaultFlags(
  bool aExpectResponse
)

此函数会返回随消息一起发送的默认标志。

详细信息
参数
[in] aExpectResponse
如果我们预计收到此邮件
返回值
要发送的标志

异步

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.

关闭时调用。

SetHandler

void nl::Weave::Profiles::BDX_Development::BDXTransfer::SetHandlers(
  BDXHandlers aHandlers
)

此函数设置此 BDXTransfer 对象的处理程序。

您应该始终使用此方法,而不是尝试手动设置它们,因为处理程序函数指针的存储方式并非公共 API 的一部分。

详细信息
参数
[in] aHandlers
要调用的回调处理程序的结构

关机

void nl::Weave::Profiles::BDX_Development::BDXTransfer::Shutdown(
  void
)

 Shuts down the current transfer, including closing any open ExchangeContext.

借此机会释放与该转移作业和应用逻辑关联的所有资源。

如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。Thread 是 Thread Group, Inc. 的注册商标。

最后更新时间 (UTC):2018-06-05。