MythTV  master
avcinfo.h
Go to the documentation of this file.
1 #ifndef AVC_INFO_H
2 #define AVC_INFO_H
3 
4 // C++ headers
5 #include <cstdint>
6 #include <vector>
7 using namespace std;
8 
9 // Qt headers
10 #include <QString>
11 
12 static inline QString guid_to_string(uint64_t guid)
13 {
14  return QString("%1").arg(guid, 16, 16, QLatin1Char('0')).toUpper();
15 }
16 
17 static inline uint64_t string_to_guid(const QString &guid)
18 {
19  return guid.toULongLong(nullptr, 16);
20 }
21 
22 class AVCInfo
23 {
24  public:
25  AVCInfo();
26  AVCInfo(const AVCInfo &o);
27  AVCInfo &operator=(const AVCInfo &o);
28  virtual ~AVCInfo() = default;
29 
30  virtual bool SendAVCCommand(
31  const vector<uint8_t> &/*cmd*/,
32  vector<uint8_t> &/*result*/,
33  int /*retry_cnt*/)
34  {
35  return false;
36  }
37 
38  bool GetSubunitInfo(void);
39 
40  bool IsSubunitType(int subunit_type) const;
41  QString GetSubunitInfoString(void) const;
42  QString GetGUIDString(void) const { return guid_to_string(m_guid); }
43 
44  public:
45  int m_port {-1};
46  int m_node {-1};
47  uint64_t m_guid {0};
48  uint m_specid {0};
49  uint m_vendorid {0};
50  uint m_modelid {0};
51  uint m_firmware_revision {0};
52  QString m_product_name;
53  uint8_t m_unit_table[32] {};
54 };
55 
56 #endif // AVC_INFO_H
static QString guid_to_string(uint64_t guid)
Definition: avcinfo.h:12
QString m_product_name
Definition: avcinfo.h:52
static uint64_t string_to_guid(const QString &guid)
Definition: avcinfo.h:17
virtual bool SendAVCCommand(const vector< uint8_t > &, vector< uint8_t > &, int)
Definition: avcinfo.h:30
unsigned int uint
Definition: compat.h:140
QString GetGUIDString(void) const
Definition: avcinfo.h:42