{
debug_printf(ALL, "kds_s2000w_client_status_session");
join_thread();
- wait_a_second();
+ wait_seconds(&p_config.heartbeat);
CURL* curl = NULL;
CURLU* url_handler = NULL;
struct curl_slist* headers = NULL;
#include <unistd.h>
#include <pthread.h>
-#include "config.h"
-#include "kds_s2000w_config.h"
#include "kds_s2000w_heartbeat.h"
pthread_t pwait;
void* _wait_thread(void *args)
{
- sleep(p_config.heartbeat);
+ unsigned int* seconds = (unsigned int*) args;
+ sleep(*seconds);
return NULL;
}
pthread_join(pwait, NULL);
}
-void wait_a_second()
+void wait_seconds(unsigned int* seconds)
{
- pthread_create(&pwait, NULL, _wait_thread, NULL);
+ pthread_create(&pwait, NULL, _wait_thread, seconds);
}
\ No newline at end of file