Problem with arguments to extension script

Marc Priebee Marc.Priebee at spark.co.nz
Mon Mar 13 22:38:14 EDT 2017


Hi,

I'm having a problem with passing arguments into an extension script from a provision.

In the provision, I have...
let serial = declare("InternetGatewayDevice.DeviceInfo.SerialNumber", {value: 1});
let remoteID = serial.value[0];
let updAttributes = {
  remoteID: remoteID,
  DeviceRadio: null,
  VoiceProfile: null
};
....
updAttributes.deviceRadio = radioRSRP.value[0]+"#"+radioRSRQ.value[0]+"#"+radioRSSI.value[0];
let resp = ext("EID", "set", updAttributes)

And in the extension (EID, set function)
function set(updAttributes, callback) {

        console.log("** DEBUG ** in EID set for updAttributes="+JSON.stringify(updAttributes));
        callback(null, updateAttributes.remoteID);

}

What gets logged is
** DEBUG ** in EID set for updAttributes=["[object Object]"]

I've tried change the JSON.stringify in the script to String(updAttributes) and also combining the JSON.stringify and String, but I cannot seem to get access to the updAttributes object.

I also noted that if I passed 2 arguments such as let resp = ext("EID", "set", remoteID, updAttributes), they appear in the script as a single argument..something like this;
BoLTE2799000000,[object Object]
In the first parameter of the function

Marc





This communication, including any attachments, is confidential. If you are not the intended recipient, you should not read it - please contact me immediately, destroy it, and do not copy or use any part of this communication or disclose anything about it. Thank you. Please note that this communication does not designate an information system for the purposes of the Electronic Transactions Act 2002.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20170314/b21cda6e/attachment.html>


More information about the Users mailing list