summaryrefslogtreecommitdiff
path: root/recipes-connectivity/lora/lora-packet-forwarder-usb/lora-packet-forwarder-skip-bad-packets.patch
blob: eb9450fbd7f0c601b1aaf5e10fa7bd9e27a120a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Index: git/basic_pkt_fwd/src/basic_pkt_fwd.c
===================================================================
--- git.orig/basic_pkt_fwd/src/basic_pkt_fwd.c	2014-12-16 17:03:32.891297739 -0600
+++ git/basic_pkt_fwd/src/basic_pkt_fwd.c	2014-12-18 10:49:22.379916372 -0600
@@ -928,7 +928,8 @@
 					MSG("ERROR: [up] received packet with unknown status\n");
 					memcpy((void *)(buff_up + buff_index), (void *)",\"stat\":?", 9);
 					buff_index += 9;
-					exit(EXIT_FAILURE);
+					continue; // skip packet
+					//exit(EXIT_FAILURE);
 			}
 			
 			/* Packet modulation, 13-14 useful chars */
@@ -966,7 +967,8 @@
 						MSG("ERROR: [up] lora packet with unknown datarate\n");
 						memcpy((void *)(buff_up + buff_index), (void *)",\"datr\":\"SF?", 12);
 						buff_index += 12;
-						exit(EXIT_FAILURE);
+						continue; // skip packet
+						//exit(EXIT_FAILURE);
 				}
 				switch (p->bandwidth) {
 					case BW_125KHZ:
@@ -985,7 +987,8 @@
 						MSG("ERROR: [up] lora packet with unknown bandwidth\n");
 						memcpy((void *)(buff_up + buff_index), (void *)"BW?\"", 4);
 						buff_index += 4;
-						exit(EXIT_FAILURE);
+						continue; // skip packet
+						//exit(EXIT_FAILURE);
 				}
 				
 				/* Packet ECC coding rate, 11-13 useful chars */
@@ -1014,7 +1017,8 @@
 						MSG("ERROR: [up] lora packet with unknown coderate\n");
 						memcpy((void *)(buff_up + buff_index), (void *)",\"codr\":\"?\"", 11);
 						buff_index += 11;
-						exit(EXIT_FAILURE);
+						continue; // skip packet
+						//exit(EXIT_FAILURE);
 				}
 				
 				/* Lora SNR, 11-13 useful chars */
@@ -1039,7 +1043,8 @@
 				}
 			} else {
 				MSG("ERROR: [up] received packet with unknown modulation\n");
-				exit(EXIT_FAILURE);
+				continue; // skip packet
+				//exit(EXIT_FAILURE);
 			}
 			
 			/* Packet RSSI, payload size, 18-23 useful chars */
 			
diff --git a/gps_pkt_fwd/src/gps_pkt_fwd.c b/gps_pkt_fwd/src/gps_pkt_fwd.c
index 79f7584..933de29 100644
--- a/gps_pkt_fwd/src/gps_pkt_fwd.c
+++ b/gps_pkt_fwd/src/gps_pkt_fwd.c
@@ -1107,7 +1107,8 @@ void thread_up(void) {
 					MSG("ERROR: [up] received packet with unknown status\n");
 					memcpy((void *)(buff_up + buff_index), (void *)",\"stat\":?", 9);
 					buff_index += 9;
-					exit(EXIT_FAILURE);
+					continue; // skip packet
+					//exit(EXIT_FAILURE);
 			}
 			
 			/* Packet modulation, 13-14 useful chars */
@@ -1145,7 +1146,8 @@ void thread_up(void) {
 						MSG("ERROR: [up] lora packet with unknown datarate\n");
 						memcpy((void *)(buff_up + buff_index), (void *)",\"datr\":\"SF?", 12);
 						buff_index += 12;
-						exit(EXIT_FAILURE);
+						continue; // skip packet
+						//exit(EXIT_FAILURE);
 				}
 				switch (p->bandwidth) {
 					case BW_125KHZ:
@@ -1164,7 +1166,8 @@ void thread_up(void) {
 						MSG("ERROR: [up] lora packet with unknown bandwidth\n");
 						memcpy((void *)(buff_up + buff_index), (void *)"BW?\"", 4);
 						buff_index += 4;
-						exit(EXIT_FAILURE);
+                        continue; // skip packet
+						//exit(EXIT_FAILURE);
 				}
 				
 				/* Packet ECC coding rate, 11-13 useful chars */
@@ -1193,7 +1196,8 @@ void thread_up(void) {
 						MSG("ERROR: [up] lora packet with unknown coderate\n");
 						memcpy((void *)(buff_up + buff_index), (void *)",\"codr\":\"?\"", 11);
 						buff_index += 11;
-						exit(EXIT_FAILURE);
+						continue; // skip packet
+						//exit(EXIT_FAILURE);
 				}
 				
 				/* Lora SNR, 11-13 useful chars */
@@ -1218,7 +1222,8 @@ void thread_up(void) {
 				}
 			} else {
 				MSG("ERROR: [up] received packet with unknown modulation\n");
-				exit(EXIT_FAILURE);
+				continue; // skip packet				
+				//exit(EXIT_FAILURE);
 			}
 			
 			/* Packet RSSI, payload size, 18-23 useful chars */