Found Some Code that Compiles, but makes the Spark non-responsive to the Cloud

So I seem to have found some code that compiles correctly, and when I flash it to the Core, seems to be fine. The core flashes itself and then reboots, and connects to the cloud (in theory - its breathing cyan).

However, from that point on, it doesn’t respond to ANY API requests (even a simple GET), nor any future flashing requests. I end up having to factory reset it.

I’ve not had a chance to do a binary search diff between this an the last working version, but wanted to report it for now.

Sounds like your firmware is hanging somewhere; if that’s the case, that would make it not responsive to the Cloud (since the MCU is blocked, the incoming requests can’t be handled)

I dont think so, actually…

I managed to find the diff, and the only difference between a working version and the hanging version is the following:

-int splitString(String s, int index);
+int splitString(String s, char parser,int index);

This function prototype (the addition above is what causes the issue) is in correct for the function definition:

int splitString(String s, int index){
    int pivot = s.indexOf(',');
    String Lstring = s.substring(0,pivot);
    String Rstring = s.substring(pivot+1,s.length());
    if (index == 0) return Lstring.toInt();
    if (index == 1) return Rstring.toInt();
    return 999;

I would expect the compiler to catch this, honestly.

Our pre-processor actually adds function prototypes for your code (like Arduino’s IDE does), which is why the compiler didn’t catch this.