allow dialing up TX Power
This commit is contained in:
parent
3bfe8f1be7
commit
191daf4f3e
|
|
@ -156,6 +156,27 @@ void RFM69_ATC::interruptHook(uint8_t CTLbyte) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
// sendWithRetry() - overrides the base to allow increasing power when repeated ACK requests fail
|
||||||
|
//=============================================================================
|
||||||
|
bool RFM69_ATC::sendWithRetry(uint8_t toAddress, const void* buffer, uint8_t bufferSize, uint8_t retries, uint8_t retryWaitTime) {
|
||||||
|
uint32_t sentTime;
|
||||||
|
for (uint8_t i = 0; i <= retries; i++)
|
||||||
|
{
|
||||||
|
send(toAddress, buffer, bufferSize, true);
|
||||||
|
sentTime = millis();
|
||||||
|
while (millis() - sentTime < retryWaitTime)
|
||||||
|
{
|
||||||
|
if (ACKReceived(toAddress))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_transmitLevel < 31) _transmitLevel++;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// receiveBegin() - need to clear out our flag before calling base class.
|
// receiveBegin() - need to clear out our flag before calling base class.
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ class RFM69_ATC: public RFM69 {
|
||||||
void sendACK(const void* buffer = "", uint8_t bufferSize=0);
|
void sendACK(const void* buffer = "", uint8_t bufferSize=0);
|
||||||
//void setHighPower(bool onOFF=true, uint8_t PA_ctl=0x60); //have to call it after initialize for RFM69HW
|
//void setHighPower(bool onOFF=true, uint8_t PA_ctl=0x60); //have to call it after initialize for RFM69HW
|
||||||
//void setPowerLevel(uint8_t level); // reduce/increase transmit power level
|
//void setPowerLevel(uint8_t level); // reduce/increase transmit power level
|
||||||
|
bool sendWithRetry(uint8_t toAddress, const void* buffer, uint8_t bufferSize, uint8_t retries=2, uint8_t retryWaitTime=40); // 40ms roundtrip req for 61byte packets
|
||||||
void enableAutoPower(int16_t targetRSSI=-90); // TWS: New method to enable/disable auto Power control
|
void enableAutoPower(int16_t targetRSSI=-90); // TWS: New method to enable/disable auto Power control
|
||||||
void setMode(uint8_t mode); // TWS: moved from protected to try to build block()/unblock() wrapper
|
void setMode(uint8_t mode); // TWS: moved from protected to try to build block()/unblock() wrapper
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue