Hi everypone, I'm working with the example enet_io of mi Tiva C board (ek-TM4C1294xl). I watn to modify one of the set functions (C, JavaScript) in order to send certain data to the board. I have been trying to modify the function but I don't understand how these pieces of codes works at all.
JavaScript code that open the communication:
req.open("GET", "/cgi-bin/set_speed?percent=" + speed_txt.value +
"&id" + Math.random(), true);
req.onreadystatechange = speedComplete;
req.send(null);
And the red coloured C function is:
else if(ustrncmp(pcName, "/cgi-bin/set_speed?percent=", 12) == 0)
{
static char pcBuf[];
//
// Extract the parameter and set the actual speed requested.
//
io_set_animation_speed_string((char*)pcName + 27);
//
// Get the current speed setting as a string to send back.
//
io_get_animation_speed_string(pcBuf, 6);
psFile->data = pcBuf;
psFile->len = strlen(pcBuf);
psFile->index = psFile->len;
psFile->pextension = NULL;
return(psFile);
}
My problem is with the arguments of the blue coloured function, I don't know why de argument add 27 to the pcName pointer. I assume that the data is in that adress. Someone knows how this example send the data to the board?
Thanks in advanced!
MARTIN C!