Describe the bug
This is a bug that I noticed while reading code. I haven't actually reproduced this bug (I do not have applicable hardware read), but I'm pretty confident it exists.
The problem is that SX1261 (which extends SX1262) overrides setOutputPower with its own version that applies the 1261 PA config instead of the 1262 PA config. When the sketch explicitely calls setOutputPower on the SX1261 object, the right version is used and everything is ok. But on startup, SX1262::begin() applies the default output power by calling setOutputPower(). Since that is not a virtual method, this means that call is statically resolved to call SX1262::setOutputPower(), not SX1261::setOutputPower(), applying the wrong values.
A fix could be to make this method virtual in SX1262, or to override the begin() method in SX1261 to call the right method (after the incorrect method), or maybe pass the right settings from SX1261 to SX1262 in some other way.
Describe the bug This is a bug that I noticed while reading code. I haven't actually reproduced this bug (I do not have applicable hardware read), but I'm pretty confident it exists.
The problem is that SX1261 (which extends SX1262) overrides
setOutputPower
with its own version that applies the 1261 PA config instead of the 1262 PA config. When the sketch explicitely callssetOutputPower
on the SX1261 object, the right version is used and everything is ok. But on startup,SX1262::begin()
applies the default output power by callingsetOutputPower()
. Since that is not a virtual method, this means that call is statically resolved to callSX1262::setOutputPower()
, notSX1261::setOutputPower()
, applying the wrong values.A fix could be to make this method virtual in
SX1262
, or to override thebegin()
method in SX1261 to call the right method (after the incorrect method), or maybe pass the right settings from SX1261 to SX1262 in some other way.