[PHY] Pass mode config by reference
This commit is contained in:
parent
d6b6a0bf51
commit
7ec456dad4
3 changed files with 6 additions and 7 deletions
|
@ -919,7 +919,7 @@ int16_t LoRaWANNode::activateOTAA(uint8_t joinDr, LoRaWANJoinEvent_t *joinEvent)
|
||||||
modeCfg.transmit.data = joinRequestMsg;
|
modeCfg.transmit.data = joinRequestMsg;
|
||||||
modeCfg.transmit.len = RADIOLIB_LORAWAN_JOIN_REQUEST_LEN;
|
modeCfg.transmit.len = RADIOLIB_LORAWAN_JOIN_REQUEST_LEN;
|
||||||
modeCfg.transmit.addr = 0;
|
modeCfg.transmit.addr = 0;
|
||||||
state = this->phyLayer->stageMode(RADIOLIB_RADIO_MODE_TX, modeCfg);
|
state = this->phyLayer->stageMode(RADIOLIB_RADIO_MODE_TX, &modeCfg);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// if requested, delay until transmitting JoinRequest
|
// if requested, delay until transmitting JoinRequest
|
||||||
|
@ -1334,7 +1334,7 @@ int16_t LoRaWANNode::transmitUplink(const LoRaWANChannel_t* chnl, uint8_t* in, u
|
||||||
modeCfg.transmit.data = in;
|
modeCfg.transmit.data = in;
|
||||||
modeCfg.transmit.len = len;
|
modeCfg.transmit.len = len;
|
||||||
modeCfg.transmit.addr = 0;
|
modeCfg.transmit.addr = 0;
|
||||||
state = this->phyLayer->stageMode(RADIOLIB_RADIO_MODE_TX, modeCfg);
|
state = this->phyLayer->stageMode(RADIOLIB_RADIO_MODE_TX, &modeCfg);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// if requested, wait until transmitting uplink
|
// if requested, wait until transmitting uplink
|
||||||
|
@ -1431,7 +1431,7 @@ int16_t LoRaWANNode::receiveCommon(uint8_t dir, const LoRaWANChannel_t* dlChanne
|
||||||
modeCfg.receive.irqFlags = RADIOLIB_IRQ_RX_DEFAULT_FLAGS;
|
modeCfg.receive.irqFlags = RADIOLIB_IRQ_RX_DEFAULT_FLAGS;
|
||||||
modeCfg.receive.irqMask = RADIOLIB_IRQ_RX_DEFAULT_MASK;
|
modeCfg.receive.irqMask = RADIOLIB_IRQ_RX_DEFAULT_MASK;
|
||||||
modeCfg.receive.len = 0;
|
modeCfg.receive.len = 0;
|
||||||
state = this->phyLayer->stageMode(RADIOLIB_RADIO_MODE_RX, modeCfg);
|
state = this->phyLayer->stageMode(RADIOLIB_RADIO_MODE_RX, &modeCfg);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// wait for the start of the Rx window
|
// wait for the start of the Rx window
|
||||||
|
|
|
@ -537,7 +537,7 @@ int16_t PhysicalLayer::getModem(ModemType_t* modem) {
|
||||||
return(RADIOLIB_ERR_UNSUPPORTED);
|
return(RADIOLIB_ERR_UNSUPPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t PhysicalLayer::stageMode(RadioModeType_t mode, RadioModeConfig_t cfg) {
|
int16_t PhysicalLayer::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
|
||||||
(void)mode;
|
(void)mode;
|
||||||
(void)cfg;
|
(void)cfg;
|
||||||
return(RADIOLIB_ERR_UNSUPPORTED);
|
return(RADIOLIB_ERR_UNSUPPORTED);
|
||||||
|
|
|
@ -737,10 +737,10 @@ class PhysicalLayer {
|
||||||
/*!
|
/*!
|
||||||
\brief Stage mode of the radio to be launched later using launchMode.
|
\brief Stage mode of the radio to be launched later using launchMode.
|
||||||
\param mode Radio mode to prepare.
|
\param mode Radio mode to prepare.
|
||||||
\param cfg Confioguration of this mode (mode-dependent).
|
\param cfg Configuration of this mode (mode-dependent).
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
virtual int16_t stageMode(RadioModeType_t mode, RadioModeConfig_t cfg);
|
virtual int16_t stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Launch previously staged mode.
|
\brief Launch previously staged mode.
|
||||||
|
@ -770,7 +770,6 @@ class PhysicalLayer {
|
||||||
#endif
|
#endif
|
||||||
uint32_t irqMap[10] = { 0 };
|
uint32_t irqMap[10] = { 0 };
|
||||||
RadioModeType_t stagedMode = RADIOLIB_RADIO_MODE_NONE;
|
RadioModeType_t stagedMode = RADIOLIB_RADIO_MODE_NONE;
|
||||||
RadioModeConfig_t stagedConfig = { .standby = { .mode = 0 } };
|
|
||||||
|
|
||||||
#if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE
|
#if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE
|
||||||
void updateDirectBuffer(uint8_t bit);
|
void updateDirectBuffer(uint8_t bit);
|
||||||
|
|
Loading…
Add table
Reference in a new issue