เราเตอร์/ลีดเดอร์
โมดูลนี้ประกอบด้วยฟังก์ชันสำหรับเราเตอร์และตัวนำเทรด
สรุป
การแจกแจง |
|
|---|---|
otCacheEntryState
|
enum กำหนดสถานะรายการแคช EID |
otNeighborTableEvent{
|
enum กำหนดค่าคงที่ที่ใช้ใน otNeighborTableCallback เพื่อระบุการเปลี่ยนแปลงในตารางใกล้เคียง |
otPowerSupply{
|
enum แสดงคุณสมบัติของแหล่งจ่ายไฟในอุปกรณ์ |
Typedef |
|
|---|---|
otCacheEntryInfo
|
typedefstruct otCacheEntryInfo
แสดงรายการแคช EID |
otCacheEntryIterator
|
typedefstruct otCacheEntryIterator
แสดงตัววนซ้ำที่ใช้สำหรับทำซ้ำผ่านรายการในตารางแคช EID |
otCacheEntryState
|
typedefenum otCacheEntryState
กำหนดสถานะรายการแคช EID |
otChildIp6AddressIterator
|
typedefuint16_t
ใช้ในการทำซ้ำผ่านที่อยู่ IPv6 ของรายการย่อยของ Thread |
otDeviceProperties
|
typedefstruct otDeviceProperties
แสดงพร็อพเพอร์ตี้ของอุปกรณ์ซึ่งใช้ในการคำนวณน้ำหนักของผู้นำในพื้นที่บนอุปกรณ์ |
otNeighborTableCallback)(otNeighborTableEvent aEvent, const otNeighborTableEntryInfo *aEntryInfo)
|
typedefvoid(*
ระบบจะเรียกใช้ตัวชี้เพื่อแจ้งว่ามีการเปลี่ยนแปลงในตารางใกล้เคียง |
ฟังก์ชัน |
|
|---|---|
otThreadBecomeLeader(otInstance *aInstance)
|
มาเป็นผู้นำและเริ่มแบ่งพาร์ติชันใหม่
|
otThreadBecomeRouter(otInstance *aInstance)
|
ลองพยายามเป็นเราเตอร์
|
otThreadGetAdvertisementTrickleIntervalMax(otInstance *aInstance)
|
uint32_t
รับค่าสูงสุดของช่วงปัจจุบันที่ใช้โดยตัวจับเวลาถอยหลังของโฆษณา
|
otThreadGetChildInfoById(otInstance *aInstance, uint16_t aChildId, otChildInfo *aChildInfo)
|
รับข้อมูลการวินิจฉัย Child ID หรือ RLOC16 ที่แนบอยู่
|
otThreadGetChildInfoByIndex(otInstance *aInstance, uint16_t aChildIndex, otChildInfo *aChildInfo)
|
ฟังก์ชันนี้จะเก็บข้อมูลการวินิจฉัยสำหรับรายการย่อยที่แนบอยู่โดยดัชนีตารางภายใน
|
otThreadGetChildNextIp6Address(otInstance *aInstance, uint16_t aChildIndex, otChildIp6AddressIterator *aIterator, otIp6Address *aAddress)
|
รับที่อยู่ IPv6 ถัดไป (โดยใช้ตัวซ้ำ) สำหรับส่วนย่อยที่ระบุ
|
otThreadGetChildRouterLinks(otInstance *aInstance)
|
uint8_t
รับพารามิเตอร์ MLE_CHILD_ROUTER_LINKS ที่ใช้ในบทบาท REED
|
otThreadGetContextIdReuseDelay(otInstance *aInstance)
|
uint32_t
รับพารามิเตอร์ CONTEXT_ID_REUSE_DELAY ที่ใช้ในบทบาทผู้นำ
|
otThreadGetDeviceProperties(otInstance *aInstance)
|
const otDeviceProperties *
ดูพร็อพเพอร์ตี้ของอุปกรณ์ในปัจจุบัน
|
otThreadGetJoinerUdpPort(otInstance *aInstance)
|
uint16_t
รับพอร์ต Joiner UDP
|
otThreadGetLocalLeaderWeight(otInstance *aInstance)
|
uint8_t
รับน้ำหนักของตัวนำเทรดที่ใช้เมื่อทำงานในบทบาทผู้นำ
|
otThreadGetMaxAllowedChildren(otInstance *aInstance)
|
uint16_t
ดึงจำนวนเด็กสูงสุดที่อนุญาตในปัจจุบัน
|
otThreadGetMaxChildIpAddresses(otInstance *aInstance)
|
uint8_t
รับจำนวนที่อยู่ IP สูงสุดที่ผู้เผยแพร่โฆษณาย่อย MTD แต่ละรายอาจลงทะเบียนกับอุปกรณ์นี้ในฐานะระดับบนสุด
|
otThreadGetMaxRouterId(otInstance *aInstance)
|
uint8_t
ฟังก์ชันนี้จะแสดงรหัสเราเตอร์สูงสุดที่อนุญาต
|
otThreadGetNetworkIdTimeout(otInstance *aInstance)
|
uint8_t
รับพารามิเตอร์
NETWORK_ID_TIMEOUT |
otThreadGetNextCacheEntry(otInstance *aInstance, otCacheEntryInfo *aEntryInfo, otCacheEntryIterator *aIterator)
|
รับรายการแคช EID ถัดไป (โดยใช้ตัวซ้ำ)
|
otThreadGetNextHopAndPathCost(otInstance *aInstance, uint16_t aDestRloc16, uint16_t *aNextHopRloc16, uint8_t *aPathCost)
|
void
รับค่าใช้จ่ายสำหรับฮอพและเส้นทางถัดไปไปยังปลายทาง RLOC16 ที่ระบุ
|
otThreadGetParentPriority(otInstance *aInstance)
|
int8_t
รับลำดับความสำคัญระดับบนสุดที่กำหนด
|
otThreadGetPreferredLeaderPartitionId(otInstance *aInstance)
|
uint32_t
รับรหัสพาร์ติชันของผู้นำเทรดที่ต้องการเมื่อดําเนินการในบทบาทผู้นำ
|
otThreadGetPskc(otInstance *aInstance, otPskc *aPskc)
|
void
รับ Thread PSKc
|
otThreadGetPskcRef(otInstance *aInstance)
|
รับการอ้างอิงคีย์ไปยัง Thread PSKc ที่จัดเก็บไว้
|
otThreadGetRouterDowngradeThreshold(otInstance *aInstance)
|
uint8_t
รับพารามิเตอร์ ROUTER_DOWNGRADE_THRESHOLD ที่ใช้ในบทบาทเราเตอร์
|
otThreadGetRouterIdRange(otInstance *aInstance, uint8_t *aMinRouterId, uint8_t *aMaxRouterId)
|
void
รับช่วงของรหัสเราเตอร์ที่ได้รับอนุญาตให้กำหนดให้กับโหนดภายในเครือข่ายเทรด
|
otThreadGetRouterIdSequence(otInstance *aInstance)
|
uint8_t
รับลำดับรหัสเราเตอร์ปัจจุบัน
|
otThreadGetRouterInfo(otInstance *aInstance, uint16_t aRouterId, otRouterInfo *aRouterInfo)
|
ฟังก์ชันนี้จะเก็บข้อมูลการวินิจฉัยสำหรับเราเตอร์เทรดที่ระบุ
|
otThreadGetRouterSelectionJitter(otInstance *aInstance)
|
uint8_t
รับพารามิเตอร์ ROUTER_SELECTION_JITTER ที่ใช้ในบทบาท REED/เราเตอร์
|
otThreadGetRouterUpgradeThreshold(otInstance *aInstance)
|
uint8_t
รับพารามิเตอร์ ROUTER_UPGRADE_THRESHOLD ที่ใช้ในบทบาท REED
|
otThreadIsRouterEligible(otInstance *aInstance)
|
bool
ระบุว่าอุปกรณ์มีสิทธิ์ใช้เราเตอร์หรือไม่
|
otThreadIsRouterIdAllocated(otInstance *aInstance, uint8_t aRouterId)
|
bool
ระบุว่ามีการจัดสรรรหัสเราเตอร์ในปัจจุบันหรือไม่
|
otThreadRegisterNeighborTableCallback(otInstance *aInstance, otNeighborTableCallback aCallback)
|
void
ลงทะเบียนฟังก์ชันเรียกกลับของตารางใกล้เคียง
|
otThreadReleaseRouterId(otInstance *aInstance, uint8_t aRouterId)
|
ปล่อยรหัสเราเตอร์ที่อุปกรณ์ได้รับการจัดสรรในบทบาทผู้นำ
|
otThreadSetCcmEnabled(otInstance *aInstance, bool aEnabled)
|
void
ตั้งค่าว่าอุปกรณ์ได้รับการว่าจ้างให้ใช้ CCM หรือไม่
|
otThreadSetChildRouterLinks(otInstance *aInstance, uint8_t aChildRouterLinks)
|
ตั้งค่าพารามิเตอร์ MLE_CHILD_ROUTER_LINKS ที่ใช้ในบทบาท REED
|
otThreadSetContextIdReuseDelay(otInstance *aInstance, uint32_t aDelay)
|
void
ตั้งค่าพารามิเตอร์ CONTEXT_ID_REUSE_DELAY ที่ใช้ในบทบาทผู้นำ
|
otThreadSetDeviceProperties(otInstance *aInstance, const otDeviceProperties *aDeviceProperties)
|
void
ตั้งค่าคุณสมบัติของอุปกรณ์ที่จะใช้กำหนดและกำหนดน้ำหนักตัวนำ
|
otThreadSetJoinerUdpPort(otInstance *aInstance, uint16_t aJoinerUdpPort)
|
ตั้งค่าพอร์ต Joiner UDP
|
otThreadSetLocalLeaderWeight(otInstance *aInstance, uint8_t aWeight)
|
void
ตั้งค่าน้ำหนักของตัวนำเทรดที่ใช้เมื่อทำงานในบทบาทผู้นำ
|
otThreadSetMaxAllowedChildren(otInstance *aInstance, uint16_t aMaxChildren)
|
ตั้งค่าจำนวนสูงสุดของเด็กที่อนุญาตในปัจจุบัน
|
otThreadSetMaxChildIpAddresses(otInstance *aInstance, uint8_t aMaxIpAddresses)
|
ตั้งค่าหรือกู้คืนจำนวนที่อยู่ IP สูงสุดที่ผู้เผยแพร่โฆษณาย่อย MTD แต่ละรายอาจลงทะเบียนกับอุปกรณ์นี้ในฐานะระดับบนสุด
|
otThreadSetNetworkIdTimeout(otInstance *aInstance, uint8_t aTimeout)
|
void
ตั้งค่าพารามิเตอร์
NETWORK_ID_TIMEOUT |
otThreadSetParentPriority(otInstance *aInstance, int8_t aParentPriority)
|
กำหนดลำดับความสำคัญของผู้ปกครอง
|
otThreadSetPreferredLeaderPartitionId(otInstance *aInstance, uint32_t aPartitionId)
|
void
ตั้งค่ารหัสพาร์ติชันของผู้นำเทรดที่ต้องการเมื่อใช้ในบทบาทผู้นำ
|
otThreadSetPreferredRouterId(otInstance *aInstance, uint8_t aRouterId)
|
ตั้งค่ารหัสเราเตอร์ที่ต้องการ
|
otThreadSetPskc(otInstance *aInstance, const otPskc *aPskc)
|
ตั้งค่าเทรด PSKc
|
otThreadSetPskcRef(otInstance *aInstance, otPskcRef aKeyRef)
|
ตั้งค่าการอ้างอิงคีย์เป็นเทรด PSKc
|
otThreadSetRouterDowngradeThreshold(otInstance *aInstance, uint8_t aThreshold)
|
void
ตั้งค่าพารามิเตอร์ ROUTER_DOWNGRADE_THRESHOLD ที่ใช้ในบทบาทผู้นำ
|
otThreadSetRouterEligible(otInstance *aInstance, bool aEligible)
|
ตั้งค่าว่าอุปกรณ์มีสิทธิ์ใช้เราเตอร์หรือไม่
|
otThreadSetRouterIdRange(otInstance *aInstance, uint8_t aMinRouterId, uint8_t aMaxRouterId)
|
ตั้งค่าช่วงของรหัสเราเตอร์ที่ได้รับอนุญาตให้กำหนดให้กับโหนดภายในเครือข่ายเทรด
|
otThreadSetRouterSelectionJitter(otInstance *aInstance, uint8_t aRouterJitter)
|
void
ตั้งค่าพารามิเตอร์ ROUTER_SELECTION_JITTER ที่ใช้ในบทบาท REED/เราเตอร์
|
otThreadSetRouterUpgradeThreshold(otInstance *aInstance, uint8_t aThreshold)
|
void
ตั้งค่าพารามิเตอร์ ROUTER_UPGRADE_THRESHOLD ที่ใช้ในบทบาทผู้นำ
|
otThreadSetSteeringData(otInstance *aInstance, const otExtAddress *aExtAddress)
|
void
ตั้งค่าข้อมูลพวงมาลัยอยู่นอกย่านความถี่
|
otThreadSetThreadVersionCheckEnabled(otInstance *aInstance, bool aEnabled)
|
void
กำหนดว่าจะเปิดใช้เกณฑ์เวอร์ชัน TLV ของนโยบายความปลอดภัยสำหรับการกำหนดเส้นทาง (ฟิลด์ VR) หรือไม่
|
โครงสร้าง |
|
|---|---|
| otCacheEntryInfo |
แสดงรายการแคช EID |
| otCacheEntryIterator |
แสดงตัววนซ้ำที่ใช้สำหรับทำซ้ำผ่านรายการในตารางแคช EID |
| otChildInfo |
เก็บข้อมูลการวินิจฉัยสำหรับผู้เผยแพร่โฆษณาย่อยในเทรด |
| otDeviceProperties |
แสดงพร็อพเพอร์ตี้ของอุปกรณ์ซึ่งใช้ในการคำนวณน้ำหนักของผู้นำในพื้นที่บนอุปกรณ์ |
| otNeighborTableEntryInfo |
แสดงข้อมูลรายการในตารางใกล้เคียง (ย่อยหรือเราเตอร์) และใช้เป็นพารามิเตอร์ในโค้ดเรียกกลับ |
การแจกแจง
otCacheEntryState
otCacheEntryState
กำหนดสถานะรายการแคช EID
otNeighborTableEvent
otNeighborTableEvent
กำหนดค่าคงที่ที่ใช้ใน otNeighborTableCallback เพื่อระบุการเปลี่ยนแปลงในตารางใกล้เคียง
| พร็อพเพอร์ตี้ | |
|---|---|
OT_NEIGHBOR_TABLE_EVENT_CHILD_ADDED
|
กำลังเพิ่มบุตรหลาน |
OT_NEIGHBOR_TABLE_EVENT_CHILD_MODE_CHANGED
|
โหมดของบุตรหลานที่มีอยู่จะเปลี่ยนไป |
OT_NEIGHBOR_TABLE_EVENT_CHILD_REMOVED
|
ระบบกำลังนำเด็กออก |
OT_NEIGHBOR_TABLE_EVENT_ROUTER_ADDED
|
กำลังเพิ่มเราเตอร์ |
OT_NEIGHBOR_TABLE_EVENT_ROUTER_REMOVED
|
กำลังจะนำเราเตอร์ออก |
otPowerSupply
otPowerSupply
แสดงคุณสมบัติของแหล่งจ่ายไฟในอุปกรณ์
ข้อมูลนี้ใช้เป็นพร็อพเพอร์ตี้ใน otDeviceProperties เพื่อคำนวณน้ำหนักผู้นำ
| พร็อพเพอร์ตี้ | |
|---|---|
OT_POWER_SUPPLY_BATTERY
|
ใช้แบตเตอรี่ |
OT_POWER_SUPPLY_EXTERNAL
|
ไฟฟ้าใช้ภายนอก (ใช้ไฟหลัก) |
OT_POWER_SUPPLY_EXTERNAL_STABLE
|
แหล่งจ่ายไฟภายนอกที่เสถียรโดยใช้แบตเตอรี่สำรองหรือ UPS |
OT_POWER_SUPPLY_EXTERNAL_UNSTABLE
|
กำลังไฟฟ้าของส่วนขยายอาจไม่เสถียร (เช่น หลอดไฟที่จ่ายผ่านสวิตช์) |
Typedef
otCacheEntryIterator
struct otCacheEntryIterator otCacheEntryIterator
แสดงตัววนซ้ำที่ใช้สำหรับทำซ้ำผ่านรายการในตารางแคช EID
หากต้องการเริ่มต้นตัววนซ้ำและเริ่มต้นจากรายการแรกในตารางแคช ให้ตั้งค่าฟิลด์ทั้งหมดในโครงสร้างเป็น 0 (เช่น memset ตัววนซ้ำเป็น 0)
otChildIp6AddressIterator
uint16_t otChildIp6AddressIterator
ใช้ในการทำซ้ำผ่านที่อยู่ IPv6 ของรายการย่อยของ Thread
otDeviceProperties
struct otDeviceProperties otDeviceProperties
แสดงพร็อพเพอร์ตี้ของอุปกรณ์ซึ่งใช้ในการคำนวณน้ำหนักของผู้นำในพื้นที่บนอุปกรณ์
โดยการตั้งค่าพารามิเตอร์ตามความสามารถของอุปกรณ์ ไม่ว่าจะทำหน้าที่เป็น Border Router, การกำหนดค่าแหล่งจ่ายไฟ ฯลฯ
mIsUnstable จะระบุความเสถียรในการทำงานของอุปกรณ์และจะกำหนดผ่านกลไกเฉพาะของผู้ให้บริการ ซึ่งอาจประกอบไปด้วยกรณีต่อไปนี้
- ภายในอุปกรณ์ตรวจพบว่าไม่มีแหล่งจ่ายไฟภายนอกหลุดบ่อยกว่าปกติ ผู้ให้บริการจะเป็นผู้กำหนดสิ่งที่ปกติ
- ภายในอุปกรณ์ตรวจพบว่ามีการรีบูตบ่อยกว่าปกติ ผู้ให้บริการจะเป็นผู้กำหนดสิ่งที่ปกติ
otNeighborTableCallback
void(* otNeighborTableCallback)(otNeighborTableEvent aEvent, const otNeighborTableEntryInfo *aEntryInfo)
ระบบจะเรียกใช้ตัวชี้เพื่อแจ้งว่ามีการเปลี่ยนแปลงในตารางใกล้เคียง
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
ฟังก์ชัน
otThreadBecomeLeader
otError otThreadBecomeLeader( otInstance *aInstance )
มาเป็นผู้นำและเริ่มแบ่งพาร์ติชันใหม่
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadBecomeRouter
otError otThreadBecomeRouter( otInstance *aInstance )
ลองพยายามเป็นเราเตอร์
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadGetAdvertisementTrickleIntervalMax
uint32_t otThreadGetAdvertisementTrickleIntervalMax( otInstance *aInstance )
รับค่าสูงสุดของช่วงปัจจุบันที่ใช้โดยตัวจับเวลาถอยหลังของโฆษณา
API นี้ต้องใช้ OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE และมีไว้สำหรับการทดสอบเท่านั้น
| รายละเอียด | |
|---|---|
| การส่งคืน |
ช่วงเวลาสูงสุดของตัวจับเวลาการโฆษณา หน่วยเป็นมิลลิวินาที
|
otThreadGetChildInfoById
otError otThreadGetChildInfoById( otInstance *aInstance, uint16_t aChildId, otChildInfo *aChildInfo )
รับข้อมูลการวินิจฉัย Child ID หรือ RLOC16 ที่แนบอยู่
| รายละเอียด | |||||||
|---|---|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||||
| แสดงผลค่า |
|
||||||
otThreadGetChildInfoByIndex
otError otThreadGetChildInfoByIndex( otInstance *aInstance, uint16_t aChildIndex, otChildInfo *aChildInfo )
ฟังก์ชันนี้จะเก็บข้อมูลการวินิจฉัยสำหรับรายการย่อยที่แนบอยู่โดยดัชนีตารางภายใน
| รายละเอียด | |||||||
|---|---|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||||
| แสดงผลค่า |
|
||||||
otGetMaxAllowedChild
otThreadGetChildNextIp6Address
otError otThreadGetChildNextIp6Address( otInstance *aInstance, uint16_t aChildIndex, otChildIp6AddressIterator *aIterator, otIp6Address *aAddress )
รับที่อยู่ IPv6 ถัดไป (โดยใช้ตัวซ้ำ) สำหรับส่วนย่อยที่ระบุ
| รายละเอียด | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||||||
| แสดงผลค่า |
|
||||||||
otThreadGetChildInfoByIndex
otThreadGetChildRouterLinks
uint8_t otThreadGetChildRouterLinks( otInstance *aInstance )
รับพารามิเตอร์ MLE_CHILD_ROUTER_LINKS ที่ใช้ในบทบาท REED
พารามิเตอร์นี้ระบุจำนวนเราเตอร์ใกล้เคียงสูงสุดที่อุปกรณ์ (เป็น FED) จะพยายามสร้างลิงก์
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ค่า MLE_CHILD_ROUTER_LINKS
|
||
otThreadSetChildRouterLinks
otThreadGetContextIdReuseDelay
uint32_t otThreadGetContextIdReuseDelay( otInstance *aInstance )
รับพารามิเตอร์ CONTEXT_ID_REUSE_DELAY ที่ใช้ในบทบาทผู้นำ
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ค่า CONTEXT_ID_REUSE_DELAY
|
||
otThreadSetContextIdReuseDelay
otThreadGetDeviceProperties
const otDeviceProperties * otThreadGetDeviceProperties( otInstance *aInstance )
ดูพร็อพเพอร์ตี้ของอุปกรณ์ในปัจจุบัน
ต้องใช้ OPENTHREAD_CONFIG_MLE_DEVICE_PROPERTY_LEADER_WEIGHT_ENABLE
| รายละเอียด | |
|---|---|
| การส่งคืน |
พร็อพเพอร์ตี้ของอุปกรณ์
otDeviceProperties |
otThreadGetJoinerUdpPort
uint16_t otThreadGetJoinerUdpPort( otInstance *aInstance )
รับพอร์ต Joiner UDP
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
หมายเลขพอร์ต UDP ของผู้เชื่อม
|
||
otThreadSetJoinerUdpPort
otThreadGetLocalLeaderWeight
uint8_t otThreadGetLocalLeaderWeight( otInstance *aInstance )
รับน้ำหนักของตัวนำเทรดที่ใช้เมื่อทำงานในบทบาทผู้นำ
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ค่าน้ำหนักของตัวนำชุดข้อความ
|
||
otThreadSetLeaderอื่นได้
otThreadSetDeviceProperties
otThreadGetMaxAllowedChildren
uint16_t otThreadGetMaxAllowedChildren( otInstance *aInstance )
ดึงจำนวนเด็กสูงสุดที่อนุญาตในปัจจุบัน
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
จำนวนเด็กสูงสุดที่อนุญาตในปัจจุบัน
|
||
otThreadSetMaxAllowedChildren
otThreadGetMaxChildIpAddresses
uint8_t otThreadGetMaxChildIpAddresses( otInstance *aInstance )
รับจำนวนที่อยู่ IP สูงสุดที่ผู้เผยแพร่โฆษณาย่อย MTD แต่ละรายอาจลงทะเบียนกับอุปกรณ์นี้ในฐานะระดับบนสุด
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
จำนวนที่อยู่ IP สูงสุดที่ผู้เผยแพร่โฆษณาย่อย MTD แต่ละรายอาจลงทะเบียนกับอุปกรณ์นี้ในฐานะระดับบนสุด
|
||
otThreadSetMaxChildIpAddresses
otThreadGetMaxRouterId
uint8_t otThreadGetMaxRouterId( otInstance *aInstance )
ฟังก์ชันนี้จะแสดงรหัสเราเตอร์สูงสุดที่อนุญาต
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
รหัสเราเตอร์สูงสุดที่อนุญาต
|
||
otThreadGetNetworkIdTimeout
uint8_t otThreadGetNetworkIdTimeout( otInstance *aInstance )
รับพารามิเตอร์ NETWORK_ID_TIMEOUT
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ค่า
NETWORK_ID_TIMEOUT |
||
otThreadSetNetworkIdTimeout
otThreadGetNextCacheEntry
otError otThreadGetNextCacheEntry( otInstance *aInstance, otCacheEntryInfo *aEntryInfo, otCacheEntryIterator *aIterator )
รับรายการแคช EID ถัดไป (โดยใช้ตัวซ้ำ)
| รายละเอียด | |||||||
|---|---|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||||
| แสดงผลค่า |
|
||||||
otThreadGetNextHopAndPathCost
void otThreadGetNextHopAndPathCost( otInstance *aInstance, uint16_t aDestRloc16, uint16_t *aNextHopRloc16, uint8_t *aPathCost )
รับค่าใช้จ่ายสำหรับฮอพและเส้นทางถัดไปไปยังปลายทาง RLOC16 ที่ระบุ
ใช้ได้กับ aNextHopRloc16 หรือ aPathCost ที่เป็นค่าว่างซึ่งระบุว่าผู้โทรไม่ต้องการรับค่าดังกล่าว
| รายละเอียด | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||||||
otThreadGetParentPriority
int8_t otThreadGetParentPriority( otInstance *aInstance )
รับลำดับความสำคัญระดับบนสุดที่กำหนด
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ค่าลำดับความสำคัญหลักที่กำหนดไว้ -2 หมายความว่าไม่ได้กำหนด
|
||
otThreadSetParentPriority
otThreadGetPreferredLeaderPartitionId
uint32_t otThreadGetPreferredLeaderPartitionId( otInstance *aInstance )
รับรหัสพาร์ติชันของผู้นำเทรดที่ต้องการเมื่อดําเนินการในบทบาทผู้นำ
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ค่ารหัสพาร์ติชันของตัวนําเทรด
|
||
otThreadGetPskc
void otThreadGetPskc( otInstance *aInstance, otPskc *aPskc )
รับ Thread PSKc
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadSetPskc
otThreadGetPskcRef
otPskcRef otThreadGetPskcRef( otInstance *aInstance )
รับการอ้างอิงคีย์ไปยัง Thread PSKc ที่จัดเก็บไว้
ต้องเปิดใช้ฟีเจอร์ OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE เวอร์ชันสำหรับบิวด์
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ข้อมูลอ้างอิงสำคัญสำหรับ PSKc
|
||
otThreadSetPskcRef
otThreadGetRouterDowngradeThreshold
uint8_t otThreadGetRouterDowngradeThreshold( otInstance *aInstance )
รับพารามิเตอร์ ROUTER_DOWNGRADE_THRESHOLD ที่ใช้ในบทบาทเราเตอร์
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ค่า ROUTER_DOWNGRADE_THRESHOLD
|
||
otThreadSetRouterDowngradeThreshold
otThreadGetRouterIdRange
void otThreadGetRouterIdRange( otInstance *aInstance, uint8_t *aMinRouterId, uint8_t *aMaxRouterId )
รับช่วงของรหัสเราเตอร์ที่ได้รับอนุญาตให้กำหนดให้กับโหนดภายในเครือข่ายเทรด
| รายละเอียด | |||||||
|---|---|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||||
otThreadSetRouterIdRange
otThreadGetRouterIdSequence
uint8_t otThreadGetRouterIdSequence( otInstance *aInstance )
รับลำดับรหัสเราเตอร์ปัจจุบัน
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ลำดับรหัสเราเตอร์
|
||
otThreadGetRouterInfo
otError otThreadGetRouterInfo( otInstance *aInstance, uint16_t aRouterId, otRouterInfo *aRouterInfo )
ฟังก์ชันนี้จะเก็บข้อมูลการวินิจฉัยสำหรับเราเตอร์เทรดที่ระบุ
| รายละเอียด | |||||||
|---|---|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||||
| แสดงผลค่า |
|
||||||
otThreadGetRouterSelectionJitter
uint8_t otThreadGetRouterSelectionJitter( otInstance *aInstance )
รับพารามิเตอร์ ROUTER_SELECTION_JITTER ที่ใช้ในบทบาท REED/เราเตอร์
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ค่า ROUTER_SELECTION_JITTER
|
||
otThreadSetRouterSelectionJitter
otThreadGetRouterUpgradeThreshold
uint8_t otThreadGetRouterUpgradeThreshold( otInstance *aInstance )
รับพารามิเตอร์ ROUTER_UPGRADE_THRESHOLD ที่ใช้ในบทบาท REED
| รายละเอียด | |||
|---|---|---|---|
| พารามิเตอร์ |
|
||
| การส่งคืน |
ค่า ROUTER_UPGRADE_THRESHOLD
|
||
otThreadSetRouterUpgradeThreshold
otThreadIsRouterEligible
bool otThreadIsRouterEligible( otInstance *aInstance )
ระบุว่าอุปกรณ์มีสิทธิ์ใช้เราเตอร์หรือไม่
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadIsRouterIdAllocated
bool otThreadIsRouterIdAllocated( otInstance *aInstance, uint8_t aRouterId )
ระบุว่ามีการจัดสรรรหัสเราเตอร์ในปัจจุบันหรือไม่
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadRegisterNeighborTableCallback
void otThreadRegisterNeighborTableCallback( otInstance *aInstance, otNeighborTableCallback aCallback )
ลงทะเบียนฟังก์ชันเรียกกลับของตารางใกล้เคียง
ระบบจะเรียกใช้โค้ดเรียกกลับที่ระบุ (หากไม่ใช่ NULL) เมื่อมีการเปลี่ยนแปลงในตารางใกล้เคียง (เช่น เพิ่ม/นำรายการใกล้เคียงของเราเตอร์ออก หรือมีการเปลี่ยนแปลงโหมดย่อยที่มีอยู่)
การเรียกวิธีนี้ครั้งต่อๆ ไปจะเป็นการเขียนทับโค้ดเรียกกลับก่อนหน้านี้ โปรดทราบว่าจะมีการเรียกใช้โค้ดเรียกกลับนี้ขณะที่มีการอัปเดตตารางใกล้เคียง/ย่อย และอยู่ก่อน otStateChangedCallback เสมอ
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadReleaseRouterId
otError otThreadReleaseRouterId( otInstance *aInstance, uint8_t aRouterId )
ปล่อยรหัสเราเตอร์ที่อุปกรณ์ได้รับการจัดสรรในบทบาทผู้นำ
| รายละเอียด | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||||||
| แสดงผลค่า |
|
||||||||
otThreadSetCcmEnabled
void otThreadSetCcmEnabled( otInstance *aInstance, bool aEnabled )
ตั้งค่าว่าอุปกรณ์ได้รับการว่าจ้างให้ใช้ CCM หรือไม่
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadSetChildRouterLinks
otError otThreadSetChildRouterLinks( otInstance *aInstance, uint8_t aChildRouterLinks )
ตั้งค่าพารามิเตอร์ MLE_CHILD_ROUTER_LINKS ที่ใช้ในบทบาท REED
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadGetChildRouterLinks
otThreadSetContextIdReuseDelay
void otThreadSetContextIdReuseDelay( otInstance *aInstance, uint32_t aDelay )
ตั้งค่าพารามิเตอร์ CONTEXT_ID_REUSE_DELAY ที่ใช้ในบทบาทผู้นำ
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadGetContextIdReuseDelay
otThreadSetDeviceProperties
void otThreadSetDeviceProperties( otInstance *aInstance, const otDeviceProperties *aDeviceProperties )
ตั้งค่าคุณสมบัติของอุปกรณ์ที่จะใช้กำหนดและกำหนดน้ำหนักตัวนำ
ต้องใช้ OPENTHREAD_CONFIG_MLE_DEVICE_PROPERTY_LEADER_WEIGHT_ENABLE
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadSetJoinerUdpPort
otError otThreadSetJoinerUdpPort( otInstance *aInstance, uint16_t aJoinerUdpPort )
ตั้งค่าพอร์ต Joiner UDP
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadGetJoinerUdpPort
otThreadSetLocalLeaderWeight
void otThreadSetLocalLeaderWeight( otInstance *aInstance, uint8_t aWeight )
ตั้งค่าน้ำหนักของตัวนำเทรดที่ใช้เมื่อทำงานในบทบาทผู้นำ
ตั้งค่าน้ำหนักของผู้นำเป็นค่าใหม่โดยตรง โดยแทนที่ค่าก่อนหน้า (ซึ่งอาจกำหนดจาก otDeviceProperties ปัจจุบัน)
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadGetLeaderWeight
otThreadSetMaxAllowedChildren
otError otThreadSetMaxAllowedChildren( otInstance *aInstance, uint16_t aMaxChildren )
ตั้งค่าจำนวนสูงสุดของเด็กที่อนุญาตในปัจจุบัน
ตั้งค่าพารามิเตอร์นี้ได้เมื่อหยุดการทำงานของโปรโตคอลเทรดแล้วเท่านั้น
| รายละเอียด | |||||||
|---|---|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||||
| แสดงผลค่า |
|
||||||
otThreadGetMaxAllowedChildren
otThreadSetMaxChildIpAddresses
otError otThreadSetMaxChildIpAddresses( otInstance *aInstance, uint8_t aMaxIpAddresses )
ตั้งค่าหรือกู้คืนจำนวนที่อยู่ IP สูงสุดที่ผู้เผยแพร่โฆษณาย่อย MTD แต่ละรายอาจลงทะเบียนกับอุปกรณ์นี้ในฐานะระดับบนสุด
ผ่าน 0 เพื่อล้างการตั้งค่าและคืนค่าเริ่มต้น
ใช้งานได้เมื่อเปิดใช้ OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadGetMaxChildIpAddresses
otThreadSetNetworkIdTimeout
void otThreadSetNetworkIdTimeout( otInstance *aInstance, uint8_t aTimeout )
ตั้งค่าพารามิเตอร์ NETWORK_ID_TIMEOUT
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadGetNetworkIdTimeout
otThreadSetParentPriority
otError otThreadSetParentPriority( otInstance *aInstance, int8_t aParentPriority )
กำหนดลำดับความสำคัญของผู้ปกครอง
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadGetParentPriority
otThreadSetPreferredLeaderPartitionId
void otThreadSetPreferredLeaderPartitionId( otInstance *aInstance, uint32_t aPartitionId )
ตั้งค่ารหัสพาร์ติชันของผู้นำเทรดที่ต้องการเมื่อใช้ในบทบาทผู้นำ
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadSetPreferredRouterId
otError otThreadSetPreferredRouterId( otInstance *aInstance, uint8_t aRouterId )
ตั้งค่ารหัสเราเตอร์ที่ต้องการ
เมื่อได้เป็นเราเตอร์/ผู้นำ โหนดจะพยายามใช้รหัสเราเตอร์นี้ หากไม่ได้กำหนดรหัสเราเตอร์ที่ต้องการหรือไม่สามารถใช้ได้ ระบบจะเลือกรหัสเราเตอร์ที่สร้างขึ้นแบบสุ่ม ตั้งค่าพร็อพเพอร์ตี้นี้ได้เฉพาะเมื่อปลดหรือปิดใช้บทบาทในอุปกรณ์เท่านั้น
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadSetPskc
otError otThreadSetPskc( otInstance *aInstance, const otPskc *aPskc )
ตั้งค่าเทรด PSKc
จะสำเร็จก็ต่อเมื่อปิดใช้โปรโตคอลเทรด การเรียกใช้ฟังก์ชันนี้ที่สำเร็จจะทำให้ชุดข้อมูลการทำงานที่ใช้งานอยู่และรอดำเนินการในหน่วยความจำที่ไม่ผันผวนด้วย
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadGetPskc
otThreadSetPskcRef
otError otThreadSetPskcRef( otInstance *aInstance, otPskcRef aKeyRef )
ตั้งค่าการอ้างอิงคีย์เป็นเทรด PSKc
ต้องเปิดใช้ฟีเจอร์ OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE เวอร์ชันสำหรับบิวด์
จะสำเร็จก็ต่อเมื่อปิดใช้โปรโตคอลเทรด เมื่อเสร็จสิ้น การดำเนินการนี้จะทำให้ชุดข้อมูลการทำงานที่ใช้งานอยู่และรอดำเนินการในหน่วยความจำที่ไม่ผันผวนด้วย
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadGetPskcRef
otThreadSetRouterDowngradeThreshold
void otThreadSetRouterDowngradeThreshold( otInstance *aInstance, uint8_t aThreshold )
ตั้งค่าพารามิเตอร์ ROUTER_DOWNGRADE_THRESHOLD ที่ใช้ในบทบาทผู้นำ
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadGetRouterDowngradeThreshold
otThreadSetRouterEligible
otError otThreadSetRouterEligible( otInstance *aInstance, bool aEligible )
ตั้งค่าว่าอุปกรณ์มีสิทธิ์ใช้เราเตอร์หรือไม่
หากตั้งค่า aEligible เป็น "เท็จ" และอุปกรณ์ทำงานเป็นเราเตอร์อยู่ การเรียกนี้จะทำให้อุปกรณ์ถอดออกและพยายามเชื่อมต่อใหม่เมื่อเป็นเด็ก
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
| แสดงผลค่า |
|
||||
otThreadSetRouterIdRange
otError otThreadSetRouterIdRange( otInstance *aInstance, uint8_t aMinRouterId, uint8_t aMaxRouterId )
ตั้งค่าช่วงของรหัสเราเตอร์ที่ได้รับอนุญาตให้กำหนดให้กับโหนดภายในเครือข่ายเทรด
| รายละเอียด | |||||||
|---|---|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||||
| แสดงผลค่า |
|
||||||
otThreadGetRouterIdRange
otThreadSetRouterSelectionJitter
void otThreadSetRouterSelectionJitter( otInstance *aInstance, uint8_t aRouterJitter )
ตั้งค่าพารามิเตอร์ ROUTER_SELECTION_JITTER ที่ใช้ในบทบาท REED/เราเตอร์
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadGetRouterSelectionJitter
otThreadSetRouterUpgradeThreshold
void otThreadSetRouterUpgradeThreshold( otInstance *aInstance, uint8_t aThreshold )
ตั้งค่าพารามิเตอร์ ROUTER_UPGRADE_THRESHOLD ที่ใช้ในบทบาทผู้นำ
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadGetRouterUpgradeThreshold
otThreadSetSteeringData
void otThreadSetSteeringData( otInstance *aInstance, const otExtAddress *aExtAddress )
ตั้งค่าข้อมูลพวงมาลัยอยู่นอกย่านความถี่
ควรตั้งค่าตัวเลือกการกำหนดค่า OPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE เพื่อเปิดใช้การตั้งค่าการส่งข้อมูลนอกย่านความถี่
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
otThreadSetThreadVersionCheckEnabled
void otThreadSetThreadVersionCheckEnabled( otInstance *aInstance, bool aEnabled )
กำหนดว่าจะเปิดใช้เกณฑ์เวอร์ชัน TLV ของนโยบายความปลอดภัยสำหรับการกำหนดเส้นทาง (ฟิลด์ VR) หรือไม่
| รายละเอียด | |||||
|---|---|---|---|---|---|
| พารามิเตอร์ |
|
||||
มาโคร
OT_CHILD_IP6_ADDRESS_ITERATOR_INIT
OT_CHILD_IP6_ADDRESS_ITERATOR_INIT 0
Initializer สำหรับ otChildIP6AddressIterator
แหล่งข้อมูล
หัวข้ออ้างอิง API ของ OpenThread จะมาจากซอร์สโค้ดซึ่งพร้อมใช้งานใน GitHub ดูข้อมูลเพิ่มเติมหรือมีส่วนร่วมในเอกสารประกอบของเราได้ที่แหล่งข้อมูล