From e0d01b3e38b18af32e4456191605320224fe9fe0 Mon Sep 17 00:00:00 2001
From: Ben Francis WebSocket Messages
PropertyAffordance
Consumer ➡ Thing
+
+
+ writeProperty
Set the value of a property
+ PropertyAffordance
+ Consumer ➡ Thing
+
- propertyReading
A property reading from a Thing
@@ -347,7 +353,7 @@ readProperty
+
{
"thingID": "https://mythingserver.com/things/mylamp1",
"messageID": "c370da58-69ae-4e83-bb5a-ac6cfb2fed54",
@@ -361,6 +367,67 @@
href="propertyReading">readProperty
propertyReading
message in response, containing its current value.
writeProperty
To set the value of a Property of a Thing, a Consumer MUST send a message to the Thing which contains the following members:
+Member | +Type | +Assignment | +Description | +
---|---|---|---|
messageType |
+ string | +"writeProperty" | +A string which denotes that this message is requesting a writeproperty operation. |
+
name |
+ string | +Mandatory | +The name of the Property whose value should be set, as per its key in the
+ properties member of the Thing Description.
+ |
+
value |
+ any | +Mandatory | +The desired new value of the Property, with a format conforming to the data schema of the + corresponding PropertyAffordance in the Thing Description. | +
+ { + "thingID": "https://mythingserver.com/things/mylamp1", + "messageID": "adbefb2c-9c10-4a9e-b2d5-840a58ab667e", + "messageType": "writeProperty", + "name": "on", + "value": true, + "correlationID": "b737e900-2b34-4315-bf9e-9eec1a0406c0" + } ++
When a Thing receives a writeProperty
message from a Consumer, then upon
+ successfully writing the value of the corresponding Property it SHOULD send a propertyReading
message in response, containing its updated value.
+
In some cases it may not be possible for an underlying
+ implementation to confirm that a value has been written. The writeOnly
member of a
+ PropertyAffordance being set to true
may hint that this is the case. For this reason, a
+ Consumer should not necessarily assume that a writeproperty
operation is unsuccessful if
+ no propertyReading
message is received in response.
+
propertyReading
To notify a Consumer of the value of a Property, a Thing MUST send a @@ -411,10 +478,10 @@
propertyReading
If a propertyReading
message is sent in response to a readProperty
, readAllProperties
,
- observeProperty
or observeAllProperties
message which contained a
- correlatonID
member, then the response message SHOULD also include a correlationID
- member with the same value.
+ href="#readProperty">readProperty
, writeProperty
,
+ readAllProperties
, observeProperty
or observeAllProperties
message
+ which contained a correlatonID
member, then the response message SHOULD also include a
+ correlationID
member with the same value.
{