Skip to content

Commit

Permalink
docs: update readme with the preferred way of using the interface
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeintner committed Aug 7, 2023
1 parent d16e650 commit 89cb6f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/td-tools/src/util/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ let assetInterfaceDescriptionUtil = new AssetInterfaceDescriptionUtil();

async function example() {
try {
const aid = await fs.readFile("AID_v03_counter.json", {
const aas = await fs.readFile("AID_v03_counter.json", {
encoding: "utf8",
});
// transform AID to WoT TD
let tdAID = assetInterfaceDescriptionUtil.transformToTD(aid, `{"title": "counter"}`);
// Note: transformToTD() may have up to 3 input parameters
// * aid (required): AID input
let tdAID = assetInterfaceDescriptionUtil.transformAAS2TD(aas, `{"title": "counter"}`);
// Note: transformAAS2TD() may have up to 3 input parameters
// * aas (required): AAS in JSON format
// * template (optional): Initial TD template
// * submodelRegex (optional): Submodel filter based on regular expression
// e.g., filtering HTTP only by calling transformToTD(aid, `{}`, "HTTP")
// e.g., filtering HTTP only by calling transformAAS2TD(aas, `{}`, "HTTP")

// do work as usual
const WoT = await servient.start();
Expand Down

0 comments on commit 89cb6f3

Please sign in to comment.