TREL - Thread Stack
This module defines Thread Radio Encapsulation Link (TREL) APIs for Thread Over Infrastructure.
Summary
The functions in this module require OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
to be enabled.
Typedefs |
|
---|---|
otTrelCounters
|
typedef Represents a group of TREL related counters. |
otTrelPeer
|
typedefstruct otTrelPeer
Represents a TREL peer. |
otTrelPeerIterator
|
typedefuint16_t
Represents an iterator for iterating over TREL peer table entries. |
Functions |
|
---|---|
otTrelGetCounters(otInstance *aInstance)
|
const otTrelCounters *
Gets the TREL counters.
|
otTrelGetNextPeer(otInstance *aInstance, otTrelPeerIterator *aIterator)
|
const otTrelPeer *
Iterates over the peer table entries and get the next entry from the table.
|
otTrelGetNumberOfPeers(otInstance *aInstance)
|
uint16_t
Returns the number of TREL peers.
|
otTrelGetUdpPort(otInstance *aInstance)
|
uint16_t
Gets the UDP port of the TREL interface.
|
otTrelInitPeerIterator(otInstance *aInstance, otTrelPeerIterator *aIterator)
|
void
Initializes a peer table iterator.
|
otTrelIsEnabled(otInstance *aInstance)
|
bool
Indicates whether the TREL operation is enabled.
|
otTrelIsFilterEnabled(otInstance *aInstance)
|
bool
Indicates whether or not the filter mode is enabled.
|
otTrelResetCounters(otInstance *aInstance)
|
void
Resets the TREL counters.
|
otTrelSetEnabled(otInstance *aInstance, bool aEnable)
|
void
Enables or disables TREL operation.
|
otTrelSetFilterEnabled(otInstance *aInstance, bool aEnable)
|
void
Sets the filter mode (enables/disables filtering).
|
Structs |
|
---|---|
otTrelPeer |
Represents a TREL peer. |
Typedefs
otTrelPeerIterator
uint16_t otTrelPeerIterator
Represents an iterator for iterating over TREL peer table entries.
Functions
otTrelGetCounters
const otTrelCounters * otTrelGetCounters( otInstance *aInstance )
Gets the TREL counters.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the TREL counters.
|
otTrelGetNextPeer
const otTrelPeer * otTrelGetNextPeer( otInstance *aInstance, otTrelPeerIterator *aIterator )
Iterates over the peer table entries and get the next entry from the table.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to the next
otTrelPeer entry or NULL if no more entries in the table. |
otTrelGetNumberOfPeers
uint16_t otTrelGetNumberOfPeers( otInstance *aInstance )
Returns the number of TREL peers.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The number of TREL peers.
|
otTrelGetUdpPort
uint16_t otTrelGetUdpPort( otInstance *aInstance )
Gets the UDP port of the TREL interface.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
UDP port of the TREL interface.
|
otTrelInitPeerIterator
void otTrelInitPeerIterator( otInstance *aInstance, otTrelPeerIterator *aIterator )
Initializes a peer table iterator.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otTrelIsEnabled
bool otTrelIsEnabled( otInstance *aInstance )
Indicates whether the TREL operation is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otTrelIsFilterEnabled
bool otTrelIsFilterEnabled( otInstance *aInstance )
Indicates whether or not the filter mode is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otTrelResetCounters
void otTrelResetCounters( otInstance *aInstance )
Resets the TREL counters.
Details | |||
---|---|---|---|
Parameters |
|
otTrelSetEnabled
void otTrelSetEnabled( otInstance *aInstance, bool aEnable )
Enables or disables TREL operation.
When aEnable
is true, this function initiates an ongoing DNS-SD browse on the service name "_trel._udp" within the local browsing domain to discover other devices supporting TREL. Device also registers a new service to be advertised using DNS-SD, with the service name is "_trel._udp" indicating its support for TREL. Device is then ready to receive TREL messages from peers.
When aEnable
is false, this function stops the DNS-SD browse on the service name "_trel._udp", stops advertising TREL DNS-SD service, and clears the TREL peer table.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otTrelSetFilterEnabled
void otTrelSetFilterEnabled( otInstance *aInstance, bool aEnable )
Sets the filter mode (enables/disables filtering).
When filter mode is enabled, any rx and tx traffic through TREL interface is silently dropped. This is mainly intended for use during testing.
Unlike otTrel{Enable/Disable}()
which fully starts/stops the TREL operation, when filter mode is enabled the TREL interface continues to be enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.