Acting as a ResponderListener, instances of this class can formulate appropriate replies to property transactions initiated by remote devices.
More...
|
| | PropertyHost (FunctionBlock fb, PropertyDelegate &d, BufferOutput &o, CacheProvider &p) |
| |
| int | countOngoingTransactions () const |
| | Returns the number of transactions that have been initiated by other devices, but not yet completed, normally because the request has been split into several messages.
|
| |
| std::set< Subscription > | findSubscriptionsForDevice (MUID device) const |
| | Returns a set of subscribed resources.
|
| |
| std::optional< RequestKey > | sendSubscriptionUpdate (MUID device, const PropertySubscriptionHeader &header, Span< const std::byte > body, std::function< void(const PropertyExchangeResult &)> callback) |
| | Sends a "Subscription" message from a device, when acting as a subscription responder.
|
| |
| void | terminateSubscription (MUID device, const String &subscribeId) |
| | Terminates a subscription that was started by a remote device.
|
| |
| bool | tryRespond (ResponderOutput &, const Message::Parsed &) override |
| |
Acting as a ResponderListener, instances of this class can formulate appropriate replies to property transactions initiated by remote devices.
PropertyHost instances also contain methods to inform remote devices about changes to local property state.
Keeps track of property subscriptions requested by remote devices.
@tags{Audio}
Sends a "Subscription" message from a device, when acting as a subscription responder.
You should call this for all registered subscribers whenever the subscribed property is modified in a way that remote devices don't know about (if a remote device requests a property update, there's no need to send a subscription update after changing the property accordingly).
You should not attempt to start a new subscription on another device using this function. Valid subscription commands are "full", "partial", and "notify". Check the property exchange specification for the intended use of these commands.
To terminate a subscription that was initiated by a remote device, use terminateSubscription().
The provided callback will be called once the remote device has confirmed receipt of the subscription update. If the state of your application changes such that you no longer need to respond/wait for confirmation, you can pass the request key to Device::abortPropertyRequest().