summaryrefslogtreecommitdiff
path: root/include/Device/Device.h
diff options
context:
space:
mode:
authorHarsh Sharma <harsh.sharma@multitech.com>2020-01-15 17:05:44 -0600
committerHarsh Sharma <harsh.sharma@multitech.com>2020-01-15 17:05:44 -0600
commit6516d0bbfc4217e3f1204ce07334e709e91b7bb6 (patch)
tree30320485d1f45238f5229addbd901f33b3f53cf6 /include/Device/Device.h
parentacb6f2db223487f2a80d7733ce91c735ff50302e (diff)
downloadmts-io-sysfs-6516d0bbfc4217e3f1204ce07334e709e91b7bb6.tar.gz
mts-io-sysfs-6516d0bbfc4217e3f1204ce07334e709e91b7bb6.tar.bz2
mts-io-sysfs-6516d0bbfc4217e3f1204ce07334e709e91b7bb6.zip
Added port to accessory card list. Added sorting for accessory card array if the array is longer than 1
Diffstat (limited to 'include/Device/Device.h')
-rw-r--r--include/Device/Device.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/Device/Device.h b/include/Device/Device.h
index ee75285..db45316 100644
--- a/include/Device/Device.h
+++ b/include/Device/Device.h
@@ -32,8 +32,10 @@ class Device {
class AccessoryCard {
protected:
Device& device;
+ const std::string productId;
+ const std::string port;
public:
- AccessoryCard(Device& d);
+ AccessoryCard(Device& d, const std::string ProductId, const std::string Port);
};
class LoraCard : public AccessoryCard {
@@ -41,7 +43,7 @@ class Device {
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();
};
@@ -49,7 +51,7 @@ class Device {
private:
void *spi_target_ptr = NULL;
public:
- Lora15Card(Device& d, const std::string productId, const std::string port);
+ Lora15Card(Device& d, const std::string ProductId, const std::string Port);
int spiOpen(const char *spidev);
int spiRead(uint8_t address, uint8_t *data);
int spiClose();
@@ -59,24 +61,24 @@ class Device {
private:
std::string cmdFpgaVersion;
public:
- Lora21Card(Device& d, const std::string productId, const std::string port);
+ Lora21Card(Device& d, const std::string ProductId, const std::string Port);
};
class Lora21ExtCard : public Lora21Card {
private:
std::string cmdFpgaVersion2;
public:
- Lora21ExtCard(Device& d, const std::string productId, const std::string port);
+ Lora21ExtCard(Device& d, const std::string ProductId, const std::string Port);
};
class Gpiob : public AccessoryCard {
public:
- Gpiob(Device& d);
+ Gpiob(Device& d, const std::string ProductId, const std::string Port);
};
class Mfser : public AccessoryCard {
public:
- Mfser(Device& d, const std::string port);
+ Mfser(Device& d, const std::string ProductId, const std::string Port);
};
public:
@@ -97,6 +99,7 @@ class Device {
void printUsage(std::string program);
void show(std::string program);
void showTrigger(std::string name);
+ void sortAccessoryCards();
void store(std::string name, std::string value);
void storeTrigger(std::string name, std::string value);
void Verbose(bool val);