Peer-to-Peer
This module includes provisional functions for the Thread P2P link.
Summary
Enumerations |
|
---|---|
otP2pEvent{
|
enum Defines events of the P2P link. |
Typedefs |
|
---|---|
otP2pEvent
|
typedefenum otP2pEvent
Defines events of the P2P link. |
otP2pEventCallback)(otP2pEvent aEvent, const otExtAddress *aExtAddress, void *aContext)
|
typedefvoid(*
Callback function pointer to signal events of the P2P link. |
otP2pLinkDoneCallback)(void *aContext)
|
typedefvoid(*
Notifies the caller that the P2P link establishment process has ended. |
otP2pRequest
|
typedefstruct otP2pRequest
Represents a request for establishing P2P links. |
Functions |
|
---|---|
otP2pSetEventCallback(otInstance *aInstance, otP2pEventCallback aCallback, void *aContext)
|
void
Sets the callback function to notify event changes of P2P links.
|
otP2pWakeupAndLink(otInstance *aInstance, const otP2pRequest *aP2pRequest, otP2pLinkDoneCallback aCallback, void *aContext)
|
Attempts to wake up peers and establish P2P links with peers.
|
Structs |
|
---|---|
otP2pRequest |
Represents a request for establishing P2P links. |
Enumerations
otP2pEvent
otP2pEvent
Typedefs
otP2pEventCallback
void(* otP2pEventCallback)(otP2pEvent aEvent, const otExtAddress *aExtAddress, void *aContext)
Callback function pointer to signal events of the P2P link.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otP2pLinkDoneCallback
void(* otP2pLinkDoneCallback)(void *aContext)
Notifies the caller that the P2P link establishment process has ended.
Details | |||
---|---|---|---|
Parameters |
|
Functions
otP2pSetEventCallback
void otP2pSetEventCallback( otInstance *aInstance, otP2pEventCallback aCallback, void *aContext )
Sets the callback function to notify event changes of P2P links.
A subsequent call to this function will replace any previously set callback.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otP2pWakeupAndLink
otError otP2pWakeupAndLink( otInstance *aInstance, const otP2pRequest *aP2pRequest, otP2pLinkDoneCallback aCallback, void *aContext )
Attempts to wake up peers and establish P2P links with peers.
If the aP2pRequest
indicates a group wake-up, this method establishes multiple P2P links with peers. Otherwise, it establishes at most one P2P link.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
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.