1947 unsigned long sleepTime = 0;
1948 ItemNode* current = 0;
1950 unsigned long innerCounter = 0;
1951 unsigned long outerCounter = 0;
1957 status = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
1960 printf(
"Set cancel state error [mon - float]: %d\n", status);
1964 "Unable to configure monitor thread (float) properly. Monitoring is not affected.", 0);
1966 status = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
1969 printf(
"Set cancel type error [mon - float]: %d\n", status);
1973 "Unable to configure monitor thread (float) properly. Monitoring is not affected.", 0);
1976 createLogMessage(MSG_DEBUG,
"Started monitor thread for FLOAT values successfully.", 0);
1981 while (current != 0) {
1983 msg[
sprintf(msg,
"Value of item %s (float) is corrupt, reconstruction failed. Ignoring!",
1984 current->item->name)] = 0;
1989 if ((fabsf((*(current->item->location)) - current->lastTransmittedValue)
1990 >= current->threshold) || (outerCounter ==
1991 (innerCounter * TIME_INTERVAL_MULTIPLIER))) {
1993 current->lastTransmittedValue = *(current->item->location);
2003 current = current->next;
2004 usleep(sleepTime * 1000);
2014 if (outerCounter >= (
nodesAmount * TIME_INTERVAL_MULTIPLIER)) {
static unsigned short updateRate
void createLogMessage(unsigned int type, char *description, char *origin)
bool checkLocation(ItemNode *node)
static ItemNode * firstNode
#define dis_update_service
static bool monitorThreadStarted
static unsigned int nodesAmount
sprintf(name1,"NewService%d", i)