Skip to content

Commit 70a2394

Browse files
Add LoRaWAN.setTxContinuousWave
1 parent 9a92c2b commit 70a2394

File tree

6 files changed

+29
-0
lines changed

6 files changed

+29
-0
lines changed

libraries/LoRaWAN/keywords.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ setDownLinkDwellTime KEYWORD2
8181
setMaxEIRP KEYWORD2
8282
setAntennaGain KEYWORD2
8383
setDutyCycle KEYWORD2
84+
setRxWindows KEYWORD2
85+
setTxContinuousWave KEYWORD2
8486
setComplianceTest KEYWORD2
8587
setBatteryLevel KEYWORD2
8688

libraries/LoRaWAN/src/LoRaWAN.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,6 +2222,32 @@ int LoRaWANClass::setComplianceTest(bool enable)
22222222
return 1;
22232223
}
22242224

2225+
int LoRaWANClass::setTxContinuousWave(unsigned long frequency, float power, unsigned long timeout)
2226+
{
2227+
unsigned int txPower;
2228+
MlmeReq_t mlmeReq;
2229+
2230+
if (!_Band) {
2231+
return 0;
2232+
}
2233+
2234+
if (_tx_busy) {
2235+
return 0;
2236+
}
2237+
2238+
txPower = floorf(power);
2239+
2240+
mlmeReq.Type = MLME_TXCW_1;
2241+
mlmeReq.Req.TxCw.Timeout = timeout;
2242+
mlmeReq.Req.TxCw.Frequency = frequency;
2243+
mlmeReq.Req.TxCw.Power = txPower;
2244+
if (LoRaWANMlmeRequest(&mlmeReq) != LORAMAC_STATUS_OK) {
2245+
return 0;
2246+
}
2247+
2248+
return 1;
2249+
}
2250+
22252251
int LoRaWANClass::setBatteryLevel(unsigned int level)
22262252
{
22272253
if (level > 255) {

libraries/LoRaWAN/src/LoRaWAN.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ class LoRaWANClass : public Stream
220220

221221
int setDutyCycle(bool enable);
222222
int setRxWindows(bool enable);
223+
int setTxContinuousWave(unsigned long frequency, float power, unsigned long seconds);
223224
int setComplianceTest(bool enable);
224225

225226
int setBatteryLevel(unsigned int level);

system/STM32L0xx/Lib/libstm32l052xx.a

0 Bytes
Binary file not shown.

system/STM32L0xx/Lib/libstm32l072xx.a

0 Bytes
Binary file not shown.

system/STM32L0xx/Lib/libstm32l082xx.a

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)