The RemoteXY does not provide a data change flag. This is not always necessary. But it is very easy to implement. To check if the data has changed, you must keep a copy of the data.
For simple variables this is always easy. Here is some example code.
float copySetTemp = 0;
void loop () {
if (RemoteXY.setTemp != copySetTemp ) {
copySetTemp = RemoteXY.setTemp;
// do something when data is changed
}
}
For strings it's a bit more complicated, but the idea is the same. You have to keep a copy of the string and use some function to compare and copy the strings. An example of such a function is below
// The length of the copy must be the same as the original in the RemoteXY structure
char * copyMyString[11];
void loop () {
if (strCompareAndCopy (copyMyString, RemoteXY.myString) == 0) {
// do something when data is changed
}
}
uint8_t strCompareAndCopy (char* to, char* from) {
uint8_t compare = 1;
while (*from) {
if (*to != *from) compare = 0;
*to++ = *from++;
}
if (*to) compare = 0;
*to = *from; // zero
return compare;
}