nl::Weave::WeaveServerBase

#include <src/lib/core/WeaveServerBase.h>

用來實作 Weave 設定檔 (伺服器) 的常見基礎物件,該物件會封裝已驗證的要求與傳送狀態報告,並提供布料狀態和交換管理員適用的通用資料成員儲存空間。

摘要

繼承

直接已知的子類別:
  nl::Weave::Profiles::DeviceControl::DeviceControlServer
  nl::Weave::Profiles::DeviceDescription::DeviceDescriptionServer
  nl::Weave::Profiles::Echo_Next::WeaveEchoServer
  nl::Weave::Profiles::FabricProvisioning::FabricProvisioningServer
  nl::Weave::Profiles::Heartbeat::WeaveHeartbeatReceiver
  nl::Weave::Profiles::NetworkProvisioning::NetworkProvisioningServer
  nl::Weave::Profiles::ServiceProvisioning::ServiceProvisioningServer
  nl::Weave::Profiles::TokenPairing::TokenPairingServer
  nl::Weave::Profiles::Vendor::Nestlabs::DropcamLegacyPairing::DropcamLegacyPairingServer
  nl::Weave::Profiles::WeaveEchoServer

公開屬性

ExchangeMgr
[唯讀] Exchange 管理員物件
FabricState
[唯讀] 布料狀態物件

公開的靜態函式

SendStatusReport(ExchangeContext *ec, uint32_t statusProfileId, uint16_t statusCode, WEAVE_ERROR sysError)
將含有預設訊息旗標的 Weave 狀態報告傳送給指定廣告交易平台,其中包含指定設定檔中的狀態碼和系統錯誤中的發起人。
SendStatusReport(ExchangeContext *ec, uint32_t statusProfileId, uint16_t statusCode, WEAVE_ERROR sysError, uint16_t sendFlags)
將含有指定訊息旗標的 Weave 狀態報告傳送給指定廣告交易平台,其中包含指定設定檔中的狀態碼和系統錯誤。

受保護的函式

EnforceAccessControl(ExchangeContext *ec, uint32_t msgProfileId, uint8_t msgType, const WeaveMessageInfo *msgInfo, WeaveServerDelegateBase *delegate)
bool
判斷是否應接受或捨棄傳送至 Weave 伺服器的傳入要求訊息。
WeaveServerBase(void)

公開屬性

ExchangeMgr

WeaveExchangeManager * ExchangeMgr

[唯讀] Exchange 管理員物件

FabricState

WeaveFabricState * FabricState

[唯讀] 布料狀態物件

公開的靜態函式

SendStatusReport

WEAVE_ERROR SendStatusReport(
  ExchangeContext *ec,
  uint32_t statusProfileId,
  uint16_t statusCode,
  WEAVE_ERROR sysError
)

將含有預設訊息旗標的 Weave 狀態報告傳送給指定廣告交易平台,其中包含指定設定檔中的狀態碼和系統錯誤中的發起人。

詳細資料
參數
[in] ec
指向交換結構定義的指標,用於傳送狀態報表。
[in] statusProfileId
指定狀態碼的設定檔。
[in] statusCode
要傳送的狀態碼。
[in] sysError
與狀態碼相關的系統錯誤。

SendStatusReport

WEAVE_ERROR SendStatusReport(
  ExchangeContext *ec,
  uint32_t statusProfileId,
  uint16_t statusCode,
  WEAVE_ERROR sysError,
  uint16_t sendFlags
)

將含有指定訊息旗標的 Weave 狀態報告傳送給指定廣告交易平台,其中包含指定設定檔中的狀態碼和系統錯誤。

詳細資料
參數
[in] ec
指向交換結構定義的指標,用於傳送狀態報表。
[in] statusProfileId
指定狀態碼的設定檔。
[in] statusCode
要傳送的狀態碼。
[in] sysError
與狀態碼相關的系統錯誤。
[in] sendFlags
應用程式為要傳送的 Weave 狀態報告而設定的旗標。

受保護的函式

EnforceAccessControl

bool EnforceAccessControl(
  ExchangeContext *ec,
  uint32_t msgProfileId,
  uint8_t msgType,
  const WeaveMessageInfo *msgInfo,
  WeaveServerDelegateBase *delegate
)

判斷是否應接受或捨棄傳送至 Weave 伺服器的傳入要求訊息。

此方法供 Weave 伺服器使用,以便為傳入的要求訊息實作可擴充的存取控制政策。仰賴委派物件的伺服器實作應在訊息處理前盡早呼叫這個方法,以確定是否應繼續處理郵件。

這個方法會在提供的委派代表上呼叫虛擬 WeaveServerDelegateBase::EnforceAccessControl() 方法,評估郵件的存取權控管政策。Weave 伺服器委派類別,以及衍生自標準伺服器類別的應用程式特定委派,都應覆寫虛擬方法,以強制執行特定的存取權控管政策。

詳細資料
參數
[in] ec
接收訊息的 ExchangeContext
[in] msgProfileId
接收訊息的個人資料 ID。
[in] msgType
接收訊息的訊息類型。
[in] msgInfo
包含已接收訊息相關資訊的 WeaveMessageInfo 結構。
[in] delegate
應用程式提供的委派物件,可用於覆寫預設訊息存取控制政策。
傳回值
true
是否應正常接受並處理訊息。
false
如果系統應停止處理訊息,並應捨棄該訊息,則訊息會遭到捨棄。

WeaveServerBase

 WeaveServerBase(
  void
)