LoRa Gateway, interface to Raspberry - Working ok

Dependencies:   BufferedSerial SX1276GenericLib mbed

Fork of DISCO-L072CZ-LRWAN1_LoRa_server by Santiago Gil

Revision:
14:fe73b77cf1c0
Parent:
12:fdf2b9912649
--- a/SX1276GenericPingPong/GenericPingPong.cpp	Wed Aug 08 22:31:28 2018 +0000
+++ b/SX1276GenericPingPong/GenericPingPong.cpp	Mon Oct 08 16:10:32 2018 +0000
@@ -55,7 +55,7 @@
 #define RX_TIMEOUT_VALUE    3500	// in ms
 
 //#define BUFFER_SIZE       32        // Define the payload size here
-#define BUFFER_SIZE         64        // Define the payload size here
+#define BUFFER_SIZE         256        // Define the payload size here
 
 /*
  *  Global variables declarations
@@ -97,8 +97,8 @@
 const char EUI[] = "0A01";// 4  bytes que definen el identificador del dispositivo (copiar los bytes en string)
 const char AppEUI[] = "AAAA";// 4  bytes que definen el identificador de la aplicacion (copiar los bytes en string)
 const char AppKey[] = "1A1B";// 4  bytes que definen la clave de la aplicacion (copiar los bytes en string) - El protocolo LoRaWAN establece la clave de 16 bytes pero para efectos de prueba se hara de 4
-char MsgTX[64] = "";// Mensaje de transmision, se pueden usar los 52 bytes faltantes para completar el payload de 64 bytes. Se puede poner directamente en string.
-char MsgRX[64] = "";// Mensaje de recepcion, carga el payload entrante a esta cadena.
+char MsgTX[256] = "";// Mensaje de transmision, se pueden usar los 52 bytes faltantes para completar el payload de 64 bytes. Se puede poner directamente en string.
+char MsgRX[256] = "";// Mensaje de recepcion, carga el payload entrante a esta cadena.
 char MsgRet[] = "RECIBIDO";
 char DestEUI[4] = "";
 char euiAux[4]="";
@@ -245,7 +245,7 @@
             case RX:
                 //dprintf( "Recibiendo informacion" );
                 *led = !*led;
-                //dprintf("Mensaje para depurar: %s",MsgRX);
+                dprintf("Mensaje para depurar: %s",MsgRX);
                 //strcpy(DestEUI,"A010");
                 msjDeco=MsgRX;
                 //vector<string> x = split(msjDeco, '|');
@@ -314,7 +314,7 @@
                 break;
             case RX_ERROR:
                 // We have received a Packet with a CRC error, send reply as if packet was correct
-                strcpy(MsgRet,"ERROR");
+                /*strcpy(MsgRet,"ERROR");
                 strcpy(MsgTX, EUI);
                 strcat(MsgTX, "|");
                 strcat(MsgTX, AppEUI);
@@ -333,7 +333,8 @@
                     }
                     wait_ms( 1000 );
                     Radio->Send( Buffer, BufferSize );
-                }
+                }*/
+                Radio->Rx( RX_TIMEOUT_VALUE );
                 State = LOWPOWER;
                 break;
             case TX_TIMEOUT: