[LoRaWAN] Add datarate into event structure (#885)
* [LoRaWAN] Move TX power logic to function * Update keywords * [LoRaWAN] Add datarate into event structure
This commit is contained in:
parent
b2b73ab21d
commit
b6f6718f1f
3 changed files with 7 additions and 0 deletions
|
@ -214,6 +214,8 @@ void loop() {
|
|||
Serial.println(event.confirmed);
|
||||
Serial.print(F("[LoRaWAN] Confirming:\t"));
|
||||
Serial.println(event.confirming);
|
||||
Serial.print(F("[LoRaWAN] Datarate:\t"));
|
||||
Serial.print(event.datarate);
|
||||
Serial.print(F("[LoRaWAN] Frequency:\t"));
|
||||
Serial.print(event.freq, 3);
|
||||
Serial.println(F(" MHz"));
|
||||
|
|
|
@ -904,6 +904,7 @@ int16_t LoRaWANNode::uplink(uint8_t* data, size_t len, uint8_t port, bool isConf
|
|||
event->dir = RADIOLIB_LORAWAN_CHANNEL_DIR_UPLINK;
|
||||
event->confirmed = isConfirmed;
|
||||
event->confirming = isConfirmingDown;
|
||||
event->datarate = this->dataRates[RADIOLIB_LORAWAN_CHANNEL_DIR_UPLINK];
|
||||
event->freq = currentChannels[event->dir].freq;
|
||||
event->power = this->txPwrCur;
|
||||
event->fcnt = this->fcntUp;
|
||||
|
@ -1262,6 +1263,7 @@ int16_t LoRaWANNode::downlink(uint8_t* data, size_t* len, LoRaWANEvent_t* event)
|
|||
event->dir = RADIOLIB_LORAWAN_CHANNEL_DIR_DOWNLINK;
|
||||
event->confirmed = isConfirmedDown;
|
||||
event->confirming = isConfirmingUp;
|
||||
event->datarate = this->dataRates[RADIOLIB_LORAWAN_CHANNEL_DIR_DOWNLINK];
|
||||
event->freq = currentChannels[event->dir].freq;
|
||||
event->power = this->txPwrCur;
|
||||
event->fcnt = isAppDownlink ? this->aFcntDown : this->nFcntDown;
|
||||
|
|
|
@ -325,6 +325,9 @@ struct LoRaWANEvent_t {
|
|||
/*! \brief Whether the event is confirming a previous request
|
||||
(e.g., server downlink reply to confirmed uplink sent by user application)*/
|
||||
bool confirming;
|
||||
|
||||
/*! \brief Datarate */
|
||||
uint8_t datarate;
|
||||
|
||||
/*! \brief Frequency in MHz */
|
||||
float freq;
|
||||
|
|
Loading…
Add table
Reference in a new issue