IndigoObject.prototype.serialize = function()

in indigo.js [998:1009]


IndigoObject.prototype.serialize = function() {
    this.d._setSessionId();
    let size = alloc('int'); // allocate a 4-byte (32-bit) chunk for the output value
    let pointer = alloc(refType('byte'));
    this.d._checkResult(this.d._lib.indigoSerialize(this.id, pointer, size));
    let buf = readPointer(pointer, 0, size.deref());
    let res = [];
    for (let i = 0; i < size.deref(); i++) {
        res.push(buf[i]);
    }
    return res;
};