原始連結
這個模組包含用來控制原始連結圖層設定的函式。
摘要
Typedefs |
|
---|---|
otLinkRawEnergyScanDone)(otInstance *aInstance, int8_t aEnergyScanMaxRssi)
|
typedefvoid(*
此功能在接收 IEEE 802.15.4 框架。 |
otLinkRawReceiveDone)(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
typedefvoid(*
此功能在接收 IEEE 802.15.4 框架。 |
otLinkRawTransmitDone)(otInstance *aInstance, otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError)
|
typedefvoid(*
此功能在接收 IEEE 802.15.4 框架。 |
Functions |
|
---|---|
otLinkRawEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration, otLinkRawEnergyScanDone aCallback)
|
這個方法會啟動無線電上的能源掃描序列。
|
otLinkRawGetCaps(otInstance *aInstance)
|
取得電台功能。
|
otLinkRawGetPromiscuous(otInstance *aInstance)
|
bool
這個函式會取得類似模式的狀態。
|
otLinkRawGetRadioTime(otInstance *aInstance)
|
uint64_t
取得無線電晶片的目前平台時間 (寬度為 64 位元)。
|
otLinkRawGetRssi(otInstance *aInstance)
|
int8_t
取得最新的 RSSI 測量結果。
|
otLinkRawGetTransmitBuffer(otInstance *aInstance)
|
無線電的傳輸作業會從「傳輸」轉換為「接收」。
|
otLinkRawIsEnabled(otInstance *aInstance)
|
bool
這個函式會指出原始連結圖層是否已啟用。
|
otLinkRawReceive(otInstance *aInstance)
|
正在將電台從「休眠」轉換為「接收」。
|
otLinkRawSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCounter)
|
設定目前的 MAC 影格計數器值。
|
otLinkRawSetMacFrameCounterIfLarger(otInstance *aInstance, uint32_t aMacFrameCounter)
|
只有在新值大於目前的值時,才能設定目前的 MAC 影格計數器值。
|
otLinkRawSetMacKey(otInstance *aInstance, uint8_t aKeyIdMode, uint8_t aKeyId, const otMacKey *aPrevKey, const otMacKey *aCurrKey, const otMacKey *aNextKey)
|
更新 MAC 金鑰和金鑰索引。
|
otLinkRawSetPromiscuous(otInstance *aInstance, bool aEnable)
|
這項函式可啟用或停用鄰近模式。
|
otLinkRawSetReceiveDone(otInstance *aInstance, otLinkRawReceiveDone aCallback)
|
這個函式可啟用/停用原始連結圖層。
|
otLinkRawSetShortAddress(otInstance *aInstance, uint16_t aShortAddress)
|
設定短位址篩選位址。
|
otLinkRawSleep(otInstance *aInstance)
|
將收音機從「接收」轉換為「休眠」。
|
otLinkRawSrcMatchAddExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
正在將來源位址新增至來源對照表。
|
otLinkRawSrcMatchAddShortEntry(otInstance *aInstance, uint16_t aShortAddress)
|
在來源對照表中新增短位址。
|
otLinkRawSrcMatchClearExtEntries(otInstance *aInstance)
|
從來源對照表中移除所有延伸地址。
|
otLinkRawSrcMatchClearExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
正在移除圓形按鈕來源對照表中的延伸位址。
|
otLinkRawSrcMatchClearShortEntries(otInstance *aInstance)
|
從來源對照表中移除所有簡稱。
|
otLinkRawSrcMatchClearShortEntry(otInstance *aInstance, uint16_t aShortAddress)
|
正在移除來源對照表的簡短位址。
|
otLinkRawSrcMatchEnable(otInstance *aInstance, bool aEnable)
|
啟用/停用待定影格的來源比對。
|
otLinkRawTransmit(otInstance *aInstance, otLinkRawTransmitDone aCallback)
|
這個方法會啟動無線電上的傳輸序列。
|
Typedefs
otLinkRawEnergyScanDone
void(* otLinkRawEnergyScanDone)(otInstance *aInstance, int8_t aEnergyScanMaxRssi)
此功能在接收 IEEE 802.15.4 框架。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
OTLinkRawReceiveDone
void(* otLinkRawReceiveDone)(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
此功能在接收 IEEE 802.15.4 框架。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
otLinkRawTransmitmit
void(* otLinkRawTransmitDone)(otInstance *aInstance, otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError)
此功能在接收 IEEE 802.15.4 框架。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
Functions
otLinkRawEnergyScan
otError otLinkRawEnergyScan( otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration, otLinkRawEnergyScanDone aCallback )
這個方法會啟動無線電上的能源掃描序列。
詳細資料 | |||||||||
---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||
回傳值 |
|
otLinkRawGetCaps
otRadioCaps otLinkRawGetCaps( otInstance *aInstance )
取得電台功能。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
無線電功能位元向量。堆疊會根據這個值啟用或停用某些函式。
|
otLinkRawGetPromiscuous
bool otLinkRawGetPromiscuous( otInstance *aInstance )
這個函式會取得類似模式的狀態。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
otLinkRawGetRadioTime
uint64_t otLinkRawGetRadioTime( otInstance *aInstance )
取得無線電晶片的目前平台時間 (寬度為 64 位元)。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
目前的廣播時間,以微秒為單位。
|
OTLinkRawGetRssi
int8_t otLinkRawGetRssi( otInstance *aInstance )
取得最新的 RSSI 測量結果。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
這個 IBI 的 RSSI 為有效值,RSS1 無效時為 127。
|
otLinkRawGetTransmitBuffer
otRadioFrame * otLinkRawGetTransmitBuffer( otInstance *aInstance )
無線電的傳輸作業會從「傳輸」轉換為「接收」。
這個方法會傳回指向傳輸緩衝區的指標。
呼叫端在該緩衝區中形成 IEEE 802.15.4 影格,然後呼叫 otLinkRawTransmit() 來要求傳輸。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
未啟用傳輸緩衝區或 NULL 的指標 (如果原始連結圖層未啟用)。
|
otLinkRawIsEnabled
bool otLinkRawIsEnabled( otInstance *aInstance )
這個函式會指出原始連結圖層是否已啟用。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
OTLinkRawReceive
otError otLinkRawReceive( otInstance *aInstance )
正在將電台從「休眠」轉換為「接收」。
開啟收音機。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
OTLinkRawSetMacFrameCounter
otError otLinkRawSetMacFrameCounter( otInstance *aInstance, uint32_t aMacFrameCounter )
設定目前的 MAC 影格計數器值。
這個函式一律會將 MAC 計數器設為新的指定值 aMacFrameCounter
,且與目前值無關。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
otLinkRawSetMacFrameCounterIfLer
otError otLinkRawSetMacFrameCounterIfLarger( otInstance *aInstance, uint32_t aMacFrameCounter )
只有在新值大於目前的值時,才能設定目前的 MAC 影格計數器值。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
OTLinkRawSetMacKey
otError otLinkRawSetMacKey( otInstance *aInstance, uint8_t aKeyIdMode, uint8_t aKeyId, const otMacKey *aPrevKey, const otMacKey *aCurrKey, const otMacKey *aNextKey )
更新 MAC 金鑰和金鑰索引。
詳細資料 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||
回傳值 |
|
OTLinkRawSetPromiscuous
otError otLinkRawSetPromiscuous( otInstance *aInstance, bool aEnable )
這項函式可啟用或停用鄰近模式。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
otLinkRawSetReceiveDone
otError otLinkRawSetReceiveDone( otInstance *aInstance, otLinkRawReceiveDone aCallback )
這個函式可啟用/停用原始連結圖層。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
回傳值 |
|
OTLinkRawSetShortAddress
otError otLinkRawSetShortAddress( otInstance *aInstance, uint16_t aShortAddress )
設定短位址篩選位址。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
OTLinkRawSleep
otError otLinkRawSleep( otInstance *aInstance )
將收音機從「接收」轉換為「休眠」。
關閉收音機。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
回傳值 |
|
otLinkRawSrcMatchAddExtEntry
otError otLinkRawSrcMatchAddExtEntry( otInstance *aInstance, const otExtAddress *aExtAddress )
正在將來源位址新增至來源對照表。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
回傳值 |
|
otLinkRawSrcMatchAddShortEntry
otError otLinkRawSrcMatchAddShortEntry( otInstance *aInstance, uint16_t aShortAddress )
在來源對照表中新增短位址。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
回傳值 |
|
otLinkRawSrcMatchClearExtEntries
otError otLinkRawSrcMatchClearExtEntries( otInstance *aInstance )
從來源對照表中移除所有延伸地址。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
otLinkRawSrcMatchClearExtEntry
otError otLinkRawSrcMatchClearExtEntry( otInstance *aInstance, const otExtAddress *aExtAddress )
正在移除圓形按鈕來源對照表中的延伸位址。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
回傳值 |
|
otLinkRawSrcMatchClearShortShorts
otError otLinkRawSrcMatchClearShortEntries( otInstance *aInstance )
從來源對照表中移除所有簡稱。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
otLinkRawSrcMatchClearShortEntry
otError otLinkRawSrcMatchClearShortEntry( otInstance *aInstance, uint16_t aShortAddress )
正在移除來源對照表的簡短位址。
詳細資料 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
回傳值 |
|
otLinkRawSrcMatch 啟用
otError otLinkRawSrcMatchEnable( otInstance *aInstance, bool aEnable )
啟用/停用待定影格的來源比對。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
OTLinkRawTransmit
otError otLinkRawTransmit( otInstance *aInstance, otLinkRawTransmitDone aCallback )
這個方法會啟動無線電上的傳輸序列。
在呼叫傳輸之前,呼叫端必須在 otLinkRawGetTransmitBuffer() 提供的緩衝區中,建立 IEEE 802.15.4 影格。頻道和傳輸功率也包含在 otRadioFrame 結構中。
傳輸順序包含下列項目:
- 將廣播從接收器接收到傳輸。
- 在指定的頻道和指定的傳輸功率上傳輸 PSDU。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
回傳值 |
|
資源
OpenThread API 參考資料主題來自原始碼,可在 GitHub 取得。如需詳細資訊或為說明文件貢獻一己之力,請參閱資源。