一般
這個模組含有所有 Thread 角色的函式。
摘要
「網路資料發布者」提供一項機制,用於監控「網路網路資料」中類似服務與/或前置字串 (包含網格前置字串或外部路徑) 的項目數量,藉此監控網路資料並決定是否要新增或移除項目。
你必須啟用 OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE
,才能使用這個模組中的所有函式。
Typedefs |
|
---|---|
otBorderRouterConfig
|
typedefstruct otBorderRouterConfig
這個結構代表的是邊界路由器設定。 |
otDetachGracefullyCallback)(void *aContext)
|
typedefvoid(*
這個回呼會通知應用程式,卸離程序已完成。 |
otExternalRouteConfig
|
typedefstruct otExternalRouteConfig
這個結構代表外部路徑設定。 |
otIpCounters
|
typedefstruct otIpCounters
這個結構代表 IP 層級的計數器。 |
otLeaderData
|
typedefstruct otLeaderData
這個結構代表「執行緒領導者資料」。 |
otLinkModeConfig
|
typedefstruct otLinkModeConfig
這個結構代表 MLE 連結模式設定。 |
otMleCounters
|
typedefstruct otMleCounters
此結構代表 Thread MLE 計數器。 |
otNeighborInfoIterator
|
typedefint16_t
用於疊代鄰居資料表。 |
otNetDataDnsSrpServicePublisherCallback)(otNetDataPublisherEvent aEvent, void *aContext)
|
typedefvoid(*
這個函式指標類型會定義在「DNS/SRP 服務」時要傳送通知的回呼,該執行緒會新增至執行緒網路資料中。 |
otNetDataPrefixPublisherCallback)(otNetDataPublisherEvent aEvent, const otIp6Prefix *aPrefix, void *aContext)
|
typedefvoid(*
這個函式指標類型會定義在執行緒網路資料中新增或移除前置字串 (網格或外部路徑) 項目時,用於通知的回呼。 |
otNetDataPublisherEvent
|
typedef 這個列舉代表來自發布商回呼的事件。 |
otNetworkDataIterator
|
typedefuint32_t
用於疊代網路資料資訊。 |
otNetworkDiagChildEntry
|
typedefstruct otNetworkDiagChildEntry
這個結構代表「網路診斷子資料表項目」。 |
otNetworkDiagConnectivity
|
typedefstruct otNetworkDiagConnectivity
這個結構代表「網路診斷連線」值。 |
otNetworkDiagIterator
|
typedefuint16_t
用於透過網路診斷 TLV 進行疊代。 |
otNetworkDiagMacCounters
|
typedefstruct otNetworkDiagMacCounters
這個結構代表「網路診斷 Mac 計數器」值。 |
otNetworkDiagRoute
|
typedefstruct otNetworkDiagRoute
這個結構代表網路診斷路徑 TLV 值。 |
otNetworkDiagRouteData
|
typedefstruct otNetworkDiagRouteData
這個結構代表「網路診斷路徑」資料, |
otNetworkDiagTlv
|
typedefstruct otNetworkDiagTlv
這個結構代表網路診斷 TLV。 |
otReceiveDiagnosticGetCallback)(otError aError, otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext)
|
typedefvoid(*
收到網路診斷 Get 回應時,會呼叫此函式指標。 |
otRoutePreference
|
typedefenum otRoutePreference
|
otServerConfig
|
typedefstruct otServerConfig
這個結構代表伺服器設定。 |
otServiceConfig
|
typedefstruct otServiceConfig
這個結構代表服務設定。 |
otThreadAnycastLocatorCallback)(void *aContext, otError aError, const otIp6Address *aMeshLocalAddress, uint16_t aRloc16)
|
typedefvoid(*
這個函式指標類型會定義要通知 otThreadLocateAnycastDestination() 要求結果的回呼。 |
otThreadDiscoveryRequestCallback)(const otThreadDiscoveryRequestInfo *aInfo, void *aContext)
|
typedefvoid(*
每次接收 MLE 探索要求訊息時都會呼叫此函式指標。 |
otThreadDiscoveryRequestInfo
|
typedefstruct otThreadDiscoveryRequestInfo
這個結構代表 Thread Discovery 要求資料。 |
otThreadParentResponseCallback)(otThreadParentResponseInfo *aInfo, void *aContext)
|
typedefvoid(*
每次收到 MLE 父項回應訊息時,系統都會呼叫此函式指標。 |
otThreadParentResponseInfo
|
typedefstruct otThreadParentResponseInfo
這個結構代表 MLE 父項回應資料。 |
Functions |
|
---|---|
otNetDataContainsOmrPrefix(otInstance *aInstance, const otIp6Prefix *aPrefix)
|
bool
這個函式會檢查特定前置字串是否可做為有效的 OMR 前置字串,且領導者和網路資料含有這個前置字串。
|
otNetDataGet(otInstance *aInstance, bool aStable, uint8_t *aData, uint8_t *aDataLength)
|
此方法提供完整或穩定的「分區網路執行緒資料」副本。
|
otNetDataGetNextOnMeshPrefix(otInstance *aInstance, otNetworkDataIterator *aIterator, otBorderRouterConfig *aConfig)
|
這個函式會在分區和網路資料中取得下一個網格網格前置字串。
|
otNetDataGetNextRoute(otInstance *aInstance, otNetworkDataIterator *aIterator, otExternalRouteConfig *aConfig)
|
這個函式會取得分區「網路資料」中的下一個外部路徑。
|
otNetDataGetNextService(otInstance *aInstance, otNetworkDataIterator *aIterator, otServiceConfig *aConfig)
|
此函式會取得分區「網路資料」中的下一個服務。
|
otNetDataGetStableVersion(otInstance *aInstance)
|
uint8_t
取得穩定網路資料版本。
|
otNetDataGetVersion(otInstance *aInstance)
|
uint8_t
取得網路資料版本。
|
otNetDataIsDnsSrpServiceAdded(otInstance *aInstance)
|
bool
這個函式代表目前是否將「DNS/SRP 服務」項目新增至執行緒網路資料。
|
otNetDataIsPrefixAdded(otInstance *aInstance, const otIp6Prefix *aPrefix)
|
bool
這個函式會指明目前執行緒的已發布前置字串項目 (網格或外部路徑) 是否已新增至執行緒網路資料。
|
otNetDataPublishDnsSrpServiceAnycast(otInstance *aInstance, uint8_t aSequenceNUmber)
|
void
這項函式要求「DNS/SRP 服務 Anycast 地址」並發布至 Thread 網路資料。
|
otNetDataPublishDnsSrpServiceUnicast(otInstance *aInstance, const otIp6Address *aAddress, uint16_t aPort)
|
void
這項函式要求「DNS/SRP 服務 Unicast 位址」並發布至 Thread 網路資料。
|
otNetDataPublishDnsSrpServiceUnicastMeshLocalEid(otInstance *aInstance, uint16_t aPort)
|
void
這項函式要求「DNS/SRP 服務 Unicast 位址」並發布至 Thread 網路資料。
|
otNetDataPublishExternalRoute(otInstance *aInstance, const otExternalRouteConfig *aConfig)
|
這個函式要求在執行緒網路資料中發布外部路徑前置字串。
|
otNetDataPublishOnMeshPrefix(otInstance *aInstance, const otBorderRouterConfig *aConfig)
|
這個函式要求在網格執行緒資料中發布網格網格的發布內容。
|
otNetDataSetDnsSrpServicePublisherCallback(otInstance *aInstance, otNetDataDnsSrpServicePublisherCallback aCallback, void *aContext)
|
void
這個函式會設定回呼,以便在已發布的「DNS/SRP 服務」時接收通知,也就是實際從「執行緒網路資料」中移除或移除。
|
otNetDataSetPrefixPublisherCallback(otInstance *aInstance, otNetDataPrefixPublisherCallback aCallback, void *aContext)
|
void
這個函式會設定一個回呼,用於在已發布的前置字串項目從執行緒網路資料中新增或移除時接收通知。
|
otNetDataSteeringDataCheckJoiner(otInstance *aInstance, const otExtAddress *aEui64)
|
檢查轉向資料是否包含彙整器。
|
otNetDataSteeringDataCheckJoinerWithDiscerner(otInstance *aInstance, const struct otJoinerDiscerner *aDiscerner)
|
檢查轉向資料是否包含具有指定差異值的彙整者。
|
otNetDataUnpublishDnsSrpService(otInstance *aInstance)
|
void
從 Thread Network Data 中取消發布先前新增的 DNS/SRP (Anycast 或 Unicast) 服務項目。
|
otNetDataUnpublishPrefix(otInstance *aInstance, const otIp6Prefix *aPrefix)
|
取消發布先前發布的網格或外部路徑前置字串。
|
otThreadBecomeChild(otInstance *aInstance)
|
嘗試以子項重新附加。
|
otThreadBecomeDetached(otInstance *aInstance)
|
從執行緒網路卸離。
|
otThreadDetachGracefully(otInstance *aInstance, otDetachGracefullyCallback aCallback, void *aContext)
|
這個函式會通知網路中的其他節點 (如果有的話),並停止 Thread 通訊協定作業。
|
otThreadDeviceRoleToString(otDeviceRole aRole)
|
const char *
將裝置角色轉換為使用者可理解的字串。
|
otThreadDiscover(otInstance *aInstance, uint32_t aScanChannels, uint16_t aPanId, bool aJoiner, bool aEnableEui64Filtering, otHandleActiveScanResult aCallback, void *aCallbackContext)
|
這個函式會啟動執行緒探索掃描作業。
|
otThreadGetChildTimeout(otInstance *aInstance)
|
uint32_t
取得在子項角色中執行的執行緒子項逾時 (以秒為單位)。
|
otThreadGetDeviceRole(otInstance *aInstance)
|
取得裝置角色。
|
otThreadGetDomainName(otInstance *aInstance)
|
const char *
取得執行緒網域名稱。
|
otThreadGetExtendedPanId(otInstance *aInstance)
|
const otExtendedPanId *
取得 IEEE 802.15.4 Extended PAN ID。
|
otThreadGetFixedDuaInterfaceIdentifier(otInstance *aInstance)
|
const otIp6InterfaceIdentifier *
為執行緒網域單點位址手動指定介面 ID。
|
otThreadGetIp6Counters(otInstance *aInstance)
|
const otIpCounters *
取得 IPv6 計數器。
|
otThreadGetKeySequenceCounter(otInstance *aInstance)
|
uint32_t
取得 thrKeySequenceCounter。
|
otThreadGetKeySwitchGuardTime(otInstance *aInstance)
|
uint32_t
取得 thrKeySwitchGuardTime (以小時為單位)。
|
otThreadGetLeaderData(otInstance *aInstance, otLeaderData *aLeaderData)
|
這個函式會取得執行緒執行緒資料。
|
otThreadGetLeaderRloc(otInstance *aInstance, otIp6Address *aLeaderRloc)
|
這個函式會傳回指向領導品牌的 RLOC 的指標。
|
otThreadGetLeaderRouterId(otInstance *aInstance)
|
uint8_t
取得領先者的路由器 ID。
|
otThreadGetLeaderWeight(otInstance *aInstance)
|
uint8_t
取得領先者的體重。
|
otThreadGetLinkLocalAllThreadNodesMulticastAddress(otInstance *aInstance)
|
const otIp6Address *
取得執行緒連結本機所有執行緒節點多點位址。
|
otThreadGetLinkLocalIp6Address(otInstance *aInstance)
|
const otIp6Address *
取得執行緒連結本機 IPv6 位址。
|
otThreadGetLinkMode(otInstance *aInstance)
|
取得 MLE 連結模式設定。
|
otThreadGetMeshLocalEid(otInstance *aInstance)
|
const otIp6Address *
取得網格本機 EID 位址。
|
otThreadGetMeshLocalPrefix(otInstance *aInstance)
|
const otMeshLocalPrefix *
這個函式會傳回指向網格本機前置字串的指標。
|
otThreadGetMleCounters(otInstance *aInstance)
|
const otMleCounters *
取得執行緒 MLE 計數器。
|
otThreadGetNetworkKey(otInstance *aInstance, otNetworkKey *aNetworkKey)
|
void
取得執行緒網路金鑰。
|
otThreadGetNetworkKeyRef(otInstance *aInstance)
|
取得執行緒網路金鑰的
otNetworkKeyRef 。 |
otThreadGetNetworkName(otInstance *aInstance)
|
const char *
取得執行緒網路名稱。
|
otThreadGetNextDiagnosticTlv(const otMessage *aMessage, otNetworkDiagIterator *aIterator, otNetworkDiagTlv *aNetworkDiagTlv)
|
這個函式會在訊息中接收下一個網路診斷 TLV。
|
otThreadGetNextNeighborInfo(otInstance *aInstance, otNeighborInfoIterator *aIterator, otNeighborInfo *aInfo)
|
此函式會取得下一個相鄰資訊。
|
otThreadGetParentAverageRssi(otInstance *aInstance, int8_t *aParentRssi)
|
這個函式會擷取執行緒父項的平均 RSSI。
|
otThreadGetParentInfo(otInstance *aInstance, otRouterInfo *aParentInfo)
|
函式會擷取執行緒路由器的診斷資訊做為父項。
|
otThreadGetParentLastRssi(otInstance *aInstance, int8_t *aLastRssi)
|
這個函式會從「執行緒父項」擷取最後一個封包的 RSSI。
|
otThreadGetPartitionId(otInstance *aInstance)
|
uint32_t
取得分區 ID。
|
otThreadGetRealmLocalAllThreadNodesMulticastAddress(otInstance *aInstance)
|
const otIp6Address *
取得 Thread Realm-Local 所有執行緒節點多播位址。
|
otThreadGetRloc(otInstance *aInstance)
|
const otIp6Address *
取得執行緒轉送定位器 (RLOC) 位址。
|
otThreadGetRloc16(otInstance *aInstance)
|
uint16_t
取得 RLOC16。
|
otThreadGetServiceAloc(otInstance *aInstance, uint8_t aServiceId, otIp6Address *aServiceAloc)
|
這個函式會擷取特定服務 ID 的 Service ALOC。
|
otThreadGetVersion(void)
|
uint16_t
這個函式會取得 Thread 通訊協定版本。
|
otThreadIsAnycastLocateInProgress(otInstance *aInstance)
|
bool
這個函式會指出是否正在處理 Anycast 定位要求。
|
otThreadIsDiscoverInProgress(otInstance *aInstance)
|
bool
這個函式可判斷 MLE Thread Discovery 目前正在進行中。
|
otThreadIsSingleton(otInstance *aInstance)
|
bool
這個函式會指出節點是否為網路的唯一路由器。
|
otThreadLocateAnycastDestination(otInstance *aInstance, const otIp6Address *aAnycastAddress, otThreadAnycastLocatorCallback aCallback, void *aContext)
|
這個函式會要求特定 Anycast 位址的最接近目的地。
|
otThreadRegisterParentResponseCallback(otInstance *aInstance, otThreadParentResponseCallback aCallback, void *aContext)
|
void
這個函式會註冊回呼,用於接收 MLE 上層回應資料。
|
otThreadResetIp6Counters(otInstance *aInstance)
|
void
重設 IPv6 計數器。
|
otThreadResetMleCounters(otInstance *aInstance)
|
void
重設 Thread MLE 計數器。
|
otThreadSearchForBetterParent(otInstance *aInstance)
|
為孩子尋找美好的家長。相關程序會在與家長的目前家長保持聯繫的同時。
|
otThreadSendAddressNotification(otInstance *aInstance, otIp6Address *aDestination, otIp6Address *aTarget, otIp6InterfaceIdentifier *aMlIid)
|
void
這個函式會傳送有效地址通知 (ADDR_NTF.ntf) 訊息。
|
otThreadSendDiagnosticGet(otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount, otReceiveDiagnosticGetCallback aCallback, void *aCallbackContext)
|
傳送網路診斷 Get 要求。
|
otThreadSendDiagnosticReset(otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount)
|
傳送網路診斷重設要求。
|
otThreadSendProactiveBackboneNotification(otInstance *aInstance, otIp6Address *aTarget, otIp6InterfaceIdentifier *aMlIid, uint32_t aTimeSinceLastTransaction)
|
這個函式會在 Backbone 連結上傳送主動式中樞通知 (PRO_BB.ntf) 訊息。
|
otThreadSetChildTimeout(otInstance *aInstance, uint32_t aTimeout)
|
void
設定在子項角色中執行的執行緒子項逾時 (以秒為單位)。
|
otThreadSetDiscoveryRequestCallback(otInstance *aInstance, otThreadDiscoveryRequestCallback aCallback, void *aContext)
|
void
這個函式會設定回呼,以接收 MLE 探索要求資料。
|
otThreadSetDomainName(otInstance *aInstance, const char *aDomainName)
|
設定執行緒網域名稱。
|
otThreadSetEnabled(otInstance *aInstance, bool aEnabled)
|
這個函式會啟動 Thread 通訊協定作業。
|
otThreadSetExtendedPanId(otInstance *aInstance, const otExtendedPanId *aExtendedPanId)
|
設定 IEEE 802.15.4 Extended PAN ID。
|
otThreadSetFixedDuaInterfaceIdentifier(otInstance *aInstance, const otIp6InterfaceIdentifier *aIid)
|
設定或清除針對 Thread Domain Unicast 位址指定的介面 ID。
|
otThreadSetJoinerAdvertisement(otInstance *aInstance, uint32_t aOui, const uint8_t *aAdvData, uint8_t aAdvDataLength)
|
這個方法在探索 Thread 網路時,會設定 Thread 合併器廣告。
|
otThreadSetKeySequenceCounter(otInstance *aInstance, uint32_t aKeySequenceCounter)
|
void
設定 thrKeySequenceCounter。
|
otThreadSetKeySwitchGuardTime(otInstance *aInstance, uint32_t aKeySwitchGuardTime)
|
void
設定 thrKeySwitchGuardTime (以小時為單位)。
|
otThreadSetLinkMode(otInstance *aInstance, otLinkModeConfig aConfig)
|
設定 MLE 連結模式設定。
|
otThreadSetMeshLocalPrefix(otInstance *aInstance, const otMeshLocalPrefix *aMeshLocalPrefix)
|
這個函式會設定網格本機前置字串。
|
otThreadSetNetworkKey(otInstance *aInstance, const otNetworkKey *aKey)
|
設定執行緒網路金鑰。
|
otThreadSetNetworkKeyRef(otInstance *aInstance, otNetworkKeyRef aKeyRef)
|
將執行緒網路金鑰設為
otNetworkKeyRef 。 |
otThreadSetNetworkName(otInstance *aInstance, const char *aNetworkName)
|
設定執行緒網路名稱。
|
結構 |
|
---|---|
otBorderRouterConfig |
這個結構代表的是邊界路由器設定。 |
otExternalRouteConfig |
這個結構代表外部路徑設定。 |
otIpCounters |
這個結構代表 IP 層級的計數器。 |
otLeaderData |
這個結構代表「執行緒領導者資料」。 |
otLinkModeConfig |
這個結構代表 MLE 連結模式設定。 |
otMleCounters |
此結構代表 Thread MLE 計數器。 |
otNeighborInfo |
這個結構會保留相鄰 Thread 節點的診斷資訊。 |
otNetworkDiagChildEntry |
這個結構代表「網路診斷子資料表項目」。 |
otNetworkDiagConnectivity |
這個結構代表「網路診斷連線」值。 |
otNetworkDiagMacCounters |
這個結構代表「網路診斷 Mac 計數器」值。 |
otNetworkDiagRoute |
這個結構代表網路診斷路徑 TLV 值。 |
otNetworkDiagRouteData |
這個結構代表「網路診斷路徑」資料, |
otNetworkDiagTlv |
這個結構代表網路診斷 TLV。 |
otRouterInfo |
這個結構會保留執行緒路由器的診斷資訊。 |
otServerConfig |
這個結構代表伺服器設定。 |
otServiceConfig |
這個結構代表服務設定。 |
otThreadDiscoveryRequestInfo |
這個結構代表 Thread Discovery 要求資料。 |
otThreadParentResponseInfo |
這個結構代表 MLE 父項回應資料。 |
列舉
匿名列舉
anonymous enum
屬性 | |
---|---|
OT_NETWORK_DIAGNOSTIC_TLV_BATTERY_LEVEL
|
電池電量 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_CHANNEL_PAGES
|
頻道頁面 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_CHILD_TABLE
|
子項資料表 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_CONNECTIVITY
|
連線 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_EXT_ADDRESS
|
MAC 擴充位址 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_IP6_ADDR_LIST
|
IPv6 位址清單 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_LEADER_DATA
|
領先者資料 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_MAC_COUNTERS
|
MAC 計數器 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_MAX_CHILD_TIMEOUT
|
子項逾時上限 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_MODE
|
模式 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_NETWORK_DATA
|
網路資料 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_ROUTE
|
Route64 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_SHORT_ADDRESS
|
地址 16 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_SUPPLY_VOLTAGE
|
提供電壓 TLV。 |
OT_NETWORK_DIAGNOSTIC_TLV_TIMEOUT
|
逾時 TLV (SED 的輪詢時間範圍上限) |
OT_NETWORK_DIAGNOSTIC_TLV_TYPE_LIST
|
輸入清單 TLV。 |
otDeviceRole
otDeviceRole
代表 Thread 裝置角色。
屬性 | |
---|---|
OT_DEVICE_ROLE_CHILD
|
「執行緒子項」角色。 |
OT_DEVICE_ROLE_DETACHED
|
目前尚未參與 Thread 網路/分區。 |
OT_DEVICE_ROLE_DISABLED
|
執行緒堆疊已停用。 |
OT_DEVICE_ROLE_LEADER
|
「執行緒負責人」角色。 |
OT_DEVICE_ROLE_ROUTER
|
執行緒路由器角色。 |
otNetDataPublisherEvent
otNetDataPublisherEvent
這個列舉代表來自發布商回呼的事件。
屬性 | |
---|---|
OT_NETDATA_PUBLISHER_EVENT_ENTRY_ADDED
|
已發布的項目會新增至執行緒網路資料。 |
OT_NETDATA_PUBLISHER_EVENT_ENTRY_REMOVED
|
已發布的項目會從 Thread 網路資料中移除。 |
OTRoutePreference
otRoutePreference
定義 otExternalRouteConfig
和 otBorderRouterConfig
中 mPreference
的有效值。
屬性 | |
---|---|
OT_ROUTE_PREFERENCE_HIGH
|
高路徑偏好設定。 |
OT_ROUTE_PREFERENCE_LOW
|
低路徑偏好設定。 |
OT_ROUTE_PREFERENCE_MED
|
中等路徑偏好設定。 |
Typedefs
OTDetachGracefullyCallback
void(* otDetachGracefullyCallback)(void *aContext)
這個回呼會通知應用程式,卸離程序已完成。
詳細資料 | |||
---|---|---|---|
參數 |
|
otNeighborInfoIterator
int16_t otNeighborInfoIterator
用於疊代鄰居資料表。
otNetDataDnsSrpServicePublisherCallback
void(* otNetDataDnsSrpServicePublisherCallback)(otNetDataPublisherEvent aEvent, void *aContext)
這個函式指標類型會定義在「DNS/SRP 服務」時要傳送通知的回呼,該執行緒會新增至執行緒網路資料中。
移除時,不論是否由 Publisher
移除項目 (例如「網路資料」中已有太多類似的項目),或者透過明確取消發布項目的明確呼叫 (例如對 otNetDataUnpublishDnsSrpService()
的呼叫),來叫用回呼。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
otNetDataPrefixPublisherCallback
void(* otNetDataPrefixPublisherCallback)(otNetDataPublisherEvent aEvent, const otIp6Prefix *aPrefix, void *aContext)
這個函式指標類型會定義在執行緒網路資料中新增或移除前置字串 (網格或外部路徑) 項目時,用於通知的回呼。
移除時,不論是否由 Publisher
移除項目 (例如「網路資料」中已有太多類似的項目),或者透過明確取消發布該項目,都會叫用回呼。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otNetworkDataIterator
uint32_t otNetworkDataIterator
用於疊代網路資料資訊。
otNetworkDiagConnectivity
struct otNetworkDiagConnectivity otNetworkDiagConnectivity
這個結構代表「網路診斷連線」值。
otNetworkDiagIterator
uint16_t otNetworkDiagIterator
用於透過網路診斷 TLV 進行疊代。
OTNetworkDiagMac 計數器
struct otNetworkDiagMacCounters otNetworkDiagMacCounters
這個結構代表「網路診斷 Mac 計數器」值。
如要瞭解成員欄位的定義,請參閱 RFC 2863。
otReceiveDiagnosticGetCallback
void(* otReceiveDiagnosticGetCallback)(otError aError, otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext)
收到網路診斷 Get 回應時,會呼叫此函式指標。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
OTRoutePreference
enum otRoutePreference otRoutePreference
定義 otExternalRouteConfig
和 otBorderRouterConfig
中 mPreference
的有效值。
otThreadAnycastLocatorCallback
void(* otThreadAnycastLocatorCallback)(void *aContext, otError aError, const otIp6Address *aMeshLocalAddress, uint16_t aRloc16)
這個函式指標類型會定義要通知 otThreadLocateAnycastDestination()
要求結果的回呼。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
otThreadDiscoveryRequestCallback
void(* otThreadDiscoveryRequestCallback)(const otThreadDiscoveryRequestInfo *aInfo, void *aContext)
每次接收 MLE 探索要求訊息時都會呼叫此函式指標。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
otThreadDiscoveryRequestInfo
struct otThreadDiscoveryRequestInfo otThreadDiscoveryRequestInfo
這個結構代表 Thread Discovery 要求資料。
otThreadParentResponseCallback
void(* otThreadParentResponseCallback)(otThreadParentResponseInfo *aInfo, void *aContext)
每次收到 MLE 父項回應訊息時,系統都會呼叫此函式指標。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
otThreadParentResponseInfo
struct otThreadParentResponseInfo otThreadParentResponseInfo
這個結構代表 MLE 父項回應資料。
Functions
otNetDataContainsOmrPrefix
bool otNetDataContainsOmrPrefix( otInstance *aInstance, const otIp6Prefix *aPrefix )
這個函式會檢查特定前置字串是否可做為有效的 OMR 前置字串,且領導者和網路資料含有這個前置字串。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回 |
aPrefix 是否為有效的 OMR 前置字串,且龍頭網路資料含有 OMR 前置字串 aPrefix 。 |
otNetDataGet
otError otNetDataGet( otInstance *aInstance, bool aStable, uint8_t *aData, uint8_t *aDataLength )
此方法提供完整或穩定的「分區網路執行緒資料」副本。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
otNetDataGetNextOnMeshPrefix
otError otNetDataGetNextOnMeshPrefix( otInstance *aInstance, otNetworkDataIterator *aIterator, otBorderRouterConfig *aConfig )
這個函式會在分區和網路資料中取得下一個網格網格前置字串。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otNetDataGetNextRoute
otError otNetDataGetNextRoute( otInstance *aInstance, otNetworkDataIterator *aIterator, otExternalRouteConfig *aConfig )
這個函式會取得分區「網路資料」中的下一個外部路徑。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otNetDataGetNextService
otError otNetDataGetNextService( otInstance *aInstance, otNetworkDataIterator *aIterator, otServiceConfig *aConfig )
此函式會取得分區「網路資料」中的下一個服務。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otNetDataGetStableVersion
uint8_t otNetDataGetStableVersion( otInstance *aInstance )
取得穩定網路資料版本。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
穩定網路資料版本。
|
otNetDataGetVersion
uint8_t otNetDataGetVersion( otInstance *aInstance )
取得網路資料版本。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
網路資料版本。
|
otNetDataIsDnsSrpService 已新增
bool otNetDataIsDnsSrpServiceAdded( otInstance *aInstance )
這個函式代表目前是否將「DNS/SRP 服務」項目新增至執行緒網路資料。
您必須啟用 OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
功能,才能使用這項功能。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
加入 otNetDataIsPrefix
bool otNetDataIsPrefixAdded( otInstance *aInstance, const otIp6Prefix *aPrefix )
這個函式會指明目前執行緒的已發布前置字串項目 (網格或外部路徑) 是否已新增至執行緒網路資料。
您必須啟用 OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE
功能,才能使用這項功能。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otNetDataPublishDnsSrpServiceAnycast
void otNetDataPublishDnsSrpServiceAnycast( otInstance *aInstance, uint8_t aSequenceNUmber )
這項函式要求「DNS/SRP 服務 Anycast 地址」並發布至 Thread 網路資料。
您必須啟用 OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
功能,才能使用這項功能。
呼叫此函式會移除並取代任何先前發布的「DNS/SRP 服務」項目 (從先前的呼叫到任何 otNetDataPublishDnsSrpService{Type}()
函式)。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
otNetDataPublishDnsSrpServiceUnicast
void otNetDataPublishDnsSrpServiceUnicast( otInstance *aInstance, const otIp6Address *aAddress, uint16_t aPort )
這項函式要求「DNS/SRP 服務 Unicast 位址」並發布至 Thread 網路資料。
您必須啟用 OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
功能,才能使用這項功能。
呼叫此函式會移除並取代任何先前發布的「DNS/SRP 服務」項目 (從先前的呼叫到任何 otNetDataPublishDnsSrpService{Type}()
函式)。
這個函式會在「服務 TLV 資料」中加入位址和通訊埠資訊,藉此發布「DNS/SRP 服務單點傳送位址」。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otNetDataPublishDnsSrpServiceUnicastMeshLocalEid
void otNetDataPublishDnsSrpServiceUnicastMeshLocalEid( otInstance *aInstance, uint16_t aPort )
這項函式要求「DNS/SRP 服務 Unicast 位址」並發布至 Thread 網路資料。
您必須啟用 OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
功能,才能使用這項功能。
呼叫此函式會移除並取代任何先前發布的「DNS/SRP 服務」項目 (從先前的呼叫到任何 otNetDataPublishDnsSrpService{Type}()
函式)。
與 otNetDataPublishDnsSrpServiceUnicast()
規定,您必須提供已發布的地址,並納入服務 TLV 資料,不過這個函式會使用裝置的網格本機 EID,並在伺服器 TLV 資料中加入這項資訊。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
otNetDataPublishExternalRoute
otError otNetDataPublishExternalRoute( otInstance *aInstance, const otExternalRouteConfig *aConfig )
這個函式要求在執行緒網路資料中發布外部路徑前置字串。
您必須啟用 OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE
功能,才能使用這項功能。
您只能發布穩定項目 (例如aConfig.mStable
必須是 TRUE)。
後續對這個方法的呼叫將取代先前相同的前置字串。具體來說,如果新的呼叫只變更旗標 (例如偏好設定等級),且「網路資料」中已加上前置字串,「變更」的內容就會立即反映在「網路資料」中。這樣可確保聯播網資料中的現有項目不會立即移除。請注意,如果變更了偏好設定的等級,即使系統判定其他節點發布了相同或較高的偏好設定的相同前置字串,也可能會造成系統從網路資料中移除該項目。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otNetDataPublishOnMeshPrefix
otError otNetDataPublishOnMeshPrefix( otInstance *aInstance, const otBorderRouterConfig *aConfig )
這個函式要求在網格執行緒資料中發布網格網格的發布內容。
您必須啟用 OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE
功能,才能使用這項功能。
您只能發布穩定項目 (例如aConfig.mStable
必須是 TRUE)。
後續對這個方法的呼叫將取代先前相同的前置字串。具體來說,如果新的呼叫只變更旗標 (例如偏好設定等級),且「網路資料」中已加上前置字串,「變更」的內容就會立即反映在「網路資料」中。這樣可確保聯播網資料中的現有項目不會立即移除。請注意,如果變更了偏好設定的等級,即使系統判定其他節點發布了相同或較高的偏好設定的相同前置字串,也可能會造成系統從網路資料中移除該項目。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otNetDataSetDnsSrpServicePublisherCallback
void otNetDataSetDnsSrpServicePublisherCallback( otInstance *aInstance, otNetDataDnsSrpServicePublisherCallback aCallback, void *aContext )
這個函式會設定回呼,以便在已發布的「DNS/SRP 服務」時接收通知,也就是實際從「執行緒網路資料」中移除或移除。
此函式的後續呼叫將取代任何先前設定的回呼函式。
您必須啟用 OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
功能,才能使用這項功能。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otNetDataSetPrefixPublisherCallback
void otNetDataSetPrefixPublisherCallback( otInstance *aInstance, otNetDataPrefixPublisherCallback aCallback, void *aContext )
這個函式會設定一個回呼,用於在已發布的前置字串項目從執行緒網路資料中新增或移除時接收通知。
此函式的後續呼叫將取代任何先前設定的回呼函式。
您必須啟用 OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE
功能,才能使用這項功能。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otNetDataSteeringDataCheck 聯合
otError otNetDataSteeringDataCheckJoiner( otInstance *aInstance, const otExtAddress *aEui64 )
檢查轉向資料是否包含彙整器。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otNetDataSteeringDataCheckJoinerWithDiscerner
otError otNetDataSteeringDataCheckJoinerWithDiscerner( otInstance *aInstance, const struct otJoinerDiscerner *aDiscerner )
檢查轉向資料是否包含具有指定差異值的彙整者。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otNetDataUnpublishDnsSrpService
void otNetDataUnpublishDnsSrpService( otInstance *aInstance )
從 Thread Network Data 中取消發布先前新增的 DNS/SRP (Anycast 或 Unicast) 服務項目。
必須啟用「OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
」。
詳細資料 | |||
---|---|---|---|
參數 |
|
otNetDataUnpublishPrefix
otError otNetDataUnpublishPrefix( otInstance *aInstance, const otIp6Prefix *aPrefix )
取消發布先前發布的網格或外部路徑前置字串。
必須啟用「OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE
」。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadMakeChild
otError otThreadBecomeChild( otInstance *aInstance )
嘗試以子項重新附加。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThread 成為 Detached
otError otThreadBecomeDetached( otInstance *aInstance )
從執行緒網路卸離。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadDetachGracely
otError otThreadDetachGracefully( otInstance *aInstance, otDetachGracefullyCallback aCallback, void *aContext )
這個函式會通知網路中的其他節點 (如果有的話),並停止 Thread 通訊協定作業。
因此,如果路由器是路由器,系統會傳送位址釋出;如果子項逾時,則會將子項逾時設為 0。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otThreadDeviceRoleToString
const char * otThreadDeviceRoleToString( otDeviceRole aRole )
將裝置角色轉換為使用者可理解的字串。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
代表
aRole 的字串。 |
OTThreadDiscover
otError otThreadDiscover( otInstance *aInstance, uint32_t aScanChannels, uint16_t aPanId, bool aJoiner, bool aEnableEui64Filtering, otHandleActiveScanResult aCallback, void *aCallbackContext )
這個函式會啟動執行緒探索掃描作業。
詳細資料 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||||
傳回值 |
|
otThreadGetChildTimeout
uint32_t otThreadGetChildTimeout( otInstance *aInstance )
取得在子項角色中執行的執行緒子項逾時 (以秒為單位)。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
執行緒子項逾時值 (以秒為單位)。
|
otThreadSetChildTimeout
otThreadGetDevice 角色
otDeviceRole otThreadGetDeviceRole( otInstance *aInstance )
取得裝置角色。
詳細資料 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||
傳回值 |
|
otThreadGetDomainName 的
const char * otThreadGetDomainName( otInstance *aInstance )
otThreadGetExtendedPanId 的形式
const otExtendedPanId * otThreadGetExtendedPanId( otInstance *aInstance )
取得 IEEE 802.15.4 Extended PAN ID。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
IEEE 802.15.4 Extended PAN ID 的指標。
|
otThreadSetExtendedPanId
otThreadGetFixedDuaInterfaceIdentifier
const otIp6InterfaceIdentifier * otThreadGetFixedDuaInterfaceIdentifier( otInstance *aInstance )
為執行緒網域單點位址手動指定介面 ID。
必須啟用 OPENTHREAD_CONFIG_DUA_ENABLE
才能使用此功能。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
手動設定的介面 ID 指標,如未設定,則指向 NULL。
|
otThreadSetFixedDuaInterfaceIdentifier
otThreadGetIp6 計數器
const otIpCounters * otThreadGetIp6Counters( otInstance *aInstance )
取得 IPv6 計數器。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向 IPv6 計數器的指標。
|
otThreadGetKeySequence 計數器
uint32_t otThreadGetKeySequenceCounter( otInstance *aInstance )
取得 thrKeySequenceCounter。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
thrKeySequenceCounter 值。
|
otThreadSetKeySequenceCounter
otThreadGetKeySwitchGuardTime
uint32_t otThreadGetKeySwitchGuardTime( otInstance *aInstance )
取得 thrKeySwitchGuardTime (以小時為單位)。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
thrKeySwitchGuardTime 值 (以小時為單位)。
|
otThreadSetKeySwitchGuardTime
otThreadGetLeaderData (otThread)
otError otThreadGetLeaderData( otInstance *aInstance, otLeaderData *aLeaderData )
這個函式會取得執行緒執行緒資料。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadGetLeaderRloc
otError otThreadGetLeaderRloc( otInstance *aInstance, otIp6Address *aLeaderRloc )
這個函式會傳回指向領導品牌的 RLOC 的指標。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otThreadGetLeaderRouterId
uint8_t otThreadGetLeaderRouterId( otInstance *aInstance )
取得領先者的路由器 ID。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
主管的路由器 ID。
|
otThreadGetLeaderWeight (otThreadGetLeaderWeight)
uint8_t otThreadGetLeaderWeight( otInstance *aInstance )
取得領先者的體重。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
領導人權重。
|
otThreadGetLinkLocalAllThreadNodesMulticastAddress
const otIp6Address * otThreadGetLinkLocalAllThreadNodesMulticastAddress( otInstance *aInstance )
取得執行緒連結本機所有執行緒節點多點位址。
這個位址是連結型區域的 Unicast Prefix 式多重傳播位址 [RFC 3306],其中包含:
- flgs 設為 3 (P = 1 且 T = 1)
- 將計時器設為 2
- plen 設為 64。
- 網路前置字串已設為網格本機前置字串
- 群組 ID 已設為 1
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向 Thread Link-Local 所有執行緒節點多播位址的指標。
|
otThreadGetLinkLocalIp6 位址
const otIp6Address * otThreadGetLinkLocalIp6Address( otInstance *aInstance )
取得執行緒連結本機 IPv6 位址。
執行緒連結本機位址是衍生自 IEEE802.15.4 Extended Address 做為介面 ID。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向執行緒連結本機 IPv6 位址的指標。
|
otThreadGetLinkMode
otLinkModeConfig otThreadGetLinkMode( otInstance *aInstance )
取得 MLE 連結模式設定。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
MLE 連結模式設定。
|
otThreadSetLinkMode
otThreadGetMeshLocalEid
const otIp6Address * otThreadGetMeshLocalEid( otInstance *aInstance )
取得網格本機 EID 位址。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向網格本機 EID 位址的指標。
|
otThreadGetMeshLocalPrefix
const otMeshLocalPrefix * otThreadGetMeshLocalPrefix( otInstance *aInstance )
這個函式會傳回指向網格本機前置字串的指標。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向網格本機前置字串的指標。
|
otThreadGetMle 計數器
const otMleCounters * otThreadGetMleCounters( otInstance *aInstance )
取得執行緒 MLE 計數器。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向 Thread MLE 計數器的指標。
|
otThreadGetNetworkKey
void otThreadGetNetworkKey( otInstance *aInstance, otNetworkKey *aNetworkKey )
取得執行緒網路金鑰。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
otThreadSetNetworkKey
otThreadGetNetworkKeyRef
otNetworkKeyRef otThreadGetNetworkKeyRef( otInstance *aInstance )
取得執行緒網路金鑰的 otNetworkKeyRef
。
您必須啟用建構時間功能 OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
,才能使用這個函式。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
儲存在記憶體中的執行緒網路金鑰參照。
|
otThreadSetNetworkKeyRef
OTThreadGetNetworkName
const char * otThreadGetNetworkName( otInstance *aInstance )
取得執行緒網路名稱。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向 Thread 網路名稱。
|
otThreadSetNetworkName
otThreadGetNextDiagnosticTlv
otError otThreadGetNextDiagnosticTlv( const otMessage *aMessage, otNetworkDiagIterator *aIterator, otNetworkDiagTlv *aNetworkDiagTlv )
這個函式會在訊息中接收下一個網路診斷 TLV。
只有在目前的傳回值是 OT_ERROR_NONE 時,才能呼叫這個函式。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otThreadGetNextNeighborInfo
otError otThreadGetNextNeighborInfo( otInstance *aInstance, otNeighborInfoIterator *aIterator, otNeighborInfo *aInfo )
此函式會取得下一個相鄰資訊。
用於瀏覽鄰近資料表的資料表項目。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otThreadGetParentAverageRssi
otError otThreadGetParentAverageRssi( otInstance *aInstance, int8_t *aParentRssi )
這個函式會擷取執行緒父項的平均 RSSI。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
OTThreadGetParentInfo
otError otThreadGetParentInfo( otInstance *aInstance, otRouterInfo *aParentInfo )
函式會擷取執行緒路由器的診斷資訊做為父項。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
otThreadGetParentLastRssi (執行緒執行緒)
otError otThreadGetParentLastRssi( otInstance *aInstance, int8_t *aLastRssi )
這個函式會從「執行緒父項」擷取最後一個封包的 RSSI。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
otThreadGetpartitionId
uint32_t otThreadGetPartitionId( otInstance *aInstance )
取得分區 ID。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
分區 ID。
|
otThreadGetRealmLocalAllThreadNodesMulticastAddress
const otIp6Address * otThreadGetRealmLocalAllThreadNodesMulticastAddress( otInstance *aInstance )
取得 Thread Realm-Local 所有執行緒節點多播位址。
這個位址是以 Realm 區域的 Unicast Prefix 為基礎的多重傳播位址 [RFC 3306],其中包含:
- flgs 設為 3 (P = 1 且 T = 1)
- 將計時器設為 3
- plen 設為 64。
- 網路前置字串已設為網格本機前置字串
- 群組 ID 已設為 1
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向 Thread Realm-Local 所有執行緒節點多播位址的指標。
|
otThreadGetRloc
const otIp6Address * otThreadGetRloc( otInstance *aInstance )
取得執行緒轉送定位器 (RLOC) 位址。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
指向執行緒轉送定位器 (RLOC) 位址的指標。
|
otThreadGetRloc16
uint16_t otThreadGetRloc16( otInstance *aInstance )
取得 RLOC16。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
RLOC16。
|
otThreadGetServiceAloc
otError otThreadGetServiceAloc( otInstance *aInstance, uint8_t aServiceId, otIp6Address *aServiceAloc )
這個函式會擷取特定服務 ID 的 Service ALOC。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
OTThreadGetVersion
uint16_t otThreadGetVersion( void )
這個函式會取得 Thread 通訊協定版本。
詳細資料 | |
---|---|
傳回 |
Thread 通訊協定版本。
|
otThreadIsAnycastLocateInProgress
bool otThreadIsAnycastLocateInProgress( otInstance *aInstance )
這個函式會指出是否正在處理 Anycast 定位要求。
您必須啟用 OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE
,才能使用此功能。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
如果目前正在進行 Anycast 定位要求,則傳回 TRUE,否則傳回 FALSE。
|
otThreadIsDiscoverInProgress
bool otThreadIsDiscoverInProgress( otInstance *aInstance )
這個函式可判斷 MLE Thread Discovery 目前正在進行中。
詳細資料 | |||
---|---|---|---|
參數 |
|
OTThread IsSingleton
bool otThreadIsSingleton( otInstance *aInstance )
這個函式會指出節點是否為網路的唯一路由器。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadLocateAnycastDestination
otError otThreadLocateAnycastDestination( otInstance *aInstance, const otIp6Address *aAnycastAddress, otThreadAnycastLocatorCallback aCallback, void *aContext )
這個函式會要求特定 Anycast 位址的最接近目的地。
您必須啟用 OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE
,才能使用此功能。
如果先前的要求仍在執行中,後續針對這個函式的呼叫將取消並取代先前的要求。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
傳回值 |
|
otThreadRegisterParentResponseCallback
void otThreadRegisterParentResponseCallback( otInstance *aInstance, otThreadParentResponseCallback aCallback, void *aContext )
這個函式會註冊回呼,用於接收 MLE 上層回應資料。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otThreadResetIp6 計數器
void otThreadResetIp6Counters( otInstance *aInstance )
重設 IPv6 計數器。
詳細資料 | |||
---|---|---|---|
參數 |
|
otThreadResetMleCounters
void otThreadResetMleCounters( otInstance *aInstance )
重設 Thread MLE 計數器。
詳細資料 | |||
---|---|---|---|
參數 |
|
otThreadSearchForBetterParent
otError otThreadSearchForBetterParent( otInstance *aInstance )
為孩子尋找美好的家長。相關程序會在與家長的目前家長保持聯繫的同時。
當裝置做為兒童連接時必須使用。
詳細資料 | |||||
---|---|---|---|---|---|
傳回值 |
|
otThreadSendAddressNotification
void otThreadSendAddressNotification( otInstance *aInstance, otIp6Address *aDestination, otIp6Address *aTarget, otIp6InterfaceIdentifier *aMlIid )
這個函式會傳送有效地址通知 (ADDR_NTF.ntf) 訊息。
您必須啟用 OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
,才能使用此功能。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
otThreadSendDiagnosticGet
otError otThreadSendDiagnosticGet( otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount, otReceiveDiagnosticGetCallback aCallback, void *aCallbackContext )
傳送網路診斷 Get 要求。
詳細資料 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||
傳回值 |
|
otThreadSendDiagnosticReset
otError otThreadSendDiagnosticReset( otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount )
傳送網路診斷重設要求。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
傳回值 |
|
otThreadSendProactiveBackboneNotification
otError otThreadSendProactiveBackboneNotification( otInstance *aInstance, otIp6Address *aTarget, otIp6InterfaceIdentifier *aMlIid, uint32_t aTimeSinceLastTransaction )
這個函式會在 Backbone 連結上傳送主動式中樞通知 (PRO_BB.ntf) 訊息。
您必須啟用 OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
,才能使用此功能。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
傳回值 |
|
otThreadSetChildTimeout
void otThreadSetChildTimeout( otInstance *aInstance, uint32_t aTimeout )
設定在子項角色中執行的執行緒子項逾時 (以秒為單位)。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
otThreadGetChildTimeout
otThreadSetDiscoveryRequestCallback
void otThreadSetDiscoveryRequestCallback( otInstance *aInstance, otThreadDiscoveryRequestCallback aCallback, void *aContext )
這個函式會設定回呼,以接收 MLE 探索要求資料。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otThreadSetDomainName
otError otThreadSetDomainName( otInstance *aInstance, const char *aDomainName )
設定執行緒網域名稱。
只有在已停用執行緒通訊協定時,才會成功。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadGetDomainName
otThreadSetEnabled
otError otThreadSetEnabled( otInstance *aInstance, bool aEnabled )
這個函式會啟動 Thread 通訊協定作業。
呼叫此函式時,介面必須一致。
如果呼叫這個函式並將 aEnabled
設為 FALSE,系統將停止由 otThreadDetachGracelies() 開始的卸離程序。系統會呼叫其回呼。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadSetExtendedPanId
otError otThreadSetExtendedPanId( otInstance *aInstance, const otExtendedPanId *aExtendedPanId )
設定 IEEE 802.15.4 Extended PAN ID。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadGetExtendedPanId
otThreadSetFixedDuaInterfaceIdentifier
otError otThreadSetFixedDuaInterfaceIdentifier( otInstance *aInstance, const otIp6InterfaceIdentifier *aIid )
設定或清除針對 Thread Domain Unicast 位址指定的介面 ID。
必須啟用 OPENTHREAD_CONFIG_DUA_ENABLE
才能使用此功能。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadGetFixedDuaInterfaceIdentifier
otThreadSetJoiner 廣告
otError otThreadSetJoinerAdvertisement( otInstance *aInstance, uint32_t aOui, const uint8_t *aAdvData, uint8_t aAdvDataLength )
這個方法在探索 Thread 網路時,會設定 Thread 合併器廣告。
「討論串加入者廣告」可以讓「加入者」透過新提議的「宣傳者廣告」(TLV) 宣傳自己的申請專屬資訊 (如供應商 ID、產品 ID、歧視程式等),並在不與人為互動的情況下為佣金或職員候選人提供這項資訊。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
傳回值 |
|
otThreadSetKeySequenceCounter
void otThreadSetKeySequenceCounter( otInstance *aInstance, uint32_t aKeySequenceCounter )
設定 thrKeySequenceCounter。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
otThreadGetKeySequenceCounter
otThreadSetKeySwitchGuardTime
void otThreadSetKeySwitchGuardTime( otInstance *aInstance, uint32_t aKeySwitchGuardTime )
設定 thrKeySwitchGuardTime (以小時為單位)。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
otThreadGetKeySwitchGuardTime
otThreadSetLinkMode
otError otThreadSetLinkMode( otInstance *aInstance, otLinkModeConfig aConfig )
設定 MLE 連結模式設定。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadGetLinkMode
otThreadSetMeshLocalPrefix
otError otThreadSetMeshLocalPrefix( otInstance *aInstance, const otMeshLocalPrefix *aMeshLocalPrefix )
這個函式會設定網格本機前置字串。
只有在停用執行緒通訊協定時,此函式才會成功。成功呼叫此函式後,非易變記憶體中的有效與待處理作業資料集就會失效。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadSetNetwork 鍵
otError otThreadSetNetworkKey( otInstance *aInstance, const otNetworkKey *aKey )
設定執行緒網路金鑰。
只有在停用執行緒通訊協定時,此函式才會成功。成功呼叫此函式後,非易變記憶體中的有效與待處理作業資料集就會失效。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadGetNetworkKey
otThreadSetNetworkKeyRef (OTThreadSetNetworkKeyRef)
otError otThreadSetNetworkKeyRef( otInstance *aInstance, otNetworkKeyRef aKeyRef )
將執行緒網路金鑰設為 otNetworkKeyRef
。
只有在停用執行緒通訊協定時,此函式才會成功。成功呼叫此函式後,非易變記憶體中的有效與待處理作業資料集就會失效。
您必須啟用建構時間功能 OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
,才能使用這個函式。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadGetNetworkKeyRef
otThreadSetNetwork 名稱
otError otThreadSetNetworkName( otInstance *aInstance, const char *aNetworkName )
設定執行緒網路名稱。
只有在停用執行緒通訊協定時,此函式才會成功。成功呼叫此函式後,非易變記憶體中的有效與待處理作業資料集就會失效。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回值 |
|
otThreadGetNetworkName
巨集
OT_JOINER_ADVDATA_MAX_LENGTH
OT_JOINER_ADVDATA_MAX_LENGTH 64
廣告關聯廣告長度上限。
OT_NEIGHBOR_INFO_ITERATOR_INIT
OT_NEIGHBOR_INFO_ITERATOR_INIT 0
otNeighborInfoIterator 的初始化器。
OT_NETWORK_BASE_TLV_MAX_LENGTH
OT_NETWORK_BASE_TLV_MAX_LENGTH 254
Thread Base TLV 的值長度上限。
OT_NETWORK_DATA_ITERATOR_INIT
OT_NETWORK_DATA_ITERATOR_INIT 0
用於初始化 otNetworkDataIterator
的值。
OT_NETWORK_DIAGNOSTIC_CHILD_TABLE_INPUT_SIZE
OT_NETWORK_DIAGNOSTIC_CHILD_TABLE_ENTRY_SIZE 3
網路診斷子項目項目的大小。
OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT
OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT 0
otNetworkDiagIterator 的初始化器。
OT_NETWORK_DIAGNOSTIC_TYPELIST_MAX_ENTRIES
OT_NETWORK_DIAGNOSTIC_TYPELIST_MAX_ENTRIES 19
要要求或重設的網路診斷 TLV 類型數量上限。
OT_NETWORK_MAX_ROUTER_ID
OT_NETWORK_MAX_ROUTER_ID 62
路由器 ID 上限。
OT_SERVER_DATA_MAX_SIZE
OT_SERVER_DATA_MAX_SIZE 248
伺服器資料大小上限 (以位元組為單位)。理論上有極大限制。
OT_SERVICE_DATA_MAX_SIZE
OT_SERVICE_DATA_MAX_SIZE 252
服務資料大小上限 (以位元組為單位)。
資源
OpenThread API 參考資料主題出自原始碼,可於 GitHub 取得。如需更多資訊,或想參閱我們的說明文件,請參閱資源。