p2p with rssi value

Dependents:   Lora_SX1272_serial_apr29-rssi

Files at this revision

API Documentation at this revision

Comitter:
afzalsamira
Date:
Thu Jul 08 20:12:14 2021 +0000
Parent:
6:d7c7e731da3a
Commit message:
rssi is added and it works correctly

Changed in this revision

SX1272.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r d7c7e731da3a -r e99757b7c421 SX1272.cpp
--- a/SX1272.cpp	Mon Feb 01 15:19:40 2021 +0000
+++ b/SX1272.cpp	Thu Jul 08 20:12:14 2021 +0000
@@ -28,6 +28,8 @@
 #include "mbed.h"
 #include "SX1272.h"
 #include <SPI.h>
+ #include "serial.h"
+ 
 
 /*  CHANGE LOGS by C. Pham
  *  June, 22th, 2017
@@ -3443,10 +3445,10 @@
     int rssi_mean = 0;
     int total = 5;
 
-#if (SX1272_debug_mode > 1)
+//#if (SX1272_debug_mode > 1)
     printf("\n");
-    printf("Starting 'getRSSI'\n");
-#endif
+    pc.printf("Starting 'getRSSI'\n");
+//#endif
 
     if( _modem == LORA )
     {
@@ -3464,12 +3466,12 @@
         _RSSI = rssi_mean;
 
         state = 0;
-#if (SX1272_debug_mode > 0)
-        printf("## RSSI value is %d",_RSSI);
+//#if (SX1272_debug_mode > 0)
+        pc.printf("## RSSI value is %d",_RSSI);
        // Serial.print(_RSSI, DEC);
         printf(" ##");
         printf("\n");
-#endif
+//#endif
     }
     else
     {
@@ -3485,12 +3487,12 @@
 
         state = 0;
 
-#if (SX1272_debug_mode > 0)
-        printf("## RSSI value is %d ",_RSSI);
+//#if (SX1272_debug_mode > 0)
+        pc.printf("## RSSI value is %d ",_RSSI);
         //Serial.print(_RSSI);
         printf(" ##");
         printf("\n");
-#endif
+//#endif
     }
     return state;
 }