From ff2949b92db803f04cb056f8b4f83d28db4faa07 Mon Sep 17 00:00:00 2001 From: Harsh Sharma Date: Mon, 9 Nov 2020 14:10:34 -0600 Subject: Changed mtcdt3 lora card identifier from product-id to hw version --- include/General.h | 2 +- src/AccessoryCards/LoraCard15.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/General.h b/include/General.h index c4ea4ca..c5be2ff 100644 --- a/include/General.h +++ b/include/General.h @@ -50,7 +50,7 @@ typedef unsigned int uint; //32 bit - even on 64 bit machines #define FIRMWARE_DATE "Date" #define SYSFS_PLATFORM "/sys/devices/platform/mts-io/" -#define PRODUCT_ID_PATH "/sys/devices/platform/mts-io/product-id" +#define HW_VERSION_PATH "/sys/devices/platform/mts-io/hw-version" #define LEDS_GPIO_DIR "/sys/devices/platform/leds-gpio/leds/" #define FIRMWARE_FILE "/etc/issue" diff --git a/src/AccessoryCards/LoraCard15.cpp b/src/AccessoryCards/LoraCard15.cpp index cb7dc64..a7a1dad 100644 --- a/src/AccessoryCards/LoraCard15.cpp +++ b/src/AccessoryCards/LoraCard15.cpp @@ -19,10 +19,10 @@ Device::Lora15Card::Lora15Card(Device& d, const std::string ProductId, const std::string Port) : LoraCard(d, ProductId, Port) { int ret; - std::string deviceProductId = ""; - /* Map the spi path to the device and card product id, with the default being spidev0.0 */ - MTS::System::readFile(PRODUCT_ID_PATH, deviceProductId); - if (deviceProductId.find("MTCDT3-") != std::string::npos) { + std::string deviceHwVersion = ""; + /* Map the spi path to the device hw version/mtac product id, with the default being spidev0.0 */ + MTS::System::readFile(HW_VERSION_PATH, deviceHwVersion); + if (deviceHwVersion.find("MTCDT3-") != std::string::npos) { if (port.back() == '2') { spiPath = "/dev/spidev1.2"; } else { -- cgit v1.2.3