diff --git a/Thing.h b/Thing.h index 25a6ea3..d5bb3e8 100644 --- a/Thing.h +++ b/Thing.h @@ -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"; 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"; } { 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]; diff --git a/WiFi101WebThingAdapter.h b/WiFi101WebThingAdapter.h index dc0fc5a..e07b528 100644 --- a/WiFi101WebThingAdapter.h +++ b/WiFi101WebThingAdapter.h @@ -308,7 +308,7 @@ class WebThingAdapter { handleError(); } return; - } else if (uri == deviceBase + "/properties") { + } /*else if (uri == deviceBase + "/properties") { 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) {