PicoScenes API Docs
 
Loading...
Searching...
No Matches
SDRHardwareInformation.hxx
Go to the documentation of this file.
1//
2// Created by Zhiping Jiang on 2024/1/24.
3//
4
5#ifndef PICOSCENES_PLATFORM_SDRFRONTENDHARDWAREINFORMATION_HXX
6#define PICOSCENES_PLATFORM_SDRFRONTENDHARDWAREINFORMATION_HXX
7
8#include <vector>
9#include <string>
10#include <map>
11#include <cstdint>
12#include "PicoScenesCommons.hxx"
13
14// Device combination types
15enum class SDRDeviceCombinationType: uint8_t {
16 None = 0, // Single device, no combination
17 MIMOCable = 1, // Combined via MIMO cable
18 Ethernet = 2 // Combined via Ethernet
19};
20
21// Ethernet connection interface with detailed information
23 bool isPrimary{false}; // Whether this is the primary interface
24 std::string ipAddress{}; // Device IP address
25 std::string hostInterfaceName{}; // Host interface name (e.g., eth0, eth1)
26 std::string hostPortAddress{}; // IP address of the host-side port
27 int linkSpeed{-1}; // Link speed in Mbps
28 int MTU{-1}; // Interface MTU
29 int txRingBufferDelta{0}; // Tx buffer adjustment
30 int rxRingBufferDelta{0}; // Rx buffer adjustment
31};
32
34 enum class SDRConnectionType: uint8_t {
35 Ethernet = 0,
36 USB = 1,
37 PCIe = 2,
38 UnSpecified = 255
39 };
40
42 std::vector<SDREthernetConnectionInterface> ethernetInterfaces{};
43
44 // Device combination information
46 uint8_t combinedDeviceCount{1}; // Total number of devices in the combination
47 uint8_t deviceIndexInCombination{0}; // Index of this device in the combination (0 for primary)
48 std::string combinationIdentifier{}; // Unique identifier for this combination (e.g., MIMO cable ID or combination group name)
49
50 // Convenience methods
52 if (connectionType != SDRConnectionType::Ethernet) return nullptr;
53 auto it = std::find_if(ethernetInterfaces.begin(), ethernetInterfaces.end(),
54 [](const auto& iface) { return iface.isPrimary; });
55 if (it != ethernetInterfaces.end()) {
56 return &(*it);
57 }
58 return ethernetInterfaces.empty() ? nullptr : &ethernetInterfaces.front();
59 }
60
61 [[nodiscard]] bool isDualConnection() const {
62 return ethernetInterfaces.size() > 1;
63 }
64};
65
67 std::string serialNumber{};
68 std::string motherboardSerial{};
69 std::string frontendHardwareModel{};
70 std::vector<uint8_t> txChannelNumber{};
71 std::vector<uint8_t> rxChannelNumber{};
72
73 [[nodiscard]] int getNumTx() const { return txChannelNumber.size(); }
74 [[nodiscard]] int getNumRx() const { return rxChannelNumber.size(); }
75};
76
78 std::string serialNumber{}; // Daughterboard serial number
79 std::string model{}; // Daughterboard model
80 std::vector<std::shared_ptr<SDRFrontEndProfile>> frontends{}; // FrontEnds on this daughterboard
81};
82
84 std::string name;
85 std::string serial{};
86 std::string model{};
87 std::string resource{};
88 std::string fpgaImage{};
89 PicoScenesDeviceType deviceType{PicoScenesDeviceType::Unknown};
90 PicoScenesDeviceSubtype deviceSubtype{PicoScenesDeviceSubtype::Unknown};
91 uint16_t deviceOrder{0}; // The order in the original device list
92 SDRConnectionProfile connectionProfile; // Connection profile of the board
93 std::map<std::string, std::string> inverseMap{}; // Maps identifiers to their types
94 std::vector<SDRMainBoardInfo> otherBoards{}; // Connected boards that form a bigger virtual board
95
96 void merge(const SDRMainBoardInfo& other) {
97 // Add the other board to otherBoards
98 otherBoards.push_back(other);
99 }
100
101 [[nodiscard]] size_t getTotalBoardCount() const {
102 return 1 + otherBoards.size(); // Current board + other connected boards
103 }
104
106 // Clear existing map
107 inverseMap.clear();
108
109 // Add basic identifiers
110 if (!serial.empty()) inverseMap[serial] = "serial";
111 if (!name.empty()) inverseMap[name] = "name";
112 if (!resource.empty()) inverseMap[resource] = "resource";
113
114 // Add ethernet addresses if present
116 for (const auto& interface : connectionProfile.ethernetInterfaces) {
117 if (!interface.ipAddress.empty() && !inverseMap.contains(interface.ipAddress)) {
118 inverseMap[interface.ipAddress] = "addr";
119 }
120 }
121 }
122 }
123};
124
126public:
131 virtual std::vector<SDRMainBoardInfo> getAllHardwareBoards(bool refresh = false) {
132 if (refresh || boardInfoChanged) {
134 boardInfoChanged = false;
135 }
136 std::vector<SDRMainBoardInfo> allBoards{boardInfo};
137 allBoards.insert(allBoards.end(), boardInfo.otherBoards.begin(), boardInfo.otherBoards.end());
138 return allBoards;
139 }
140
147 virtual const SDRMainBoardInfo& getHardwareBoardByIndex(size_t boardIndex, bool refresh = false) {
148 if (refresh || boardInfoChanged) {
150 boardInfoChanged = false;
151 }
152 if (boardIndex == 0) return boardInfo;
153 if (boardIndex - 1 >= boardInfo.otherBoards.size()) {
154 throw std::out_of_range("Board index out of range");
155 }
156 return boardInfo.otherBoards[boardIndex - 1];
157 }
158
163 virtual size_t getHardwareBoardCount(bool refresh = false) {
164 if (refresh || boardInfoChanged) {
166 boardInfoChanged = false;
167 }
169 }
170
175 virtual const SDRMainBoardInfo& getHardwareBoardInfo(bool refresh = false) {
176 if (refresh || boardInfoChanged) {
178 boardInfoChanged = false;
179 }
180 return boardInfo;
181 }
182
187 virtual const std::vector<uint8_t>& getHardwareSupportedTxChannels(bool refresh = false) {
188 if (refresh || supportedChannelsChanged) {
191 }
192 return supportedTxChannels;
193 }
194
199 virtual const std::vector<uint8_t>& getHardwareSupportedRxChannels(bool refresh = false) {
200 if (refresh || supportedChannelsChanged) {
203 }
204 return supportedRxChannels;
205 }
206
212 virtual const std::vector<std::string>& getHardwareSupportedTxAntennas(uint8_t channel, bool refresh = false) {
213 if (refresh || supportedAntennasChanged) {
216 }
217 return supportedTxAntennas.at(channel);
218 }
219
225 virtual const std::vector<std::string>& getHardwareSupportedRxAntennas(uint8_t channel, bool refresh = false) {
226 if (refresh || supportedAntennasChanged) {
229 }
230 return supportedRxAntennas.at(channel);
231 }
232
237 virtual const std::vector<std::vector<std::string>>& getHardwareSupportedTxAntennas(bool refresh = false) {
238 if (refresh || supportedAntennasMapChanged) {
241 }
242 return supportedTxAntennas;
243 }
244
249 virtual const std::vector<std::vector<std::string>>& getHardwareSupportedRxAntennas(bool refresh = false) {
250 if (refresh || supportedAntennasMapChanged) {
253 }
254 return supportedRxAntennas;
255 }
256
262 virtual const std::pair<double, double>& getHardwareTxGainRange(uint8_t channel, bool refresh = false) {
263 if (refresh || gainRangesChanged) {
265 gainRangesChanged = false;
266 }
267 return txGainRanges.at(channel);
268 }
269
275 virtual const std::pair<double, double>& getHardwareRxGainRange(uint8_t channel, bool refresh = false) {
276 if (refresh || gainRangesChanged) {
278 gainRangesChanged = false;
279 }
280 return rxGainRanges.at(channel);
281 }
282
287 virtual const std::vector<std::pair<double, double>>& getHardwareTxGainRanges(bool refresh = false) {
288 if (refresh || gainRangesMapChanged) {
290 gainRangesMapChanged = false;
291 }
292 return txGainRanges;
293 }
294
299 virtual const std::vector<std::pair<double, double>>& getHardwareRxGainRanges(bool refresh = false) {
300 if (refresh || gainRangesMapChanged) {
302 gainRangesMapChanged = false;
303 }
304 return rxGainRanges;
305 }
306
312 virtual const std::pair<double, double>& getHardwareTxFrequencyRange(uint8_t channel, bool refresh = false) {
313 if (refresh || frequencyRangesChanged) {
316 }
317 return txFrequencyRanges.at(channel);
318 }
319
325 virtual const std::pair<double, double>& getHardwareRxFrequencyRange(uint8_t channel, bool refresh = false) {
326 if (refresh || frequencyRangesChanged) {
329 }
330 return rxFrequencyRanges.at(channel);
331 }
332
337 virtual const std::vector<std::pair<double, double>>& getHardwareTxFrequencyRanges(bool refresh = false) {
338 if (refresh || frequencyRangesMapChanged) {
341 }
342 return txFrequencyRanges;
343 }
344
349 virtual const std::vector<std::pair<double, double>>& getHardwareRxFrequencyRanges(bool refresh = false) {
350 if (refresh || frequencyRangesMapChanged) {
353 }
354 return rxFrequencyRanges;
355 }
356
362 virtual const std::pair<double, double>& getHardwareTxSamplingRateRange(uint8_t channel, bool refresh = false) {
363 if (refresh || samplingRateRangesChanged) {
366 }
367 return txSamplingRateRanges.at(channel);
368 }
369
375 virtual const std::pair<double, double>& getHardwareRxSamplingRateRange(uint8_t channel, bool refresh = false) {
376 if (refresh || samplingRateRangesChanged) {
379 }
380 return rxSamplingRateRanges.at(channel);
381 }
382
387 virtual const std::vector<std::pair<double, double>>& getHardwareTxSamplingRateRanges(bool refresh = false) {
388 if (refresh || samplingRateRangesMapChanged) {
391 }
393 }
394
399 virtual const std::vector<std::pair<double, double>>& getHardwareRxSamplingRateRanges(bool refresh = false) {
400 if (refresh || samplingRateRangesMapChanged) {
403 }
405 }
406
411 virtual const std::vector<double>& getHardwareSupportedMasterClockRates(bool refresh = false) {
412 if (refresh || masterClockRatesChanged) {
415 }
417 }
418
423 virtual const std::vector<std::string>& getHardwareSupportedClockAndTimeSources(bool refresh = false) {
424 if (refresh || clockAndTimeSourcesChanged) {
427 }
429 }
430
436 virtual const std::vector<std::string>& getHardwareSupportedSensors(uint8_t channel, bool refresh = false) {
437 if (refresh || sensorsChanged) {
439 sensorsChanged = false;
440 }
441 return supportedSensors.at(channel);
442 }
443
448 virtual const std::vector<std::vector<std::string>>& getAllHardwareSupportedSensors(bool refresh = false) {
449 if (refresh || sensorsMapChanged) {
451 sensorsMapChanged = false;
452 }
453 return supportedSensors;
454 }
455
460 virtual const std::vector<double>& getHardwareTemperatures(bool refresh = false) {
461 if (refresh || temperaturesChanged) {
463 }
464 return temperatureReadings;
465 }
466
472 virtual bool getHardwareAGCSupport(uint8_t channel, bool refresh = false) {
473 if (refresh || agcSupportChanged) {
475 agcSupportChanged = false;
476 }
477 return agcSupport.at(channel);
478 }
479
484 virtual const std::vector<bool>& getHardwareAGCSupport(bool refresh = false) {
485 if (refresh || agcSupportMapChanged) {
487 agcSupportMapChanged = false;
488 }
489 return agcSupport;
490 }
491
497 virtual const std::shared_ptr<SDRFrontEndProfile>& getHardwareFrontEndProfile(uint8_t channel, bool refresh = false) {
498 if (refresh || frontendProfilesChanged) {
501 }
502 return frontendProfiles.at(channel);
503 }
504
509 virtual const std::vector<std::shared_ptr<SDRFrontEndProfile>>& getHardwareFrontEndProfiles(bool refresh = false) {
510 if (refresh || frontendProfilesChanged) {
513 }
514 return frontendProfiles;
515 }
516
522 virtual const SDRDaughterboardProfile& getHardwareDaughterboardProfile(size_t index, bool refresh = false) {
523 if (refresh || frontendProfilesChanged) {
526 }
527 return daughterboardProfiles.at(index);
528 }
529
534 virtual const std::vector<SDRDaughterboardProfile>& getHardwareDaughterboardProfiles(bool refresh = false) {
535 if (refresh || frontendProfilesChanged) {
538 }
540 }
541
557
559 std::ostringstream info;
560 const auto& board = getHardwareBoardInfo();
561
562 // Get maximum line width for border
563 size_t maxWidth = 100; // wider width for better readability
564
565 // Top border
566 info << "\n" << std::string(maxWidth, '*') << "\n";
567 // Print information for each board
568 const auto& boards = getAllHardwareBoards();
569 for (size_t i = 0; i < boards.size(); i++) {
570 const auto& board = boards[i];
571 info << "* Board " << i << ": " << board.name
572 << " [Serial: " << board.serial
573 << ", Model: " << board.model
574 << ", FPGA: " << board.fpgaImage
575 << ", Subtype: " << DeviceSubtype2String(board.deviceSubtype) << "]\n";
576
577 // Print connectivity information
578 const auto& conn = board.connectionProfile;
579 info << "* Connection: " << (conn.connectionType == SDRConnectionProfile::SDRConnectionType::Ethernet ?
580 "Ethernet" :
581 conn.connectionType == SDRConnectionProfile::SDRConnectionType::PCIe ? "PCIe" :
582 conn.connectionType == SDRConnectionProfile::SDRConnectionType::USB ? "USB" : "Unknown") << "\n";
583
584 if (conn.connectionType == SDRConnectionProfile::SDRConnectionType::Ethernet) {
585 for (const auto& eth : conn.ethernetInterfaces) {
586 info << "* Interface: " << eth.hostInterfaceName
587 << "=" << eth.ipAddress << " Speed=" << eth.linkSpeed / 1000 << "GbE MTU=" << eth.MTU << "\n";
588 }
589 }
590 }
591
592 // Section separator
593 info << "*" << std::string(maxWidth-2, '-') << "\n";
594 const auto& masterClockRates = getHardwareSupportedMasterClockRates();
595 info << "* Supported Master Clock Rates: [";
596 if (!masterClockRates.empty()) {
597 auto minRate = *std::min_element(masterClockRates.begin(), masterClockRates.end()) / 1e6;
598 auto maxRate = *std::max_element(masterClockRates.begin(), masterClockRates.end()) / 1e6;
599 info << minRate << " MHz, " << maxRate << " MHz";
600 }
601 info << "]\n";
602 info << "* Available Channel #: Tx (Transmit)=";
603 const auto& txChannels = getHardwareSupportedTxChannels();
604 if (txChannels.empty()) {
605 info << "N/A";
606 } else {
607 info << "[";
608 for (size_t chIndex = 0; chIndex < txChannels.size(); ++chIndex) {
609 info << (chIndex == 0 ? "" : ", ") << static_cast<int>(txChannels[chIndex]);
610 }
611 info << "]";
612 }
613 info << ", and Rx (Receive)=";
614 const auto& rxChannels = getHardwareSupportedRxChannels();
615 if (rxChannels.empty()) {
616 info << "N/A";
617 } else {
618 info << "[";
619 for (size_t chIndex = 0; chIndex < rxChannels.size(); ++chIndex) {
620 info << (chIndex == 0 ? "" : ", ") << static_cast<int>(rxChannels[chIndex]);
621 }
622 info << "]";
623 }
624 info << "\n";
625
626 // Section separator
627 info << "*" << std::string(maxWidth-2, '-') << "\n";
628
629 // Combined Channel-Frontend-Antenna Mapping section
630 info << "* <Motherboard -> Channel # (Tx/Rx) -> Tx/Rx FrontEnd -> Available Antennas> Mapping: \n";
631
632 // Process Tx channels
634 const auto& daughterboards = getHardwareDaughterboardProfiles();
635
636 // Helper function to get motherboard info for a frontend
637 auto getMboardInfo = [&](const std::string& frontendSerial) -> std::string {
638 for (const auto& db : daughterboards) {
639 for (const auto& fe : db.frontends) {
640 if (fe->serialNumber == frontendSerial) {
641 return fe->motherboardSerial + " (" +
642 DeviceSubtype2String(board.deviceSubtype) + ")";
643 }
644 }
645 }
646 return "N/A";
647 };
648
649 for (size_t i = 0; i < txChannels.size(); i++) {
650 uint8_t ch = txChannels[i];
651
652 // Start with motherboard info
653 info << "* ";
654
655 // Frontend info to get motherboard info
656 std::string frontendSerial;
657 for (const auto& profile : frontendProfiles) {
658 if (std::find(profile->txChannelNumber.begin(), profile->txChannelNumber.end(), ch) != profile->txChannelNumber.end()) {
659 frontendSerial = profile->serialNumber;
660 break;
661 }
662 }
663
664 // Print motherboard info
665 info << getMboardInfo(frontendSerial) << " -> ";
666
667 // Channel info
668 info << static_cast<int>(ch) << " (Tx) -> ";
669
670 // Frontend info
671 bool foundFrontend = false;
672 for (const auto& profile : frontendProfiles) {
673 if (std::find(profile->txChannelNumber.begin(), profile->txChannelNumber.end(), ch) != profile->txChannelNumber.end()) {
674 info << profile->serialNumber;
675 if (!profile->frontendHardwareModel.empty()) {
676 info << " (" << profile->frontendHardwareModel << ")";
677 }
678 foundFrontend = true;
679 break;
680 }
681 }
682 if (!foundFrontend) {
683 info << "N/A";
684 }
685
686 // Antenna info
687 info << " -> ";
688 const auto& supportedAnts = getHardwareSupportedTxAntennas(ch);
689 if (supportedAnts.empty()) {
690 info << "None";
691 } else {
692 for (size_t j = 0; j < supportedAnts.size(); j++) {
693 if (supportedAnts[j].empty()) {
694 info << "None";
695 } else {
696 info << supportedAnts[j];
697 }
698 if (j < supportedAnts.size() - 1) {
699 info << ", ";
700 }
701 }
702 }
703 info << "\n";
704 }
705
706 // Process Rx channels
707 for (size_t i = 0; i < rxChannels.size(); i++) {
708 uint8_t ch = rxChannels[i];
709
710 // Start with motherboard info
711 info << "* ";
712
713 // Frontend info to get motherboard info
714 std::string frontendSerial;
715 for (const auto& profile : frontendProfiles) {
716 if (std::find(profile->rxChannelNumber.begin(), profile->rxChannelNumber.end(), ch) != profile->rxChannelNumber.end()) {
717 frontendSerial = profile->serialNumber;
718 break;
719 }
720 }
721
722 // Print motherboard info
723 info << getMboardInfo(frontendSerial) << " -> ";
724
725 // Channel info
726 info << static_cast<int>(ch) << " (Rx) -> ";
727
728 // Frontend info
729 bool foundFrontend = false;
730 for (const auto& profile : frontendProfiles) {
731 if (std::find(profile->rxChannelNumber.begin(), profile->rxChannelNumber.end(), ch) != profile->rxChannelNumber.end()) {
732 info << profile->serialNumber;
733 if (!profile->frontendHardwareModel.empty()) {
734 info << " (" << profile->frontendHardwareModel << ")";
735 }
736 foundFrontend = true;
737 break;
738 }
739 }
740 if (!foundFrontend) {
741 info << "N/A";
742 }
743
744 // Antenna info
745 info << " -> ";
746 const auto& supportedAnts = getHardwareSupportedRxAntennas(ch);
747 if (supportedAnts.empty()) {
748 info << "None";
749 } else {
750 for (size_t j = 0; j < supportedAnts.size(); j++) {
751 if (supportedAnts[j].empty()) {
752 info << "None";
753 } else {
754 info << supportedAnts[j];
755 }
756 if (j < supportedAnts.size() - 1) {
757 info << ", ";
758 }
759 }
760 }
761 info << "\n";
762 }
763
764 // Section separator
765 info << "*" << std::string(maxWidth-2, '-') << "\n";
766
767 // Channel Capabilities section
768 info << "* Channel Capabilities:\n";
769
770 // Process Tx channels capabilities
771 for (size_t i = 0; i < txChannels.size(); i++) {
772 uint8_t ch = txChannels[i];
773 info << "* # " << static_cast<int>(ch) << " (Tx):\n";
774
775 // Gain range
776 info << "* Gain -> " << std::fixed << std::setprecision(1)
777 << getHardwareTxGainRange(ch).first << " to "
778 << getHardwareTxGainRange(ch).second << " dB\n";
779
780 // Frequency range
781 info << "* Carrier Frequency -> " << std::fixed << std::setprecision(1)
782 << getHardwareTxFrequencyRange(ch).first/1e6 << " to "
783 << getHardwareTxFrequencyRange(ch).second/1e6 << " MHz\n";
784
785 // Sampling rate range
786 info << "* Sampling Rate -> " << std::fixed << std::setprecision(2)
787 << getHardwareTxSamplingRateRange(ch).first/1e6 << " to "
788 << getHardwareTxSamplingRateRange(ch).second/1e6 << " MHz\n";
789 }
790
791 // Process Rx channels capabilities including AGC support
792 const auto& agcSupport = getHardwareAGCSupport();
793 for (size_t i = 0; i < rxChannels.size(); i++) {
794 uint8_t ch = rxChannels[i];
795 info << "* # " << static_cast<int>(ch) << " (Rx):\n";
796
797 // Gain range
798 info << "* Gain -> " << std::fixed << std::setprecision(1)
799 << getHardwareRxGainRange(ch).first << " to "
800 << getHardwareRxGainRange(ch).second << " dB\n";
801
802 // Frequency range
803 info << "* Carrier Frequency -> " << std::fixed << std::setprecision(1)
804 << getHardwareRxFrequencyRange(ch).first/1e6 << " to "
805 << getHardwareRxFrequencyRange(ch).second/1e6 << " MHz\n";
806
807 // Sampling rate range
808 info << "* Sampling Rate -> " << std::fixed << std::setprecision(2)
809 << getHardwareRxSamplingRateRange(ch).first/1e6 << " to "
810 << getHardwareRxSamplingRateRange(ch).second/1e6 << " MHz\n";
811
812 // AGC support
813 if (i < agcSupport.size() && agcSupport[i]) {
814 info << "* AGC -> Supported\n";
815 } else {
816 info << "* AGC -> Not Supported\n";
817 }
818 }
819
820 // Bottom border
821 info << std::string(maxWidth, '*') << "\n";
822
823 return info.str();
824 }
825
826 virtual ~SDRDeviceHardwareInformation() = default;
827
828protected:
831
834
836 }
837
840
843
846
849
851 }
852
855
857 }
858
860 }
861
864
867
868 // Board information (motherboard, FPGA, daughterboard)
870 mutable bool boardInfoChanged{true};
871
872 // Channel information
873 mutable std::vector<uint8_t> supportedTxChannels{};
874 mutable std::vector<uint8_t> supportedRxChannels{};
875 mutable bool supportedChannelsChanged{true};
876
877 // Daughterboard and Frontend profiles
878 mutable std::vector<SDRDaughterboardProfile> daughterboardProfiles{}; // Vector of daughterboards
879 mutable std::vector<std::shared_ptr<SDRFrontEndProfile>> frontendProfiles{}; // channel -> frontend
880 mutable bool frontendProfilesChanged{true};
881
882 // Antenna information
883 mutable std::vector<std::vector<std::string>> supportedTxAntennas{};
884 mutable std::vector<std::vector<std::string>> supportedRxAntennas{};
885 mutable bool supportedAntennasChanged{true};
886 mutable bool supportedAntennasMapChanged{true};
887
888 // Gain ranges
889 mutable std::vector<std::pair<double, double>> txGainRanges{};
890 mutable std::vector<std::pair<double, double>> rxGainRanges{};
891 mutable bool gainRangesChanged{true};
892 mutable bool gainRangesMapChanged{true};
893
894 // Frequency ranges
895 mutable std::vector<std::pair<double, double>> txFrequencyRanges{};
896 mutable std::vector<std::pair<double, double>> rxFrequencyRanges{};
897 mutable bool frequencyRangesChanged{true};
898 mutable bool frequencyRangesMapChanged{true};
899
900 // Sampling rate ranges
901 mutable std::vector<std::pair<double, double>> txSamplingRateRanges{};
902 mutable std::vector<std::pair<double, double>> rxSamplingRateRanges{};
903 mutable bool samplingRateRangesChanged{true};
905
906 // Master clock rates
907 mutable std::vector<double> supportedMasterClockRates{};
908 mutable bool masterClockRatesChanged{true};
909
910 // Clock and time sources
911 mutable std::vector<std::string> supportedClockAndTimeSources{};
912 mutable bool clockAndTimeSourcesChanged{true};
913
914 // Sensors
915 mutable std::vector<std::vector<std::string>> supportedSensors{}; // channel -> sensors
916 mutable bool sensorsChanged{true};
917 mutable bool sensorsMapChanged{true};
918
919 // Temperature sensors
920 mutable std::vector<double> temperatureReadings{};
921 mutable bool temperaturesChanged{true};
922
923 // AGC support
924 mutable std::vector<bool> agcSupport{}; // per channel AGC support
925 mutable bool agcSupportChanged{true};
926 mutable bool agcSupportMapChanged{true};
927
928};
929
930#endif //PICOSCENES_PLATFORM_SDRFRONTENDHARDWAREINFORMATION_HXX
std::vector< uint8_t > supportedRxChannels
virtual const std::vector< std::string > & getHardwareSupportedClockAndTimeSources(bool refresh=false)
Get the supported clock sources.
std::vector< std::string > supportedClockAndTimeSources
virtual ~SDRDeviceHardwareInformation()=default
std::vector< std::vector< std::string > > supportedRxAntennas
virtual const std::vector< std::vector< std::string > > & getHardwareSupportedTxAntennas(bool refresh=false)
Get the hardware supported Tx antennas for all channels.
std::vector< std::pair< double, double > > txGainRanges
std::vector< std::pair< double, double > > rxGainRanges
virtual const std::shared_ptr< SDRFrontEndProfile > & getHardwareFrontEndProfile(uint8_t channel, bool refresh=false)
Get the frontend profile for a specific channel.
std::vector< double > supportedMasterClockRates
virtual const std::vector< SDRDaughterboardProfile > & getHardwareDaughterboardProfiles(bool refresh=false)
Get all daughterboard profiles.
virtual const std::vector< double > & getHardwareTemperatures(bool refresh=false)
Get the hardware's temperature sensors readings.
std::vector< std::pair< double, double > > txFrequencyRanges
virtual const std::vector< uint8_t > & getHardwareSupportedTxChannels(bool refresh=false)
Get the hardware supported Tx channels.
virtual bool getHardwareAGCSupport(uint8_t channel, bool refresh=false)
Get the AGC support for a specific channel.
std::vector< std::pair< double, double > > txSamplingRateRanges
virtual const std::pair< double, double > & getHardwareTxFrequencyRange(uint8_t channel, bool refresh=false)
Get the Tx frequency range for a specific channel.
virtual const SDRMainBoardInfo & getHardwareBoardByIndex(size_t boardIndex, bool refresh=false)
Get a specific board's information by its index (0 is main board).
std::vector< std::shared_ptr< SDRFrontEndProfile > > frontendProfiles
virtual const std::pair< double, double > & getHardwareRxGainRange(uint8_t channel, bool refresh=false)
Get the Rx gain range for a specific channel.
std::vector< std::pair< double, double > > rxSamplingRateRanges
virtual const std::vector< std::pair< double, double > > & getHardwareRxFrequencyRanges(bool refresh=false)
Get the Rx frequency range for all channels.
virtual const std::vector< bool > & getHardwareAGCSupport(bool refresh=false)
Get the AGC support for all channels.
virtual const std::vector< std::pair< double, double > > & getHardwareRxGainRanges(bool refresh=false)
Get the hardware Rx gain range for all channels.
virtual size_t getHardwareBoardCount(bool refresh=false)
Get the total number of boards (main + connected).
virtual const std::vector< std::string > & getHardwareSupportedSensors(uint8_t channel, bool refresh=false)
Get the supported sensor names for a specific channel.
virtual const std::vector< std::pair< double, double > > & getHardwareTxSamplingRateRanges(bool refresh=false)
Get the Tx sampling rate range for all channels.
virtual const std::vector< double > & getHardwareSupportedMasterClockRates(bool refresh=false)
Get the supported master clock rates.
virtual std::vector< SDRMainBoardInfo > getAllHardwareBoards(bool refresh=false)
Get all hardware boards information including the main board and connected boards.
virtual const std::pair< double, double > & getHardwareRxFrequencyRange(uint8_t channel, bool refresh=false)
Get the Rx frequency range for a specific channel.
virtual const std::pair< double, double > & getHardwareRxSamplingRateRange(uint8_t channel, bool refresh=false)
Get the Rx sampling rate range for a specific channel.
std::vector< SDRDaughterboardProfile > daughterboardProfiles
std::vector< uint8_t > supportedTxChannels
virtual const std::vector< std::vector< std::string > > & getHardwareSupportedRxAntennas(bool refresh=false)
Get the hardware supported Rx antennas for all channels.
virtual const std::pair< double, double > & getHardwareTxGainRange(uint8_t channel, bool refresh=false)
Get the Tx gain range for a specific channel.
virtual const std::vector< std::string > & getHardwareSupportedRxAntennas(uint8_t channel, bool refresh=false)
Get the supported Rx antennas for a specific channel.
virtual const std::vector< std::pair< double, double > > & getHardwareTxFrequencyRanges(bool refresh=false)
Get the Tx frequency range for all channels.
std::vector< std::pair< double, double > > rxFrequencyRanges
virtual const std::vector< std::pair< double, double > > & getHardwareTxGainRanges(bool refresh=false)
Get the hardware Tx gain range for all channels.
virtual const std::vector< std::shared_ptr< SDRFrontEndProfile > > & getHardwareFrontEndProfiles(bool refresh=false)
Get all frontend profiles.
virtual const std::vector< std::string > & getHardwareSupportedTxAntennas(uint8_t channel, bool refresh=false)
Get the supported Tx antennas for a specific channel.
virtual const std::pair< double, double > & getHardwareTxSamplingRateRange(uint8_t channel, bool refresh=false)
Get the Tx sampling rate range for a specific channel.
virtual const SDRDaughterboardProfile & getHardwareDaughterboardProfile(size_t index, bool refresh=false)
Get the daughterboard profile at a specific index.
std::vector< std::vector< std::string > > supportedTxAntennas
std::vector< std::vector< std::string > > supportedSensors
virtual const std::vector< uint8_t > & getHardwareSupportedRxChannels(bool refresh=false)
Get the hardware supported Rx channels.
virtual const std::vector< std::pair< double, double > > & getHardwareRxSamplingRateRanges(bool refresh=false)
Get the Rx sampling rate range for all channels.
virtual const SDRMainBoardInfo & getHardwareBoardInfo(bool refresh=false)
Get the hardware board information.
virtual const std::vector< std::vector< std::string > > & getAllHardwareSupportedSensors(bool refresh=false)
Get all supported sensors for all channels.
std::vector< SDREthernetConnectionInterface > ethernetInterfaces
SDRDeviceCombinationType combinationType
const SDREthernetConnectionInterface * getPrimaryInterface() const
std::vector< std::shared_ptr< SDRFrontEndProfile > > frontends
std::vector< uint8_t > rxChannelNumber
std::vector< uint8_t > txChannelNumber
std::map< std::string, std::string > inverseMap
PicoScenesDeviceType deviceType
std::vector< SDRMainBoardInfo > otherBoards
SDRConnectionProfile connectionProfile
void merge(const SDRMainBoardInfo &other)
size_t getTotalBoardCount() const
PicoScenesDeviceSubtype deviceSubtype