Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
server._on_TransferSubscriptionsRequest =(message /* :Message*/, channel/*: ServerSecureChannelLayer*/) => {
const response = new opcua.TransferSubscriptionsResponse({
responseHeader: { serviceResult: opcua.StatusCodes.BadNotImplemented }
});
return channel.send_response("MSG", response, message);
}
"use strict";
const chalk = require("chalk");
const _ = require("underscore");
const assert = require("node-opcua-assert").assert;
const opcua = require("node-opcua");
const StatusCodes = opcua.StatusCodes;
const DataType = opcua.DataType;
const standardUnits = opcua.standardUnits;
const doDebug = false;
/**
* @method createHVACSystem
*
* @startuml
*
* class HVACModuleType {
* }
* HVACModuleType -up-> ObjectType
* HVACModuleType o-down-> ExteriorTemperatureSensor << (P,#F0F0FF)TemperatureSensorType >>
* HVACModuleType o-down-> InteriorTemperatureSensor << (P,#F0F0FF)TemperatureSensorType >>
* HVACModuleType o-down-> TargetTemperature << (P,#F0F0FF)TemperatureSensorType >>
method.bindMethod((inputArguments,context,callback) => {
const nbBarks = inputArguments[0].value;
const volume = inputArguments[1].value;
console.log("Hello World ! I will bark ",nbBarks," times");
console.log("the requested volume is ",volume,"");
const sound_volume = Array(volume).join("!");
const barks = [];
for(let i=0; i < nbBarks; i++){
barks.push("Whaff" + sound_volume);
}
const callMethodResult = {
statusCode: opcua.StatusCodes.Good,
outputArguments: [{
dataType: opcua.DataType.String,
arrayType: opcua.VariantArrayType.Array,
value :barks
}]
};
callback(null,callMethodResult);
});
set: function (variant) {
variable2 = parseFloat(variant.value);
return opcua.StatusCodes.Good;
}
}
function extract_value(dataType,city_name,property) {
const city = city_data_map[city_name];
if (!city) {
return opcua.StatusCodes.BadDataUnavailable
}
const value = city[property];
return new opcua.Variant({dataType, value: value });
}
set: function (variant) {
variable1 = parseFloat(variant.value);
return opcua.StatusCodes.Good;
}
}
set: function (variant) {
modbushandler.WriteValue(type, StartAddress +i,variant);
return opcua.StatusCodes.Good;
}
}
session.read({ nodeId: nodeId, attributeId: AttributeIds.BrowseName},function(err, dataValue) {
if (!err) {
if (dataValue.statusCode === opcua.StatusCodes.Good) {
assert(dataValue.statusCode === opcua.StatusCodes.Good);
const browseName = dataValue.value.value.name;
return callback(null,browseName);
}
}
callback(err,"");
});
}
async function getBrowseName(session, nodeId) {
const dataValue = await session.read({ nodeId: nodeId, attributeId: AttributeIds.BrowseName });
if (dataValue.statusCode === opcua.StatusCodes.Good) {
return dataValue.value.value.name;
}
return null;
}