Explorar o código

* trying setCRC(1)

Scott Powell hai 1 ano
pai
achega
a259d27cfe

+ 1 - 1
examples/companion_radio/main.cpp

@@ -1265,7 +1265,7 @@ void setup() {
     halt();
   }
 
-  radio.setCRC(0);
+  radio.setCRC(1);
 
 #ifdef SX126X_CURRENT_LIMIT
   radio.setCurrentLimit(SX126X_CURRENT_LIMIT);

+ 1 - 1
examples/simple_repeater/main.cpp

@@ -689,7 +689,7 @@ void setup() {
     halt();
   }
 
-  radio.setCRC(0);
+  radio.setCRC(1);
 
 #ifdef SX126X_CURRENT_LIMIT
   radio.setCurrentLimit(SX126X_CURRENT_LIMIT);

+ 1 - 1
examples/simple_room_server/main.cpp

@@ -743,7 +743,7 @@ void setup() {
     halt();
   }
 
-  radio.setCRC(0);
+  radio.setCRC(1);
 
 #ifdef SX126X_CURRENT_LIMIT
   radio.setCurrentLimit(SX126X_CURRENT_LIMIT);

+ 1 - 1
examples/simple_secure_chat/main.cpp

@@ -585,7 +585,7 @@ void setup() {
     halt();
   }
 
-  radio.setCRC(0);
+  radio.setCRC(1);
 
 #ifdef SX126X_CURRENT_LIMIT
   radio.setCurrentLimit(SX126X_CURRENT_LIMIT);

+ 2 - 1
src/helpers/RadioLibWrappers.cpp

@@ -52,10 +52,11 @@ int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) {
       int err = _radio->readData(bytes, len);
       if (err != RADIOLIB_ERR_NONE) {
         MESH_DEBUG_PRINTLN("RadioLibWrapper: error: readData(%d)", err);
+        len = 0;
       } else {
       //  Serial.print("  readData() -> "); Serial.println(len);
+        n_recv++;
       }
-      n_recv++;
     }
     state = STATE_IDLE;   // need another startReceive()
     return len;