Basic MAC data interface for LoRa transceiver

Dependencies:   L2Frame crc

Dependents:   LoRaBaseStation LoRaTerminal

Revision:
29:6c59b0bba861
Parent:
28:2c0e115b4f72
Child:
30:bccad60351ac
diff -r 2c0e115b4f72 -r 6c59b0bba861 AlohaTransceiver.cpp
--- a/AlohaTransceiver.cpp	Sat Sep 03 02:37:53 2016 +0000
+++ b/AlohaTransceiver.cpp	Sat Sep 03 02:47:46 2016 +0000
@@ -178,13 +178,16 @@
                     
                     // schedule the ack frame immediatly after the data frame is received
                     if (type == AlohaFrame::Aloha_Data)
-                    { 
+                    {
+#ifdef DEBUG_ALOHA
+                        printf("\r\nRXDATA::SRC_ADDR:0x%x,SEQID:0x%x\r\n", frame->getSourceAddress(), frame->getSequenceID());
+#endif 
                         sendAck(frame);
                     }
                     else if (type == AlohaFrame::Aloha_ACK)
                     {
 #ifdef DEBUG_ALOHA
-                        printf("RXACK::SEQID:0x%x\r\n", frame->getSequenceID());
+                        printf("\r\nRXACK::SRC_ADDR:0x%x,SEQID:0x%x\r\n", frame->getSourceAddress(), frame->getSequenceID());
 #endif 
                     }
                 
@@ -238,6 +241,9 @@
         }
         case TX_TIMEOUT:
         {
+            // set tx to done, allow next transmission
+            setTxDoneFlag();
+            
             Radio.Rx( 0 );
             State = LOWPOWER;
             break;
@@ -331,7 +337,7 @@
     
     // debug
 #ifdef DEBUG_ALOHA
-    printf("\r\nTXDATA::ADDR:0x%x, SEQID:0x%x\r\n", frame->getDestinationAddress(), frame->getSequenceID());
+    printf("\r\nTXDATA::DEST_ADDR:0x%x,SEQID:0x%x\r\n", frame->getDestinationAddress(), frame->getSequenceID());
 #endif                
     return true;
 }
@@ -370,7 +376,7 @@
     
     // debug
 #ifdef DEBUG_ALOHA
-    printf("\r\nTXACK::ADDR:0x%x, SEQID:0x%x\r\n", outFrame->getDestinationAddress(), outFrame->getSequenceID());
+    printf("\r\nTXACK::DEST_ADDR:0x%x,SEQID:0x%x\r\n", outFrame->getDestinationAddress(), outFrame->getSequenceID());
 #endif
 }