Semtech SX1272 radio chipset driver - ported based on Semtech SX1276 driver.
Dependents: Elmo-Terminal LoRaWAN-test-app Elmo-Terminal-App LoRaWAN_Semtech_stack ... more
Diff: sx1272/sx1272.cpp
- Revision:
- 8:ead3f4cc5923
- Parent:
- 3:81cc2c384b1b
- Child:
- 9:f53b11725565
diff -r 6740f7ed1d00 -r ead3f4cc5923 sx1272/sx1272.cpp --- a/sx1272/sx1272.cpp Thu Oct 22 08:01:27 2015 +0000 +++ b/sx1272/sx1272.cpp Wed Dec 16 14:25:04 2015 +0000 @@ -1384,3 +1384,21 @@ break; } } + +void SX1272::SetMaxPayloadLength( ModemType modem, uint8_t max ) +{ + this->SetModem( modem ); + + switch( modem ) + { + case MODEM_FSK: + if( this->settings.Fsk.FixLen == false ) + { + this->Write( REG_PAYLOADLENGTH, max ); + } + break; + case MODEM_LORA: + this->Write( REG_LR_PAYLOADMAXLENGTH, max ); + break; + } +}