網路共同處理器
這個模組包含用來控制 Thread 堆疊的執行作業。
摘要
Typedefs |
|
---|---|
otNcpDelegateAllowPeekPoke)(uint32_t aAddress, uint16_t aCount)
|
typedefbool(*
定義委任 (函式指標) 類型以控制迅速/朝向操作的行為。 |
otNcpHandlerJoinLegacyNode)(const otExtAddress *aExtAddress)
|
typedefvoid(*
定義用來啟動彙整程序的處理常式 (函式指標) 類型。 |
otNcpHandlerSetLegacyUlaPrefix)(const uint8_t *aUlaPrefix)
|
typedefvoid(*
定義用來設定舊版 ULA 前置字串的處理常式 (函式指標) 類型。 |
otNcpHandlerStartLegacy)(void)
|
typedefvoid(*
定義啟動舊版網路的處理常式 (函式指標) 類型。 |
otNcpHandlerStopLegacy)(void)
|
typedefvoid(*
定義停止舊版網路的處理常式 (函式指標) 類型。 |
otNcpHdlcSendCallback)(const uint8_t *aBuf, uint16_t aBufLength)
|
typedefint(*
呼叫此函式指標可傳送以 HDLC 編碼的 NCP 資料。 |
otNcpLegacyHandlers
|
typedefstruct otNcpLegacyHandlers
定義包含所有舊版處理常式 (函式指標) 的結構。 |
函式 |
|
---|---|
otNcpHandleDidReceiveNewLegacyUlaPrefix(const uint8_t *aUlaPrefix)
|
void
舊版堆疊會叫用這個回呼,通知舊版 ULA 前置字串已變更。
|
otNcpHandleLegacyNodeDidJoin(const otExtAddress *aExtAddr)
|
void
舊版堆疊會叫用這個回呼,通知新的舊版節點確實加入網路。
|
otNcpHdlcInit(otInstance *aInstance, otNcpHdlcSendCallback aSendCallback)
|
void
根據 HDLC 取景初始化 NCP。
|
otNcpHdlcReceive(const uint8_t *aBuf, uint16_t aBufLength)
|
void
收到 HDLC 編碼的 NCP 資料之後,系統就會呼叫此函式。
|
otNcpHdlcSendDone(void)
|
void
完成 NCP 傳送後,就會呼叫此函式。
|
otNcpPlatLogv(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, va_list aArgs)
|
void
使用
otNcpStreamWrite 寫入 OpenThread 記錄。 |
otNcpRegisterLegacyHandlers(const otNcpLegacyHandlers *aHandlers)
|
void
此方法會為 NCP 註冊一組舊版處理常式。
|
otNcpRegisterPeekPokeDelagates(otNcpDelegateAllowPeekPoke aAllowPeekDelegate, otNcpDelegateAllowPeekPoke aAllowPokeDelegate)
|
void
這個方法會註冊使用 NCP 模組的委派功能。
|
otNcpSpiInit(otInstance *aInstance)
|
void
根據 SPI 取景初始化 NCP。
|
otNcpStreamWrite(int aStreamId, const uint8_t *aDataPtr, int aDataLen)
|
透過特定串流將資料傳送至主機。
|
結構 |
|
---|---|
otNcpLegacyHandlers |
定義包含所有舊版處理常式 (函式指標) 的結構。 |
Typedefs
otNcpDelegateAllowPeekPoke
bool(* otNcpDelegateAllowPeekPoke)(uint32_t aAddress, uint16_t aCount)
定義委任 (函式指標) 類型以控制迅速/朝向操作的行為。
呼叫此委派函式,以決定是否要允許特定記憶體區域的短暫或朝向。當 NCP 支援 peek/poke 指令時,就會使用這個屬性。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回 |
TRUE 以允許/清除指定記憶體區域,否則為 FALSE。
|
otNcpHandlerjoinLegacyNode
void(* otNcpHandlerJoinLegacyNode)(const otExtAddress *aExtAddress)
定義用來啟動彙整程序的處理常式 (函式指標) 類型。
叫用對任何或特定節點啟動舊版彙整程序。
詳情 | |||
---|---|---|---|
參數 |
|
otNcpHandlerSetLegacyUlaPrefix
void(* otNcpHandlerSetLegacyUlaPrefix)(const uint8_t *aUlaPrefix)
定義用來設定舊版 ULA 前置字串的處理常式 (函式指標) 類型。
已叫用設定舊版 ULA 前置字串。
詳情 | |||
---|---|---|---|
參數 |
|
otNcpHandlerStartLegacy
void(* otNcpHandlerStartLegacy)(void)
定義啟動舊版網路的處理常式 (函式指標) 類型。
已叫用來啟動舊版網路。
otNcpHandlerStopLegacy
void(* otNcpHandlerStopLegacy)(void)
定義停止舊版網路的處理常式 (函式指標) 類型。
叫用來停止舊版網路。
otNcpHdlcSendCallback
int(* otNcpHdlcSendCallback)(const uint8_t *aBuf, uint16_t aBufLength)
呼叫此函式指標可傳送以 HDLC 編碼的 NCP 資料。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回 |
回呼處理的位元組數。
|
函式
otNcpProcessdone 接收 NewLegacyUlaPrefix
void otNcpHandleDidReceiveNewLegacyUlaPrefix( const uint8_t *aUlaPrefix )
舊版堆疊會叫用這個回呼,通知舊版 ULA 前置字串已變更。
詳情 | |||
---|---|---|---|
參數 |
|
otNcpHandlingLegacyNode (加入)
void otNcpHandleLegacyNodeDidJoin( const otExtAddress *aExtAddr )
舊版堆疊會叫用這個回呼,通知新的舊版節點確實加入網路。
詳情 | |||
---|---|---|---|
參數 |
|
otNcpHdlcInit
void otNcpHdlcInit( otInstance *aInstance, otNcpHdlcSendCallback aSendCallback )
根據 HDLC 取景初始化 NCP。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
otNcpHdlc 接收
void otNcpHdlcReceive( const uint8_t *aBuf, uint16_t aBufLength )
收到 HDLC 編碼的 NCP 資料之後,系統就會呼叫此函式。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
otNcpHdlcSendDone
void otNcpHdlcSendDone( void )
完成 NCP 傳送後,就會呼叫此函式。
otNcpPlatLogv
void otNcpPlatLogv( otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, va_list aArgs )
使用 otNcpStreamWrite
寫入 OpenThread 記錄。
詳情 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
otNcpRegisterLegacyHandlers
void otNcpRegisterLegacyHandlers( const otNcpLegacyHandlers *aHandlers )
此方法會為 NCP 註冊一組舊版處理常式。
NCP 程式碼會使用 aHandlers
結構提供的處理常式來啟動/停止舊版網路。如要停用 NCP 上的舊版支援,aHandlers
可以是 NULL。指定處理常式結構中的個別處理常式也可以是 NULL。
詳情 | |||
---|---|---|---|
參數 |
|
otNcpRegisterPeekPokeDelagates
void otNcpRegisterPeekPokeDelagates( otNcpDelegateAllowPeekPoke aAllowPeekDelegate, otNcpDelegateAllowPeekPoke aAllowPokeDelegate )
這個方法會註冊使用 NCP 模組的委派功能。
NCP 模組會呼叫委派函式,以決定是否要允許或清除特定記憶體區域。如果委派指標設為 NULL,則代表對任何地址執行迅速瀏覽/清除作業。
詳情 | |||||
---|---|---|---|---|---|
參數 |
|
otNcpSpiInit
void otNcpSpiInit( otInstance *aInstance )
根據 SPI 取景初始化 NCP。
詳情 | |||
---|---|---|---|
參數 |
|
otNcpStreamWrite
otError otNcpStreamWrite( int aStreamId, const uint8_t *aDataPtr, int aDataLen )
透過特定串流將資料傳送至主機。
此函式會嘗試使用指定的 aStreamId 將指定資料傳送至主機。這對於回報錯誤訊息、實作偵錯/診斷控制台,以及其他可能的資料串流類型。
系統接受或拒絕全部寫入。未嘗試寫入部分內容。
詳情 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回值 |
|
巨集
OT_NCP_LEGACY_ULA_PREFIX_LENGTH
OT_NCP_LEGACY_ULA_PREFIX_LENGTH 8
舊版 ULA 大小 (以位元組為單位)