Example response for Spark variable?

I’m not sure if i’m doing something wrong but when I make a call to a variable on my spark core, sitting on my desk with breathing cyan (connected) led, I get:

{
    "cmd": "VarReturn",
    "name": "positions",
    "result": [
        16,
        36
    ],
    "coreInfo": {
        "last_app": "foo",
        "last_heard": "2013-12-19T05:07:29.334Z",
        "connected": false,
        "deviceID": "xxxxx"
    }
}

The positions variable is a string, and it contains a piece of text about 12 characters long, so what’s the array, is it ascii characters? Also why is the last_app called foo? Its blind_controller. Lastly, why does it say it’s not connected, the breathing LED (and the fact that it flashed the firmware moments ago) would say otherwise.

Thanks!

Hi @kaptk2

Apologies for repeating the same response, but I figured I should post this here as well so everyone see's it:

This is a bug that we're planning on resolving soon, it's also mentioned in this thread:

Right now the bug causes the cloud to return variables as a raw byte array. In this case your result is a 4 byte array that maps to an INT.

We'll keep you posted when a fix is deployed.

Thanks!
David

Thanks @Dave,
When I was searching the forum I missed that thread. Looking forward to the upcoming fix.

Thanks again!

1 Like