nl:: Weave:: WeaveExchangeManager
#include <src/lib/core/WeaveExchangeMgr.h>
This class is used to manage ExchangeContexts with other Weave nodes.
Summary
It works on behalf of higher layers, creating ExchangeContexts and handling the registration/unregistration of unsolicited message handlers.
Constructors and Destructors |
|
---|---|
WeaveExchangeManager(void)
Constructor for the WeaveExchangeManager class.
|
Public types |
|
---|---|
State{
|
enum |
Public attributes |
|
---|---|
FabricState
|
[READ ONLY] The associated FabricState object.
|
MessageLayer
|
[READ ONLY] The associated WeaveMessageLayer object.
|
State
|
uint8_t
[READ ONLY] The state of the WeaveExchangeManager object.
|
Public functions |
|
---|---|
AllowUnsolicitedMessages(WeaveConnection *con)
|
void
Allow unsolicited messages to be received on the specified connection.
|
ClearMsgCounterSyncReq(uint64_t peerNodeId)
|
void
Clear MsgCounterSyncReq flag for all pending messages to that peer.
|
FindContext(uint64_t peerNodeId, WeaveConnection *con, void *appState, bool isInitiator)
|
Find the ExchangeContext from a pool matching a given set of parameters.
|
Init(WeaveMessageLayer *msgLayer)
|
Initialize the WeaveExchangeManager object.
|
NewBinding(Binding::EventCallback eventCallback, void *appState)
|
Binding *
Allocate a new Binding with the arguments supplied.
|
NewContext(const uint64_t & peerNodeId, void *appState)
|
Creates a new ExchangeContext with a given peer Weave node specified by the peer node identifier.
|
NewContext(const uint64_t & peerNodeId, const IPAddress & peerAddr, void *appState)
|
Creates a new ExchangeContext with a given peer Weave node specified by the peer node identifier and peer IP address.
|
NewContext(const uint64_t & peerNodeId, const IPAddress & peerAddr, uint16_t peerPort, InterfaceId sendIntfId, void *appState)
|
Creates a new ExchangeContext with a given peer Weave node specified by the peer node identifier, peer IP address, and destination port on a specified interface.
|
NewContext(WeaveConnection *con, void *appState)
|
Creates a new ExchangeContext with a given peer Weave node over a specified WeaveConnection.
|
RegisterUnsolicitedMessageHandler(uint32_t profileId, ExchangeContext::MessageReceiveFunct handler, void *appState)
|
Register an unsolicited message handler for a given profile identifier.
|
RegisterUnsolicitedMessageHandler(uint32_t profileId, ExchangeContext::MessageReceiveFunct handler, bool allowDups, void *appState)
|
Register an unsolicited message handler for a given profile identifier.
|
RegisterUnsolicitedMessageHandler(uint32_t profileId, uint8_t msgType, ExchangeContext::MessageReceiveFunct handler, void *appState)
|
Register an unsolicited message handler for a given profile identifier and message type.
|
RegisterUnsolicitedMessageHandler(uint32_t profileId, uint8_t msgType, ExchangeContext::MessageReceiveFunct handler, bool allowDups, void *appState)
|
Register an unsolicited message handler for a given profile identifier and message type.
|
RegisterUnsolicitedMessageHandler(uint32_t profileId, uint8_t msgType, WeaveConnection *con, ExchangeContext::MessageReceiveFunct handler, void *appState)
|
Register an unsolicited message handler for a given profile identifier, message type on a specified Weave connection.
|
RegisterUnsolicitedMessageHandler(uint32_t profileId, uint8_t msgType, WeaveConnection *con, ExchangeContext::MessageReceiveFunct handler, bool allowDups, void *appState)
|
Register an unsolicited message handler for a given profile identifier, message type on a specified Weave connection.
|
Shutdown(void)
|
Shutdown the WeaveExchangeManager.
|
UnregisterUnsolicitedMessageHandler(uint32_t profileId)
|
Unregister an unsolicited message handler for a given profile identifier.
|
UnregisterUnsolicitedMessageHandler(uint32_t profileId, uint8_t msgType)
|
Unregister an unsolicited message handler for a given profile identifier and message type.
|
UnregisterUnsolicitedMessageHandler(uint32_t profileId, uint8_t msgType, WeaveConnection *con)
|
Unregister an unsolicited message handler for a given profile identifier, message type, and Weave connection.
|
Public types
State
State
Properties | |
---|---|
kState_Initialized
|
Used to indicate that the WeaveExchangeManager is initialized. |
kState_NotInitialized
|
Used to indicate that the WeaveExchangeManager is not initialized. |
Public attributes
Public functions
AllowUnsolicitedMessages
void AllowUnsolicitedMessages( WeaveConnection *con )
Allow unsolicited messages to be received on the specified connection.
This method sets the message reception handler on the given Weave connection.
Details | |||
---|---|---|---|
Parameters |
|
ClearMsgCounterSyncReq
void ClearMsgCounterSyncReq( uint64_t peerNodeId )
Clear MsgCounterSyncReq flag for all pending messages to that peer.
Details | |||
---|---|---|---|
Parameters |
|
FindContext
ExchangeContext * FindContext( uint64_t peerNodeId, WeaveConnection *con, void *appState, bool isInitiator )
Find the ExchangeContext from a pool matching a given set of parameters.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Returns |
A pointer to the ExchangeContext object matching the provided parameters On success, NULL on no match.
|
Init
WEAVE_ERROR Init( WeaveMessageLayer *msgLayer )
Initialize the WeaveExchangeManager object.
Within the lifetime of this instance, this method is invoked once after object construction until a call to Shutdown is made to terminate the instance.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
NewBinding
Binding * NewBinding( Binding::EventCallback eventCallback, void *appState )
Allocate a new Binding with the arguments supplied.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to the newly allocated Binding, or NULL if the pool has been exhausted
|
NewContext
ExchangeContext * NewContext( const uint64_t & peerNodeId, void *appState )
Creates a new ExchangeContext with a given peer Weave node specified by the peer node identifier.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to the created ExchangeContext object On success. Otherwise NULL if no object can be allocated or is available.
|
NewContext
ExchangeContext * NewContext( const uint64_t & peerNodeId, const IPAddress & peerAddr, void *appState )
Creates a new ExchangeContext with a given peer Weave node specified by the peer node identifier and peer IP address.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
A pointer to the created ExchangeContext object On success. Otherwise, NULL if no object can be allocated or is available.
|
NewContext
ExchangeContext * NewContext( const uint64_t & peerNodeId, const IPAddress & peerAddr, uint16_t peerPort, InterfaceId sendIntfId, void *appState )
Creates a new ExchangeContext with a given peer Weave node specified by the peer node identifier, peer IP address, and destination port on a specified interface.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Returns |
A pointer to the created ExchangeContext object On success. Otherwise, NULL if no object can be allocated or is available.
|
NewContext
ExchangeContext * NewContext( WeaveConnection *con, void *appState )
Creates a new ExchangeContext with a given peer Weave node over a specified WeaveConnection.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to the created ExchangeContext object On success. Otherwise, NULL if no object can be allocated or is available.
|
RegisterUnsolicitedMessageHandler
WEAVE_ERROR RegisterUnsolicitedMessageHandler( uint32_t profileId, ExchangeContext::MessageReceiveFunct handler, void *appState )
Register an unsolicited message handler for a given profile identifier.
This handler would be invoked for all messages of the given profile.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
RegisterUnsolicitedMessageHandler
WEAVE_ERROR RegisterUnsolicitedMessageHandler( uint32_t profileId, ExchangeContext::MessageReceiveFunct handler, bool allowDups, void *appState )
Register an unsolicited message handler for a given profile identifier.
This handler would be invoked for all messages of the given profile.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
RegisterUnsolicitedMessageHandler
WEAVE_ERROR RegisterUnsolicitedMessageHandler( uint32_t profileId, uint8_t msgType, ExchangeContext::MessageReceiveFunct handler, void *appState )
Register an unsolicited message handler for a given profile identifier and message type.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
RegisterUnsolicitedMessageHandler
WEAVE_ERROR RegisterUnsolicitedMessageHandler( uint32_t profileId, uint8_t msgType, ExchangeContext::MessageReceiveFunct handler, bool allowDups, void *appState )
Register an unsolicited message handler for a given profile identifier and message type.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
RegisterUnsolicitedMessageHandler
WEAVE_ERROR RegisterUnsolicitedMessageHandler( uint32_t profileId, uint8_t msgType, WeaveConnection *con, ExchangeContext::MessageReceiveFunct handler, void *appState )
Register an unsolicited message handler for a given profile identifier, message type on a specified Weave connection.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
RegisterUnsolicitedMessageHandler
WEAVE_ERROR RegisterUnsolicitedMessageHandler( uint32_t profileId, uint8_t msgType, WeaveConnection *con, ExchangeContext::MessageReceiveFunct handler, bool allowDups, void *appState )
Register an unsolicited message handler for a given profile identifier, message type on a specified Weave connection.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
Shutdown
WEAVE_ERROR Shutdown( void )
Shutdown the WeaveExchangeManager.
This terminates this instance of the object and releases all held resources.
Details | |
---|---|
Returns |
WEAVE_NO_ERROR unconditionally.
|
UnregisterUnsolicitedMessageHandler
WEAVE_ERROR UnregisterUnsolicitedMessageHandler( uint32_t profileId )
Unregister an unsolicited message handler for a given profile identifier.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
UnregisterUnsolicitedMessageHandler
WEAVE_ERROR UnregisterUnsolicitedMessageHandler( uint32_t profileId, uint8_t msgType )
Unregister an unsolicited message handler for a given profile identifier and message type.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
UnregisterUnsolicitedMessageHandler
WEAVE_ERROR UnregisterUnsolicitedMessageHandler( uint32_t profileId, uint8_t msgType, WeaveConnection *con )
Unregister an unsolicited message handler for a given profile identifier, message type, and Weave connection.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
WeaveExchangeManager
WeaveExchangeManager( void )
Constructor for the WeaveExchangeManager class.
It sets the state to kState_NotInitialized.