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

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

這個結構包含代表有效 BDX 移轉作業的資料成員。

摘要

BdxProtocol 使用這些物件來維持通訊協定狀態。這些記錄由 BdxServer 管理,這類伺服器會處理建立及初始化新移轉作業,包括管理 Connections 和 ExchangeContext。

公開屬性

mAmInitiator
bool
mAmSender
bool
mAppState
void *
mBlockCounter
uint32_t
轉移作業正式開始後,我們預期在傳送時會收到的 BlockQuery 或 BlockACK 號碼。
mBytesSent
uint64_t
mExchangeContext
mFileDesignator
檔案/封鎖相關資料成員待辦事項:要移除這件事嗎?還是我們應該只訂立此字串可能樣式及使用方式的合約?具體來說,它是否受 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
如果放置區塊處理常式已設定,請呼叫該處理常式。
DispatchReceiveAccept(ReceiveAccept *aReceiveAcceptMsg)
調度工具只要檢查處理常式是否已設定完成,然後在存在時呼叫處理常式即可。
DispatchRejectHandler(StatusReport *aReport)
void
如果已設定拒絕處理常式,請呼叫該處理常式。
DispatchSendAccept(SendAccept *aSendAcceptMsg)
如果已設定 send Accept 處理常式,請呼叫該處理常式。
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

檔案/封鎖相關資料成員待辦事項:要移除這件事嗎?還是我們應該只訂立此字串可能樣式及使用方式的合約?具體來說,它是否受 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
)

如果已設定錯誤處理常式,請呼叫該處理常式。

如果未設定,系統也會以預設行為關閉傳輸。

詳細說明
參數
[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
如果這是傳輸過程中的最後一個區塊,則為「是」

DispatchPutBlockHandler

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

如果放置區塊處理常式已設定,請呼叫該處理常式。

詳細說明
參數
[in] aLength
模塊長度
[in] aDataBlock
資料區塊指標
[in] aLastBlock
如果這是傳輸過程中的最後一個區塊,則為「是」

DispatchReceiveAccept

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

調度工具只要檢查處理常式是否已設定完成,然後在存在時呼叫處理常式即可。

如果已設定接收處理常式,請呼叫該處理常式。

因此,這些應做為呼叫回呼的公用介面,而不應由外部應用程式直接聯絡。BDXTransfer 的未來修訂版本可能會使用委派物件,而不是將個別指標儲存至每個回呼。

詳細說明
參數
[in] aReceiveAcceptMsg
ReceiveAccept 訊息需要處理
傳回
錯誤值

DispatchRejectHandler

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
)

如果已設定 send Accept 處理常式,請呼叫該處理常式。

詳細說明
參數
[in] aSendAcceptMsg
SendAccept 訊息需要進行處理
傳回
錯誤值

DispatchXferDoneHandler

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

如果已設定移轉完成的處理常式,請呼叫該處理常式。

如果未設定,系統也會以預設行為關閉傳輸。

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
如果我們預期收到這則訊息的回覆
傳回
要傳送的旗標

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 的一部分。

詳細說明
參數
[in] aHandlers
要呼叫的回呼處理常式結構

關機

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

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

請利用這個機會,釋放與這項轉移作業相關聯的任何資源,和應用程式邏輯。