jhg

Dependencies:   mbed LoRaWAN-lib SX1272Lib

Files at this revision

API Documentation at this revision

Comitter:
etiene32
Date:
Tue Mar 05 16:27:41 2019 +0000
Parent:
4:78bf111a5f6a
Commit message:
fonctionne avec transfert de texte

Changed in this revision

app/Comissioning.h Show annotated file Show diff for this revision Revisions of this file
app/main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 78bf111a5f6a -r 5343a10dfa6c app/Comissioning.h
--- a/app/Comissioning.h	Wed May 18 11:33:36 2016 +0000
+++ b/app/Comissioning.h	Tue Mar 05 16:27:41 2019 +0000
@@ -36,7 +36,7 @@
 /*!
  * Mote device IEEE EUI (big endian)
  */
-#define LORAWAN_DEVICE_EUI                          { IEEE_OUI, 0x44, 0x55, 0x66, 0x77, 0x88 }
+#define LORAWAN_DEVICE_EUI                          { 0x12 ,0x59 ,0x12 ,0x59 ,0x12 ,0x59 ,0x12 ,0x42 }
 
 /*!
  * Application IEEE EUI (big endian)
@@ -46,7 +46,7 @@
 /*!
  * AES encryption/decryption cipher application key
  */
-#define LORAWAN_APPLICATION_KEY                     { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
+#define LORAWAN_APPLICATION_KEY                     { 0x8a ,0x1c ,0x7a ,0xfb ,0x76 ,0xf5 ,0xf5 ,0xc0 ,0x6d ,0x6e ,0x02 ,0x4a ,0x8b ,0x3b ,0x5a ,0x0e}
 
 #else
 
diff -r 78bf111a5f6a -r 5343a10dfa6c app/main.cpp
--- a/app/main.cpp	Wed May 18 11:33:36 2016 +0000
+++ b/app/main.cpp	Tue Mar 05 16:27:41 2019 +0000
@@ -292,45 +292,28 @@
 /*!
  * \brief   Prepares the payload of the frame
  */
-static void PrepareTxFrame( uint8_t port )
+static void PrepareTxFrame( uint8_t port, uint8_t text[10] )
 {
     switch( port )
     {
-    case 15:
+    case 18:
         {
-            AppData[0] = AppLedStateOn;
+            
+           /* AppData[0] = text[0]; 
+            AppData[1] = text[1]; 
+            AppData[2] = text[2]; 
+            AppData[3] = text[3];
+            AppData[4] = text[4];
+            AppData[5] = text[5];
+            AppData[6] = text[6];
+            AppData[7] = text[7];
+            AppData[8] = text[8];*/
+            for(int y=0;y<10;y++){
+                AppData[y] = text[y];
+            }
+            
             if( IsTxConfirmed == true )
             {
-                AppData[1] = LoRaMacDownlinkStatus.DownlinkCounter >> 8;
-                AppData[2] = LoRaMacDownlinkStatus.DownlinkCounter;
-                AppData[3] = LoRaMacDownlinkStatus.Rssi >> 8;
-                AppData[4] = LoRaMacDownlinkStatus.Rssi;
-                AppData[5] = LoRaMacDownlinkStatus.Snr;
-            }
-        }
-        break;
-    case 224:
-        if( ComplianceTest.LinkCheck == true )
-        {
-            ComplianceTest.LinkCheck = false;
-            AppDataSize = 3;
-            AppData[0] = 5;
-            AppData[1] = ComplianceTest.DemodMargin;
-            AppData[2] = ComplianceTest.NbGateways;
-            ComplianceTest.State = 1;
-        }
-        else
-        {
-            switch( ComplianceTest.State )
-            {
-            case 4:
-                ComplianceTest.State = 1;
-                break;
-            case 1:
-                AppDataSize = 2;
-                AppData[0] = ComplianceTest.DownLinkCounter >> 8;
-                AppData[1] = ComplianceTest.DownLinkCounter;
-                break;
             }
         }
         break;
@@ -859,9 +842,11 @@
             {
                 if( NextTx == true )
                 {
+                    uint8_t text[10]={1,2,3,4,5,6,7,8,9,10};
                     SerialDisplayUpdateUplinkAcked( false );
                     SerialDisplayUpdateDonwlinkRxData( false );
-                    PrepareTxFrame( AppPort );
+                    //PrepareTxFrame( AppPort);
+                    PrepareTxFrame( 18,text);
 
                     NextTx = SendFrame( );