mirror of
https://github.com/manuelbl/ttn-esp32.git
synced 2025-06-14 20:14:27 +02:00
Add rssi() function
This commit is contained in:
parent
9489f34542
commit
fdacae73f8
@ -93,6 +93,7 @@ void messageReceived(const uint8_t* message, size_t length, port_t port)
|
||||
for (int i = 0; i < length; i++)
|
||||
printf(" %02x", message[i]);
|
||||
printf("\n");
|
||||
printf("RSSI: %d dBm\n", ttn.rssi());
|
||||
}
|
||||
|
||||
extern "C" void app_main(void)
|
||||
@ -131,6 +132,7 @@ extern "C" void app_main(void)
|
||||
{
|
||||
printf("Joined.\n");
|
||||
printAllRFSettings();
|
||||
printf("RSSI: %d dBm\n", ttn.rssi());
|
||||
xTaskCreate(sendMessages, "send_messages", 1024 * 4, (void* )0, 3, nullptr);
|
||||
}
|
||||
else
|
||||
|
@ -400,6 +400,15 @@ public:
|
||||
*/
|
||||
TTNRFSettings rx2Settings();
|
||||
|
||||
/**
|
||||
* @brief Gets the received signal strength indicator (RSSI).
|
||||
*
|
||||
* RSSI is the measured signal strength of the last recevied message (incl. join responses).
|
||||
*
|
||||
* @return RSSI, in dBm
|
||||
*/
|
||||
int rssi();
|
||||
|
||||
private:
|
||||
TTNMessageCallback messageCallback;
|
||||
|
||||
|
@ -320,6 +320,11 @@ TTNRxTxWindow TheThingsNetwork::rxTxWindow()
|
||||
return currentWindow;
|
||||
}
|
||||
|
||||
int TheThingsNetwork::rssi()
|
||||
{
|
||||
return LMIC.rssi;
|
||||
}
|
||||
|
||||
|
||||
// --- Callbacks ---
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user