js/clients/SparkCore.js
function (name, args) {
        var ready = when.defer();
        var that = this;

        when(this.ensureWeHaveIntrospectionData()).then(
            function () {
                var buf = that._transformArguments(name, args);
                if (buf) {
                    ready.resolve(buf);
                }
                else {
                    //NOTE! The API looks for "Unknown Function" in the error response.
                    ready.reject("Unknown Function: " + name);
                }
            },
            function (msg) {
                ready.reject(msg);
            }
        );

        return ready.promise;
    }
function (name, args) {
        var ready = when.defer();
        var that = this;

        when(this.ensureWeHaveIntrospectionData()).then(
            function () {
                var buf = that._transformArguments(name, args);
                if (buf) {
                    ready.resolve(buf);
                }
                else {
                    //NOTE! The API looks for "Unknown Function" in the error response.
                    ready.reject("Unknown Function: " + name);
                }
            },
            function (msg) {
                ready.reject(msg);
            }
        );

        return ready.promise;
    }
function ( name , args ) { var ready = when . defer ( ) ; var that = this ; when ( this . ensureWeHaveIntrospectionData ( ) ) . then ( function ( ) { var buf = that . _transformArguments ( name , args ) ; if ( buf ) { ready . resolve ( buf ) ; } else { //NOTE! The API looks for "Unknown Function" in the error response. ready . reject ( "Unknown Function: " + name ) ; } } , function ( msg ) { ready . reject ( msg ) ; } ) ; return ready . promise ; }
makes sure we have our introspection data, then transforms our object into
the right coap query string
@param name
@param args
@returns {*}
makes sure we have our introspection data then transforms our object into the right coap query string