無線電設定
這個模組包含無線電設定的平台抽象化機制。
摘要
| 函式 | |
|---|---|
| otPlatRadioGetBusSpeed(otInstance *aInstance) | uint32_t取得主機和無線電晶片之間的公車速度 (單位為位元/秒)。 | 
| otPlatRadioGetCaps(otInstance *aInstance) | 取得電台功能。 | 
| otPlatRadioGetCcaEnergyDetectThreshold(otInstance *aInstance, int8_t *aThreshold) | 根據 IEEE 802.15.4 至 2015 第 10.1.4 節的天線連接器,取得無線電的 CCA ED 門檻 (以 dBm 為單位)。 | 
| otPlatRadioGetFemLnaGain(otInstance *aInstance, int8_t *aGain) | 以 dBm 取得外部 FEM 的 Rx LNA。 | 
| otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64) | void取得這個介面的原廠指派 IEEE EUI-64。 | 
| otPlatRadioGetNow(otInstance *aInstance) | uint64_t取得參照當地連續單聲道 64 位元的目前時間,以微秒為單位。 | 
| otPlatRadioGetPromiscuous(otInstance *aInstance) | bool取得混雜模式的狀態。 | 
| otPlatRadioGetReceiveSensitivity(otInstance *aInstance) | int8_t取得無線電接收靈敏度值。 | 
| otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower) | 以 dBm 取得無線電的傳輸功率。 | 
| otPlatRadioGetVersionString(otInstance *aInstance) | const char *取得無線電版本字串。 | 
| otPlatRadioSetCcaEnergyDetectThreshold(otInstance *aInstance, int8_t aThreshold) | 根據 IEEE 802.15.4 至 2015 第 10.1.4 節的天線連接器設定無線電的 CCA ED 閾值。 | 
| otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtAddress) | void設定「擴充地址」來篩選地址。 | 
| otPlatRadioSetFemLnaGain(otInstance *aInstance, int8_t aGain) | 在 dBm 中設定外部 FEM 的 Rx LNA。 | 
| otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCounter) | void設定目前的 MAC 頁框計數器值。 | 
| otPlatRadioSetMacFrameCounterIfLarger(otInstance *aInstance, uint32_t aMacFrameCounter) | void只有在新的指定值大於目前值時,才設定目前的 MAC 頁框計數器值。 | 
| otPlatRadioSetMacKey(otInstance *aInstance, uint8_t aKeyIdMode, uint8_t aKeyId, const otMacKeyMaterial *aPrevKey, const otMacKeyMaterial *aCurrKey, const otMacKeyMaterial *aNextKey, otRadioKeyType aKeyType) | void更新 MAC 金鑰和金鑰索引。 | 
| otPlatRadioSetPanId(otInstance *aInstance, otPanId aPanId) | void設定用於篩選地址的永久帳號 ID。 | 
| otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable) | void啟用或停用雜訊模式。 | 
| otPlatRadioSetRxOnWhenIdle(otInstance *aInstance, bool aEnable) | void將 rx-on-when-idle 狀態設為無線電平台。 | 
| otPlatRadioSetShortAddress(otInstance *aInstance, otShortAddress aShortAddress) | void設定用於篩選地址的簡短地址。 | 
| otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower) | 使用 dBm 設定無線電的傳輸功率。 | 
函式
otPlatRadioGetBusSpeed
uint32_t otPlatRadioGetBusSpeed( otInstance *aInstance )
取得主機和無線電晶片之間的公車速度 (單位為位元/秒)。
| 詳細說明 | |||
|---|---|---|---|
| 參數 | 
 | ||
| 傳回 | 主機和無線電晶片之間的公車速度 (以位元/秒為單位)。如果 MAC 和以上層,且無線電層位於同一個晶片中,系統會傳回 0。 | ||
otPlatRadioGetCaps
otRadioCaps otPlatRadioGetCaps( otInstance *aInstance )
取得電台功能。
| 詳細說明 | |||
|---|---|---|---|
| 參數 | 
 | ||
