I am using the iOS SDK. SparkCloud is connected. I have a valid SparkDevice object.
SparkDevice 0x1740cca90, type: Spark device, id: xxxxxxx, name: XXX, connected: true, variables: {\n}, functions: (\n digitalread,\n digitalwrite,\n analogread,\n analogwrite\n), version: (null), requires update: false, last app: (null), last heard: 2015-06-18 23:42:52 +0000
I am trying to turn on a LED and reflect its state on the screen.
[_myPhoton callFunction:@"digitalwrite" withArguments:@[@"D7", @1] completion:^(NSNumber *resultCode, NSError *error) {
if (!error) {
_blueLEDState = _tmpBlueLEDState;
_blueLED.backgroundColor = [_blueLEDState boolValue] ? _blueOn : _blueOff;
}
}];
error comes back as nil, which would indicate success. resultCode has a value of -2. What does that mean?
The device remains unaffected by this call. It is running on an iPhone, and the Particle app running on the same phone is working fine. Will the source to the Particle all be released so I can see how they did it, or is there any way I can diagnose why this call is not succeeding?