nl:: Weave:: Profiles:: DataManagement_Current:: NotificationEngine:: NotifyRequestBuilder
#include <src/lib/profiles/data-management/Current/NotificationEngine.h>
This provides a helper class to compose notifies and abstract away the construction and structure of the message from its consumers.
Summary
This is a more compact version of a similar class provided in MessageDef.cpp that aims to be sensitive to the flash and ram needs of the device.
Public functions |
|
---|---|
Checkpoint(TLV::TLVWriter & aPoint)
|
Checkpoint the request state into a TLVWriter.
|
EndDataList()
|
End the construction of the data list array.
|
EndEventList()
|
End the construction of the event list.
|
EndNotifyRequest()
|
End the construction of the notify.
|
GetWriter(void)
|
|
Init(PacketBuffer *aBuf, TLV::TLVWriter *aWriter, SubscriptionHandler *aSubHandler, uint32_t aMaxPayloadSize)
|
Initializes the builder.
|
MoveToState(NotifyRequestBuilderState aDesiredState)
|
The main state transition function.
|
Rollback(TLV::TLVWriter & aPoint)
|
Rollback the request state into the checkpointed TLVWriter.
|
StartDataList(void)
|
Starts the construction of the data list array.
|
StartEventList()
|
Starts the construction of the event list.
|
StartNotifyRequest()
|
Start the construction of the notify.
|
WriteDataElement(TraitDataHandle aTraitDataHandle, PropertyPathHandle aPropertyPathHandle, SchemaVersion aSchemaVersion, PropertyPathHandle *aMergeDataHandleSet, uint32_t aNumMergeDataHandles, PropertyPathHandle *aDeleteHandleSet, uint32_t aNumDeleteHandles)
|
Given a trait path, write out the data element associated with that path.
|
Public functions
Checkpoint
WEAVE_ERROR Checkpoint( TLV::TLVWriter & aPoint )
Checkpoint the request state into a TLVWriter.
Details | |||
---|---|---|---|
Parameters |
|
||
Return Values |
|
EndDataList
WEAVE_ERROR EndDataList()
End the construction of the data list array.
Details | |||||||
---|---|---|---|---|---|---|---|
Return Values |
|
EndEventList
WEAVE_ERROR EndEventList()
End the construction of the event list.
Details | |||||||
---|---|---|---|---|---|---|---|
Return Values |
|
EndNotifyRequest
WEAVE_ERROR EndNotifyRequest()
End the construction of the notify.
Details | |||||||
---|---|---|---|---|---|---|---|
Return Values |
|
GetWriter
TLV::TLVWriter * GetWriter( void )
Init
WEAVE_ERROR Init( PacketBuffer *aBuf, TLV::TLVWriter *aWriter, SubscriptionHandler *aSubHandler, uint32_t aMaxPayloadSize )
Initializes the builder.
Should only be called once.
Details | |||||
---|---|---|---|---|---|
Return Values |
|
MoveToState
WEAVE_ERROR MoveToState( NotifyRequestBuilderState aDesiredState )
The main state transition function.
The function takes the desired state (i.e., the phase of the notify request builder that we would like to reach), and transitions the request into that state. If the desired state is the same as the current state, the function does nothing. Otherwise, an PacketBuffer is allocated (if needed); the function first transitions the request into the toplevel notify request (either opening the notify request TLV structure, or closing the current TLV data container as needed), and then transitions the Notify request either by opening the appropriate TLV data container or by closing the overarching Notify request.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
Rollback
WEAVE_ERROR Rollback( TLV::TLVWriter & aPoint )
Rollback the request state into the checkpointed TLVWriter.
Details | |||
---|---|---|---|
Parameters |
|
||
Return Values |
|
StartDataList
WEAVE_ERROR StartDataList( void )
Starts the construction of the data list array.
Details | |||||||
---|---|---|---|---|---|---|---|
Return Values |
|
StartEventList
WEAVE_ERROR StartEventList()
Starts the construction of the event list.
Details | |||||||
---|---|---|---|---|---|---|---|
Return Values |
|
StartNotifyRequest
WEAVE_ERROR StartNotifyRequest()
Start the construction of the notify.
Details | |||||||
---|---|---|---|---|---|---|---|
Return Values |
|
WriteDataElement
WEAVE_ERROR WriteDataElement( TraitDataHandle aTraitDataHandle, PropertyPathHandle aPropertyPathHandle, SchemaVersion aSchemaVersion, PropertyPathHandle *aMergeDataHandleSet, uint32_t aNumMergeDataHandles, PropertyPathHandle *aDeleteHandleSet, uint32_t aNumDeleteHandles )
Given a trait path, write out the data element associated with that path.
The caller can also optionally pass in a handle set allows for leveraging the merge operation with a narrower set of immediate child nodes of the parent property path handle.
Details | |||||
---|---|---|---|---|---|
Return Values |
|