-
Notifications
You must be signed in to change notification settings - Fork 2
Changed links in forms #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,7 +197,7 @@ class ThingAction { | |
// 2.11 Action object: A links array (An array of Link objects linking | ||
// to one or more representations of an Action resource, each with an | ||
// implied default rel=action.) | ||
JsonArray inline_links = obj.createNestedArray("links"); | ||
JsonArray inline_links = obj.createNestedArray("forms"); | ||
JsonObject inline_links_prop = inline_links.createNestedObject(); | ||
inline_links_prop["href"] = "/things/" + deviceId + "/actions/" + id; | ||
} | ||
|
@@ -297,7 +297,7 @@ class ThingItem { | |
// 2.9 Property object: A links array (An array of Link objects linking | ||
// to one or more representations of a Property resource, each with an | ||
// implied default rel=property.) | ||
JsonArray inline_links = obj.createNestedArray("links"); | ||
JsonArray inline_links = obj.createNestedArray("forms"); | ||
JsonObject inline_links_prop = inline_links.createNestedObject(); | ||
inline_links_prop["href"] = | ||
"/things/" + deviceId + "/" + resourceType + "/" + id; | ||
|
@@ -461,7 +461,7 @@ class ThingEventObject { | |
break; | ||
} | ||
|
||
data["timestamp"] = timestamp; | ||
//data["timestamp"] = timestamp; | ||
} | ||
}; | ||
|
||
|
@@ -695,10 +695,10 @@ class ThingDevice { | |
#endif | ||
} | ||
|
||
void serialize(JsonObject descr, String ip, uint16_t port) { | ||
void serialize(JbsonObject descr, String ip, uint16_t port) { | ||
descr["id"] = this->id; | ||
descr["title"] = this->title; | ||
descr["@context"] = "https://webthings.io/schemas"; | ||
descr["@context"] = " https://www.w3.org/2019/wot/td/v1"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The correct value should be: |
||
|
||
if (this->description != "") { | ||
descr["description"] = this->description; | ||
|
@@ -723,17 +723,15 @@ class ThingDevice { | |
typeJson.add(*type); | ||
type++; | ||
} | ||
|
||
JsonArray links = descr.createNestedArray("links"); | ||
/* | ||
JsonArray links = descr.createNestedArray("forms"); | ||
{ | ||
JsonObject links_prop = links.createNestedObject(); | ||
links_prop["rel"] = "properties"; | ||
links_prop["href"] = "/things/" + this->id + "/properties"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can already be described in the TD the |
||
} | ||
|
||
{ | ||
JsonObject links_prop = links.createNestedObject(); | ||
links_prop["rel"] = "actions"; | ||
links_prop["href"] = "/things/" + this->id + "/actions"; | ||
} | ||
|
||
|
@@ -742,11 +740,12 @@ class ThingDevice { | |
links_prop["rel"] = "events"; | ||
links_prop["href"] = "/things/" + this->id + "/events"; | ||
} | ||
*/ | ||
|
||
#ifndef WITHOUT_WS | ||
{ | ||
JsonObject links_prop = links.createNestedObject(); | ||
links_prop["rel"] = "alternate"; | ||
//links_prop["rel"] = "alternate"; | ||
|
||
if (port != 80) { | ||
char buffer[33]; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,7 +308,7 @@ class WebThingAdapter { | |
handleError(); | ||
} | ||
return; | ||
} else if (uri == deviceBase + "/properties") { | ||
} /*else if (uri == deviceBase + "/properties") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment above |
||
if (method == HTTP_GET || method == HTTP_OPTIONS) { | ||
handleThingPropertiesGet(device->firstProperty); | ||
} else { | ||
|
@@ -330,7 +330,7 @@ class WebThingAdapter { | |
} else { | ||
handleError(); | ||
} | ||
return; | ||
return;*/ | ||
} else { | ||
ThingProperty *property = device->firstProperty; | ||
while (property != nullptr) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can leave this, at least I don't see any immediate problems with having it.