I’m seeing a difference in behavior between sscanf on my photon and on my command line. I’ve got a web hook that returns “74.01~-6” in the data, and am trying to parse it like this:
The scan fails and I always get zeros in my debug print there.
At first I thought maybe I needed a fancier sscanf formatting string, but the following works perfectly fine with “gcc” locally:
#include <stdio.h>
int main() {
char str[] = "76.04~-6";
float temp;
int tz,n;
n = sscanf(str, "%f~%d", &temp, &tz);
printf("Scanned %d things, temp %f, tz %d\n", n, temp, tz);
}
@rickkas7, could you inquire at Particle what the cost (RAM, time, …) would be to bring that to the platform?
It has been discussed several times, but without official statement what to do about it