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