summaryrefslogtreecommitdiff
path: root/src/AccessoryCards/AccessoryCardLora.cpp
blob: 13bbab5024deb9987f3f63967b1ab121b759c7e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}