]> rtime.felk.cvut.cz Git - hydro.git/blobdiff - app-stefic/sensor/board.c
Repairs in code
[hydro.git] / app-stefic / sensor / board.c
index d84b280eaf030a09b37b911a02f9dc41dfc6e4fc..5ef7f811e0b9b9488db897b8b9951ed9227407a9 100644 (file)
@@ -47,16 +47,13 @@ void send_data() {
         cids[cid_cnt].value = oi_temperature; 
         cid_cnt++;
     }
-    if (oi_cid_hum > 0) {
+    if (oi_cid_hum > 0){
         cids[cid_cnt].cid = oi_cid_hum; 
         cids[cid_cnt].value = oi_humidity; 
         cid_cnt++;
     }
 
-    if (cid_cnt == 0){
-        heartbeat();
-    } else {
-
+    if (cid_cnt != 0){
         int i;
         int buff_len;
 
@@ -77,7 +74,6 @@ void send_data() {
 
         msgsend = ul_send_query(ul_fd, 0, UL_CMD_PDO, UL_BFL_NORE, (void*) buf, buff_len);
         printf("[I] DATA\n");
-        free(buf);
         ul_freemsg(ul_fd);
     }
 }