diff options
Diffstat (limited to 'src/AccessoryCards/AccessoryCardLora.cpp')
-rw-r--r-- | src/AccessoryCards/AccessoryCardLora.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/AccessoryCards/AccessoryCardLora.cpp b/src/AccessoryCards/AccessoryCardLora.cpp new file mode 100644 index 0000000..13bbab5 --- /dev/null +++ b/src/AccessoryCards/AccessoryCardLora.cpp @@ -0,0 +1,22 @@ +#include "AccessoryCardLora.h" + +AccessoryCardLora::AccessoryCardLora(std::string ProductId, std::string Port) { + port = Port; + productId = ProductId; + spiPath = "/dev/spidev0.0"; + if ((productId.find("MTCDT3-") == 0) && (port.back() == '2')) { + spiPath = "/dev/spidev1.0"; + } else if (productId.find("MTAC-LORA-G") == 0) { + spiPath = "/dev/spidev32766.2"; + } else if (productId.find("MTAC-LORA-") == 0) { + if (port.back() == '2') { + spiPath = "/dev/spidev32765.2"; + } else { + spiPath = "/dev/spidev32766.2"; + } + } +} + +std::string AccessoryCardLora::getPath() { + return spiPath; +} |