Git
Wiki
Site
projects
/
soft
/
lpc82x
/
exanh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
bdbab03
)
Add some more debug
author
Nathael Pajani
<nathael.pajani@ed3l.fr>
Mon, 26 Apr 2021 22:11:34 +0000
(
00:11
+0200)
committer
Nathael Pajani
<nathael.pajani@ed3l.fr>
Sat, 11 Feb 2023 04:14:22 +0000
(
05:14
+0100)
host/exanh_datalog/main.c
patch
|
blob
|
history
diff --git
a/host/exanh_datalog/main.c
b/host/exanh_datalog/main.c
index
870d7aa
..
d1d824d
100644
(file)
--- a/
host/exanh_datalog/main.c
+++ b/
host/exanh_datalog/main.c
@@
-518,21
+518,39
@@
int main(int argc, char* argv[])
struct sensor_info info;
/* Valid packet received, parse data */
parse_packet(&info);
struct sensor_info info;
/* Valid packet received, parse data */
parse_packet(&info);
+ if (debug == 2) {
+ printf("Packet from sensor %d\n", info.addr);
+ }
if (info.seqnum == last_seq_num[info.addr]) {
/* Ignore duplicated packet */
if (info.seqnum == last_seq_num[info.addr]) {
/* Ignore duplicated packet */
+ if (debug == 2) {
+ printf("Dup packet from sensor %d (seq: %d)\n", info.addr, info.seqnum);
+ }
break;
}
/* Check data validity */
if ((info.raw_humidity < 1000) || (info.raw_humidity > 4000)) {
break;
}
/* Check data validity */
if ((info.raw_humidity < 1000) || (info.raw_humidity > 4000)) {
+ if (debug == 2) {
+ printf("Invalid raw soil humidity [1000 .. 4000] : %d\n", info.raw_humidity);
+ }
break;
}
if ((info.pressure < 800) || (info.pressure > 1200)) {
break;
}
if ((info.pressure < 800) || (info.pressure > 1200)) {
+ if (debug == 2) {
+ printf("Invalid pressure [800 .. 1200] : %d\n", info.pressure);
+ }
break;
}
if ((info.comp_temp < -400) || (info.comp_temp > 1000)) {
break;
}
if ((info.comp_temp < -400) || (info.comp_temp > 1000)) {
+ if (debug == 2) {
+ printf("Invalid temperature [-400 .. 1000] : %d\n", info.comp_temp);
+ }
break;
}
if (info.humidity > 1000) {
break;
}
if (info.humidity > 1000) {
+ if (debug == 2) {
+ printf("Invalid air rel humidity [0 .. 1000] : %d\n", info.humidity);
+ }
break;
}
break;
}
@@
-543,6
+561,9
@@
int main(int argc, char* argv[])
/* New device ? store address */
if ((info.addr < NB_ADDRESS) && (addr_list[info.addr] == 0)) {
addr_list[info.addr] = info.addr;
/* New device ? store address */
if ((info.addr < NB_ADDRESS) && (addr_list[info.addr] == 0)) {
addr_list[info.addr] = info.addr;
+ if (debug == 2) {
+ printf("New device detected : %d\n", info.addr);
+ }
}
/* Store data to log file */
}
/* Store data to log file */
Techno-Innov
42 impasse de la Combe du Bois
01150 Blyes - France
contact@techno-innov.fr
Design et hébergement du site :
Techno-Innov
Techno-Innov
- SARL Coopérative
539 169 417 RCS Bourg-en-Bresse
Ce site n'utilise pas de cookies, désolé pour les gourmands !