Skip to content

ContentType seems to confuse OPC UA #1400

@danielpeintner

Description

@danielpeintner

The following code tries to read an OPC UA property

const read1 = await thing.readProperty("1:Speed");
console.log("speed value is: ", await read1.value());

with the following TD

              "properties": {
                  "1:Speed": {
                      "title": "Speed",
                      "type": "number",
                      "forms": [
                          {
                              "href": "/?id=ns=1;s=MotorSpeed"
                          }
                      ],
                      "observable": true
                  }
             }

everything works fine while adding a "contentType": "application/octet-stream" which looks like this breaks it.

              "properties": {
                  "1:Speed": {
                      "title": "Speed",
                      "type": "number",
                      "forms": [
                          {
                              "href": "/?id=ns=1;s=MotorSpeed",
                              "contentType": "application/octet-stream"
                          }
                      ],
                      "observable": true
                  }
             }

fails with

TypeError: dataType.toLowerCase is not a function
at OctetstreamCodec.valueToBytes 

This seems to indicate that OPC UA data is processed by OctetstreamCodec also (again?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    binding-opcuaIssues related to opc ua protocol binding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions