i am trying to migrate my designs from the particle cloud and p0 mcu, to the esp32 platform and mongoose OS. whilr i understand the concepts, the api is a bit different and i am having trouble converting my code from the previous platform. this is just an excerpt of what i am after. also, i dont quite get where my voids are, which one is for one time variables (setup), which one loops (loop)?
void callback(char* topic, byte* payload, unsigned int length) {
char p[length + 1];
memcpy(p, payload, length);
p[length] = NULL;
returned = sscanf(p, "r=%d, g=%d, b=%d, l=%d, c=%d, p=%c", &red, &green, &blue, &luminosity, &control, &pattern);
}