| 傳回 | 無線電功能位元向量 (請參閱  OT_RADIO_CAP_*定義)。 | ||
otPlatRadioGetCcaEnergyDetectThreshold
otError otPlatRadioGetCcaEnergyDetectThreshold( otInstance *aInstance, int8_t *aThreshold )
根據 IEEE 802.15.4 至 2015 第 10.1.4 節的天線連接器,取得無線電的 CCA ED 門檻 (以 dBm 為單位)。
| 詳細說明 | |||||||
|---|---|---|---|---|---|---|---|
| 參數 | 
 | ||||||
| 傳回值 | 
 | ||||||
otPlatRadioGetFemLnaGain
otError otPlatRadioGetFemLnaGain( otInstance *aInstance, int8_t *aGain )
以 dBm 取得外部 FEM 的 Rx LNA。
| 詳細說明 | |||||||
|---|---|---|---|---|---|---|---|
| 參數 | 
 | ||||||
| 傳回值 | 
 | ||||||
otPlatRadioGetIeeeEui64
void otPlatRadioGetIeeeEui64( otInstance *aInstance, uint8_t *aIeeeEui64 )
取得這個介面的原廠指派 IEEE EUI-64。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
otPlatRadioGetNow
uint64_t otPlatRadioGetNow( otInstance *aInstance )
取得參照當地連續單聲道 64 位元的目前時間,以微秒為單位。
在裝置運作時間的期間,無線電時鐘「不得」換行。因此導入 SHALL 會識別內部計數器溢位並補償。該時鐘沒有定義的週期,且「不得」導入任何連續或不連續的調整 (例如間隔秒數)。實作 SHALL 可補償裝置的任何睡眠時間。
導入方法可能會選擇減少無線電時鐘,並以任何方式來彌補睡眠時間 (例如將高精確度/低功率 RTC 與高解析度計數器) 相輔相成,前提是揭露的組合時鐘可在 otPlatRadioGetCslAccuracy 公告的準確率限制範圍內持續提供單音微秒解析度。
| 詳細說明 | |||
|---|---|---|---|
| 參數 | 
 | ||
| 傳回 | 目前時間,以微秒為單位。UINT64_MAX (平台不支援或廣播時間尚未準備就緒) | ||
otPlatRadioGetPromiscuous
bool otPlatRadioGetPromiscuous( otInstance *aInstance )
取得混雜模式的狀態。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
| 傳回值 | 
 | ||||
otPlatRadioGetReceiveSensitivity
int8_t otPlatRadioGetReceiveSensitivity( otInstance *aInstance )
取得無線電接收靈敏度值。
| 詳細說明 | |||
|---|---|---|---|
| 參數 | 
 | ||
| 傳回 | 無線電接收靈敏度值,單位為 dBm。 | ||
otPlatRadioGetTransmitPower
otError otPlatRadioGetTransmitPower( otInstance *aInstance, int8_t *aPower )
以 dBm 取得無線電的傳輸功率。
| 詳細說明 | |||||||
|---|---|---|---|---|---|---|---|
| 參數 | 
 | ||||||
| 傳回值 | 
 | ||||||
otPlatRadioGetVersionString
const char * otPlatRadioGetVersionString( otInstance *aInstance )
取得無線電版本字串。
這是選用的無線電驅動程式平台功能。如果平台無線電驅動程式未提供,OpenThread 會改用 OpenThread 版本 (
| 詳細說明 | |||
|---|---|---|---|
| 參數 | 
 | ||
| 傳回 | 指向 OpenThread 無線電版本的指標。 | ||
otGetVersionString())。
otPlatRadioSetCcaEnergyDetectThreshold
otError otPlatRadioSetCcaEnergyDetectThreshold( otInstance *aInstance, int8_t aThreshold )
根據 IEEE 802.15.4 至 2015 第 10.1.4 節的天線連接器設定無線電的 CCA ED 閾值。
| 詳細說明 | |||||||
|---|---|---|---|---|---|---|---|
| 參數 | 
 | ||||||
| 傳回值 | 
 | ||||||
otPlatRadioSetExtendedAddress
void otPlatRadioSetExtendedAddress( otInstance *aInstance, const otExtAddress *aExtAddress )
設定「擴充地址」來篩選地址。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
otPlatRadioSetFemLnaGain
otError otPlatRadioSetFemLnaGain( otInstance *aInstance, int8_t aGain )
在 dBm 中設定外部 FEM 的 Rx LNA。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
| 傳回值 | 
 | ||||
