diff options
author | Harsh Sharma <harsh.sharma@multitech.com> | 2020-01-09 12:10:01 -0600 |
---|---|---|
committer | Harsh Sharma <harsh.sharma@multitech.com> | 2020-01-09 12:10:01 -0600 |
commit | 8c7856e74ba7bc149180aa3ab9f820043260cdc8 (patch) | |
tree | 5b8d0f9a6ce3f78fc9caaa5afe107afb4c7d3e81 /include | |
parent | d32e7c87879f19951b707617cb7291339be86309 (diff) | |
download | mts-io-sysfs-8c7856e74ba7bc149180aa3ab9f820043260cdc8.tar.gz mts-io-sysfs-8c7856e74ba7bc149180aa3ab9f820043260cdc8.tar.bz2 mts-io-sysfs-8c7856e74ba7bc149180aa3ab9f820043260cdc8.zip |
Added spidev as to accessory card object, moved setting capabilities for lora accessory cards to a common base class function
Diffstat (limited to 'include')
-rw-r--r-- | include/AccessoryCards/AccessoryCardLora.h | 16 | ||||
-rw-r--r-- | include/AccessoryCards/AccessoryCardLora15.h | 18 | ||||
-rw-r--r-- | include/Device/Device.h | 11 |
3 files changed, 5 insertions, 40 deletions
diff --git a/include/AccessoryCards/AccessoryCardLora.h b/include/AccessoryCards/AccessoryCardLora.h deleted file mode 100644 index 28f62ff..0000000 --- a/include/AccessoryCards/AccessoryCardLora.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef ACCESSORYCARDLORA_H_ -#define ACCESSORYCARDLORA_H_ - -#include "General.h" - -class AccessoryCardLora { - private: - std::string spiPath; - std::string productId; - std::string port; - public: - AccessoryCardLora(std::string ProductId, std::string Port); - std::string getPath(); -}; - -#endif /* ACCESSORYCARDLORA_H_ */ diff --git a/include/AccessoryCards/AccessoryCardLora15.h b/include/AccessoryCards/AccessoryCardLora15.h deleted file mode 100644 index b1a9d64..0000000 --- a/include/AccessoryCards/AccessoryCardLora15.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ACCESSORYCARDLORA15_H_ -#define ACCESSORYCARDLORA15_H_ - -#include "General.h" -#include "AccessoryCardLora.h" - -class AccessoryCardLora15 : private AccessoryCardLora { - private: - void *spi_target_ptr = NULL; - public: - AccessoryCardLora15(std::string ProductId, std::string Port); - int spiOpen(const char *spidev); - int spiRead(uint8_t address, uint8_t *data); - int spiClose(); - uint8_t getFPGAVersion(); -}; - -#endif /* ACCESSORYCARDLORA15_H_ */ diff --git a/include/Device/Device.h b/include/Device/Device.h index aa1d32b..86e284f 100644 --- a/include/Device/Device.h +++ b/include/Device/Device.h @@ -4,7 +4,6 @@ #include "General.h" #include "Utility.h" #include "Version.h" -#include "AccessoryCardLora15.h" class Device { private: @@ -32,7 +31,6 @@ class Device { static const std::regex storeFilters; static const std::regex showFilters; - class AccessoryCard { protected: Device& device; @@ -43,14 +41,15 @@ class Device { class LoraCard : public AccessoryCard { protected: std::string spiPath; + uint8_t fpgaVersion = 255; public: - LoraCard(Device& d, const std::string productId, const std::string port); + LoraCard(Device& d, const std::string productId, const std::string port); + void setCapabilities(); }; class Lora15Card : public LoraCard { private: void *spi_target_ptr = NULL; - uint8_t fpgaVersion = 255; public: Lora15Card(Device& d, const std::string productId, const std::string port); int spiOpen(const char *spidev); @@ -60,14 +59,14 @@ class Device { class Lora21Card : public LoraCard { private: - std::string fpgaVersion; + std::string cmdFpgaVersion; public: Lora21Card(Device& d, const std::string productId, const std::string port); }; class Lora21ExtCard : public Lora21Card { private: - std::string fpgaVersion2; + std::string cmdFpgaVersion2; public: Lora21ExtCard(Device& d, const std::string productId, const std::string port); }; |