Fork of Semtech LoRaWAN stack
Fork of LoRaWAN-lib by
Diff: LoRaMac.cpp
- Branch:
- v4.2.0
- Revision:
- 30:0926a366a2c5
- Parent:
- 29:c7583fcfad8c
- Child:
- 31:930f949fdd9e
--- a/LoRaMac.cpp Thu Nov 17 14:12:24 2016 +0000 +++ b/LoRaMac.cpp Tue Dec 13 21:44:00 2016 +0000 @@ -1548,7 +1548,7 @@ if( ( AckTimeoutRetriesCounter < AckTimeoutRetries ) && ( AckTimeoutRetriesCounter <= MAX_ACK_RETRIES ) ) { AckTimeoutRetriesCounter++; - + if( ( AckTimeoutRetriesCounter % 2 ) == 1 ) { ChannelsDatarate = MAX( ChannelsDatarate - 1, LORAMAC_TX_MIN_DATARATE ); @@ -1683,36 +1683,36 @@ datarate = DR_0; } // For higher datarates, we increase the number of symbols generating a Rx Timeout - switch( datarate ) + + + symbTimeout = 10; + // For low SF, we increase the number of symbols generating a Rx Timeout + switch ( datarate ) { - case DR_0: // SF10 - BW125 - symbTimeout = 5; - break; - - case DR_1: // SF9 - BW125 - case DR_2: // SF8 - BW125 - case DR_8: // SF12 - BW500 - case DR_9: // SF11 - BW500 - case DR_10: // SF10 - BW500 - symbTimeout = 8; + case DR_0: + case DR_8: + case DR_9: + case DR_10: + symbTimeout += 5; + break; + case DR_1: + case DR_11: + symbTimeout += 8; break; - - case DR_3: // SF7 - BW125 - case DR_11: // SF9 - BW500 - symbTimeout = 10; + case DR_2: + case DR_4: + case DR_12: + symbTimeout += 9; break; - - case DR_4: // SF8 - BW500 - case DR_12: // SF8 - BW500 - symbTimeout = 14; - break; - - case DR_13: // SF7 - BW500 - symbTimeout = 16; + case DR_3: + case DR_13: + symbTimeout += 10; break; default: - break; + symbTimeout += 5; + break; } + if( datarate >= DR_4 ) {// LoRa 500 kHz bandwidth = 2;