otPlatRadioSetMacFrameCounter
void otPlatRadioSetMacFrameCounter( otInstance *aInstance, uint32_t aMacFrameCounter )
設定目前的 MAC 頁框計數器值。
當無線電提供 OT_RADIO_CAPS_TRANSMIT_SEC 功能時會使用。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
otPlatRadioSetMacFrameCounterIfLarger
void otPlatRadioSetMacFrameCounterIfLarger( otInstance *aInstance, uint32_t aMacFrameCounter )
只有在新的指定值大於目前值時,才設定目前的 MAC 頁框計數器值。
當無線電提供 OT_RADIO_CAPS_TRANSMIT_SEC 功能時會使用。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
otPlatRadioSetMacKey
void otPlatRadioSetMacKey( otInstance *aInstance, uint8_t aKeyIdMode, uint8_t aKeyId, const otMacKeyMaterial *aPrevKey, const otMacKeyMaterial *aCurrKey, const otMacKeyMaterial *aNextKey, otRadioKeyType aKeyType )
更新 MAC 金鑰和金鑰索引。
當無線電提供 OT_RADIO_CAPS_TRANSMIT_SEC 功能時使用,
| 詳細說明 | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 參數 | 
 | ||||||||||||||
otPlatRadioSetPanId
void otPlatRadioSetPanId( otInstance *aInstance, otPanId aPanId )
設定用於篩選地址的永久帳號 ID。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
otPlatRadioSetPromiscuous
void otPlatRadioSetPromiscuous( otInstance *aInstance, bool aEnable )
啟用或停用雜訊模式。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
otPlatRadioSetRxOnWhenIdle
void otPlatRadioSetRxOnWhenIdle( otInstance *aInstance, bool aEnable )
將 rx-on-when-idle 狀態設為無線電平台。
在少數情況下,如果裝置處於 rx-off-idle 狀態,無線電會進入睡眠狀態,但 SubMac 很難辨別這些情況,並且指示電台進入睡眠狀態:
- 完成一般影格接收工作,前提是:- 收到的影格並未發生錯誤且通過篩選條件,而且不是錯誤的 ACK。
- 由於內部條件,因此不會要求或傳送 ACK。
 
- 在傳輸的影格未要求 ACK 的情況下,結束 ACK 影格的傳輸或傳輸作業。
- 基於以下原因,完成要求 ACK 的接收作業完成作業:- ACK 逾時到期時間。
- 接收無效的 ACK 或非 ACK 影格。
- 接收適當的 ACK,除非傳輸的影格是「資料要求指令」,且收到的 ACK 上待處理位元設為 true。在此情況下,導入的無線電平台應將接收器保持開啟,直到已確定的逾時時間觸發閒置期間開始為止。您可以使用 OPENTHREAD_CONFIG_MAC_DATA_POLL_TIMEOUT作為參考。
 
- 獨立 CCA 工作完成作業。
- 在 CSMA/CA 程序期間,以忙碌結果完成 CCA 作業。
- 能源偵測任務完成。
- 使用 otPlatRadioReceiveAt排定的無線電接收機視窗結束化。
如果平台支援 OT_RADIO_CAPS_RX_ON_WHEN_IDLE,則必須一併支援 OT_RADIO_CAPS_CSMA_BACKOFF,並處理上述 CCA 後的閒置期間。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
otPlatRadioSetShortAddress
void otPlatRadioSetShortAddress( otInstance *aInstance, otShortAddress aShortAddress )
設定用於篩選地址的簡短地址。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
otPlatRadioSetTransmitPower
otError otPlatRadioSetTransmitPower( otInstance *aInstance, int8_t aPower )
使用 dBm 設定無線電的傳輸功率。
| 詳細說明 | |||||
|---|---|---|---|---|---|
| 參數 | 
 | ||||
| 傳回值 | 
 | ||||
資源
OpenThread API 參考資料主題源自原始碼,請前往 GitHub 取得。如要瞭解詳情或對說明文件做出貢獻,請參閱資源。