Skip to content

Commit

Permalink
feat(binding-coap): remove cov:observe subprotocol
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Aug 12, 2024
1 parent 0eb1d53 commit 47a02d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
16 changes: 3 additions & 13 deletions packages/binding-coap/src/coap-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { MdnsIntroducer } from "./mdns-introducer";
import { PropertyElement, DataSchema, ActionElement, EventElement } from "wot-thing-description-types";
import { CoapServerConfig } from "./coap";
import { DataSchemaValue } from "wot-typescript-definitions";
import { filterPropertyObserveOperations, getPropertyOpValues } from "./util";
import { getPropertyOpValues } from "./util";

const { debug, warn, info, error } = createLoggers("binding-coap", "coap-server");

Expand Down Expand Up @@ -248,23 +248,14 @@ export default class CoapServer implements ProtocolServer {
continue;
}

let subprotocol: string | undefined;

const observeOpValues = filterPropertyObserveOperations(formOpValues);

if (observeOpValues.length > 0) {
subprotocol = "cov:observe";
}

const form = this.createAffordanceForm(
base,
this.PROPERTY_DIR,
offeredMediaType,
formOpValues,
thing.uriVariables,
propertyName,
property.uriVariables,
subprotocol
property.uriVariables
);

this.addFormToAffordance(form, property);
Expand Down Expand Up @@ -299,8 +290,7 @@ export default class CoapServer implements ProtocolServer {
["subscribeevent", "unsubscribeevent"],
thing.uriVariables,
eventName,
event.uriVariables,
"cov:observe"
event.uriVariables
);

this.addFormToAffordance(form, event);
Expand Down
1 change: 0 additions & 1 deletion packages/binding-coap/test/coap-server-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@ class CoapServerTest {

if (observeOpValuePresent) {
observeOpValueFormCount++;
expect(form.subprotocol).to.eql("cov:observe");
}

const readWriteOpValueCount = filterPropertyReadWriteOperations(
Expand Down

0 comments on commit 47a02d7

Please sign in to comment.