From 5b5ca9fedfe236c6edd9e130fc624f25b49e3459 Mon Sep 17 00:00:00 2001 From: "Pawel Spychalski (DzikuVx)" Date: Sat, 7 Oct 2017 12:10:15 +0200 Subject: [PATCH] methods to read RSSI and SNR --- .vscode/arduino.json | 5 ++--- crossbow.ino | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.vscode/arduino.json b/.vscode/arduino.json index 4ae44e1..56ce281 100644 --- a/.vscode/arduino.json +++ b/.vscode/arduino.json @@ -1,7 +1,6 @@ { - "board": "arduino:avr:pro", + "board": "bsfrance:avr:lora32u4", "sketch": "crossbow.ino", "port": "COM23", - "output": "./build", - "configuration": "cpu=16MHzatmega328" + "output": "./build" } \ No newline at end of file diff --git a/crossbow.ino b/crossbow.ino index 0e6128e..267b459 100644 --- a/crossbow.ino +++ b/crossbow.ino @@ -226,6 +226,14 @@ void computeCrc(uint8_t dataByte) { */ #ifdef LORA_HARDWARE_SERIAL +int getRadioRssi(void) { + return 0; +} + +int getRadioSnr(void) { + return 0; +} + void radioPacketStart(void) { } @@ -248,6 +256,14 @@ void writeToRadio(uint8_t dataByte) { #ifdef LORA_HARDWARE_SPI +int getRadioRssi(void) { + return LoRa.packetRssi(); +} + +int getRadioSnr(void) { + return LoRa.packetSnr(); +} + void radioPacketStart(void) { LoRa.beginPacket(); }