nl::Weave::Profiles::Heartbeat::WeaveHeartbeatSender
Stay organized with collections
Save and categorize content based on your preferences.
#include <src/lib/profiles/heartbeat/WeaveHeartbeat.h>
Weave Heartbeat Sender class.
Summary
Constructors and Destructors |
|
---|---|
WeaveHeartbeatSender(void)
|
Public types |
|
---|---|
EventCallback)(void *appState, EventType eventType, const InEventParam &inParam, OutEventParam &outParam)
|
typedefvoid(*
|
EventType{
|
enum |
Public attributes |
|
---|---|
AppState
|
void *
|
Public functions |
|
---|---|
GetBinding() const
|
Binding *
Get the binding object associated with heartbeat sender.
|
GetConfiguration(uint32_t & interval, uint32_t & phase, uint32_t & window) const
|
void
Get heartbeat timing configuration.
|
GetEventCallback() const
|
EventCallback
Returns the function that will be called to notify the application of events or changes that occur in the WeaveHeartbeatSender.
|
GetRequestAck() const
|
bool
Returns a flag indicating whether heartbeat messages will be sent reliably using Weave Reliable Messaging.
|
GetSubscriptionState() const
|
uint8_t
Get the current subscription state value.
|
Init(WeaveExchangeManager *exchangeMgr, Binding *binding, EventCallback eventCallback, void *appState)
|
Initialize the Weave Heartbeat Sender.
|
ScheduleHeartbeat(void)
|
Schedule sending Weave Heartbeat messages.
|
SendHeartbeatNow(void)
|
Send a Weave Heartbeat message now.
|
SetConfiguration(uint32_t interval, uint32_t phase, uint32_t window)
|
void
Set heartbeat timing configuration.
|
SetEventCallback(EventCallback eventCallback)
|
void
Sets the function that will be called to notify the application of events or changes that occur in the WeaveHeartbeatSender.
|
SetRequestAck(bool val)
|
void
Sets a flag indicating whether heartbeat messages should be sent reliably using Weave Reliable Messaging.
|
SetSubscriptionState(uint8_t val)
|
void
Set the current subscription state.
|
Shutdown(void)
|
Shutdown the Weave Heartbeat Sender.
|
StartHeartbeat(void)
|
Start sending Weave Heartbeat messages.
|
StopHeartbeat(void)
|
Stop sending Weave Heartbeat messages.
|
Public static functions |
|
---|---|
DefaultEventHandler(void *appState, EventType eventType, const InEventParam & inParam, OutEventParam & outParam)
|
void
Default handler function for WeaveHeartbeatSender API events.
|
Structs |
|
---|---|
nl:: |
Input parameters to WeaveHeartbeatSender API event. |
nl:: |
Output parameters to WeaveHeartbeatSender API event. |
Public types
EventCallback
void(* EventCallback)(void *appState, EventType eventType, const InEventParam &inParam, OutEventParam &outParam)
EventType
EventType
Properties | |
---|---|
kEvent_DefaultCheck
|
Used to verify correct default event handling in the application. Applications should NOT expressly handle this event. |
kEvent_HeartbeatFailed
|
A heartbeat message failed to be sent to the peer. |
kEvent_HeartbeatSent
|
A heartbeat message was successfully sent to the peer. If reliable transmission is enabled, this event indicates that the message was acknowledged. |
kEvent_UpdateSubscriptionState
|
The application is requested to update the subscription state. |
Public attributes
AppState
void * AppState
Public functions
GetConfiguration
void GetConfiguration( uint32_t & interval, uint32_t & phase, uint32_t & window ) const
Get heartbeat timing configuration.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
GetEventCallback
EventCallback GetEventCallback() const
Returns the function that will be called to notify the application of events or changes that occur in the WeaveHeartbeatSender.
GetRequestAck
bool GetRequestAck() const
Returns a flag indicating whether heartbeat messages will be sent reliably using Weave Reliable Messaging.
GetSubscriptionState
uint8_t GetSubscriptionState() const
Get the current subscription state value.
Init
WEAVE_ERROR Init( WeaveExchangeManager *exchangeMgr, Binding *binding, EventCallback eventCallback, void *appState )
Initialize the Weave Heartbeat Sender.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
ScheduleHeartbeat
WEAVE_ERROR ScheduleHeartbeat( void )
Schedule sending Weave Heartbeat messages.
Details | |||||
---|---|---|---|---|---|
Return Values |
|
SendHeartbeatNow
WEAVE_ERROR SendHeartbeatNow( void )
Send a Weave Heartbeat message now.
Details | |||||
---|---|---|---|---|---|
Return Values |
|
SetConfiguration
void SetConfiguration( uint32_t interval, uint32_t phase, uint32_t window )
SetEventCallback
void SetEventCallback( EventCallback eventCallback )
Sets the function that will be called to notify the application of events or changes that occur in the WeaveHeartbeatSender.
SetRequestAck
void SetRequestAck( bool val )
Sets a flag indicating whether heartbeat messages should be sent reliably using Weave Reliable Messaging.
Note that this flag is only meaningful when using UDP as a transport.
Details | |||
---|---|---|---|
Parameters |
|
SetSubscriptionState
void SetSubscriptionState( uint8_t val )
Set the current subscription state.
Details | |||
---|---|---|---|
Parameters |
|
Shutdown
WEAVE_ERROR Shutdown( void )
StartHeartbeat
WEAVE_ERROR StartHeartbeat( void )
Start sending Weave Heartbeat messages.
Details | |||||
---|---|---|---|---|---|
Return Values |
|
StopHeartbeat
WEAVE_ERROR StopHeartbeat( void )
WeaveHeartbeatSender
WeaveHeartbeatSender( void )
Public static functions
DefaultEventHandler
void DefaultEventHandler( void *appState, EventType eventType, const InEventParam & inParam, OutEventParam & outParam )
Default handler function for WeaveHeartbeatSender API events.
Applications must call this function for any API events that they don't handle.