The PLT_StateVariable class maintains the state of a UPnP Service state variable.
More...
#include <PltStateVariable.h>
|
bool | IsReadyToPublish () |
| Return whether the state variable value changed and subscribers need to be notified.
|
|
void | OnSendCompleted () |
| If this statevariable should clear after sending to all subscribers, clears the value without eventing the change.
|
|
NPT_Result | Serialize (NPT_XmlElementNode &node) |
| Serialize the state variable into xml.
|
|
|
class | PLT_Service |
|
class | PLT_LastChangeXMLIterator |
|
The PLT_StateVariable class maintains the state of a UPnP Service state variable.
It is used by a PLT_DeviceHost instance to notify subscribers of a change or by a subscriber (PLT_CtrlPoint) when a service state variable change notification has been received.
◆ Find()
Helper function to return a state variable given a list of state variables and a state variable name.
- Parameters
-
vars | list of state variables |
name | state variable name to look for |
- Returns
- PLT_StateVariable pointer.
◆ GetAllowedValueRange()
Return the state variable allowed value range if any.
- Returns
- state variable value range pointer or null if none.
◆ GetDataType()
const NPT_String& PLT_StateVariable::GetDataType |
( |
| ) |
const |
|
inline |
Return the state variable data type.
- Returns
- state variable data type.
◆ GetName()
const NPT_String& PLT_StateVariable::GetName |
( |
| ) |
const |
|
inline |
Return the state variable name.
- Returns
- state variable name.
◆ GetSCPDXML()
Populate the SCPD xml document with state variable information.
- Parameters
-
node | XML Element where to insert the state variable XML Element |
◆ GetService()
◆ GetValue()
const NPT_String& PLT_StateVariable::GetValue |
( |
| ) |
const |
|
inline |
Return the current state variable value.
- Returns
- state variable current value.
◆ IsSendingEvents()
bool PLT_StateVariable::IsSendingEvents |
( |
bool |
indirectly = false | ) |
|
Return whether the state variable is eventable directly or indirectly.
A state variable sends events indirectly when part of the "LastChange" state variable.
- Parameters
-
indirectly | Boolean to test if the state variable is sending events indirectly |
- Returns
- Whether the state variable sends events according to the input flag specified.
◆ SetExtraAttribute()
NPT_Result PLT_StateVariable::SetExtraAttribute |
( |
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
Certain state variables require extra xml attributes when serialized.
- Parameters
-
name | the attribute name |
value | the attribute value |
◆ SetRate()
Certain state variables notifications must not be sent faster than a certain rate according to the UPnP specs.
This sets the rate for a given state variable.
- Parameters
-
rate | time interval to respect between notifications. |
◆ SetValue()
NPT_Result PLT_StateVariable::SetValue |
( |
const char * |
value, |
|
|
const bool |
clearonsend = false |
|
) |
| |
Set the state variable value.
The value is first validated to make sure it is an allowed value. Once the value is validated, it is marked for eventing by calling the PLT_Service AddChanged function.
- Parameters
-
value | new state variable value. Can be a comma separated list of values. |
clearonsend | whether the statevariable should be cleared immediatly after sending |
◆ ValidateValue()
NPT_Result PLT_StateVariable::ValidateValue |
( |
const char * |
value | ) |
|
Validate the new value of the state variable.
- Parameters
-
value | new state variable value. Can be a comma separated list of values. |
The documentation for this class was generated from the following files:
- lib/libUPnP/Platinum/Source/Core/PltStateVariable.h
- lib/libUPnP/Platinum/Source/Core/PltStateVariable.cpp