MythTV  master
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
FirewireDevice Class Referenceabstract

#include <libmythtv/recorders/firewiredevice.h>

Inheritance diagram for FirewireDevice:
[legend]
Collaboration diagram for FirewireDevice:
[legend]

Public Types

enum  PowerState : std::uint8_t { kAVCPowerOn, kAVCPowerOff, kAVCPowerUnknown, kAVCPowerQueryFailed }
 
enum  IEEE1394Command : std::uint8_t {
  kAVCControlCommand = 0x00, kAVCStatusInquiryCommand = 0x01, kAVCSpecificInquiryCommand = 0x02, kAVCNotifyCommand = 0x03,
  kAVCGeneralInquiryCommand = 0x04, kAVCNotImplementedStatus = 0x08, kAVCAcceptedStatus = 0x09, kAVCRejectedStatus = 0x0a,
  kAVCInTransitionStatus = 0x0b, kAVCImplementedStatus = 0x0c, kAVCChangedStatus = 0x0d, kAVCInterimStatus = 0x0f,
  kAVCResponseImplemented = 0x0c
}
 
enum  IEEE1394UnitAddress : std::uint8_t {
  kAVCSubunitId0 = 0x00, kAVCSubunitId1 = 0x01, kAVCSubunitId2 = 0x02, kAVCSubunitId3 = 0x03,
  kAVCSubunitId4 = 0x04, kAVCSubunitIdExtended = 0x05, kAVCSubunitIdIgnore = 0x07, kAVCSubunitTypeVideoMonitor = (0x00 << 3),
  kAVCSubunitTypeAudio = (0x01 << 3), kAVCSubunitTypePrinter = (0x02 << 3), kAVCSubunitTypeDiscRecorder = (0x03 << 3), kAVCSubunitTypeTapeRecorder = (0x04 << 3),
  kAVCSubunitTypeTuner = (0x05 << 3), kAVCSubunitTypeCA = (0x06 << 3), kAVCSubunitTypeVideoCamera = (0x07 << 3), kAVCSubunitTypePanel = (0x09 << 3),
  kAVCSubunitTypeBulletinBoard = (0x0a << 3), kAVCSubunitTypeCameraStorage = (0x0b << 3), kAVCSubunitTypeMusic = (0x0c << 3), kAVCSubunitTypeVendorUnique = (0x1c << 3),
  kAVCSubunitTypeExtended = (0x1e << 3), kAVCSubunitTypeUnit = (0x1f << 3)
}
 
enum  IEEE1394Opcode : std::uint8_t {
  kAVCUnitPlugInfoOpcode = 0x02, kAVCUnitDigitalOutputOpcode = 0x10, kAVCUnitDigitalInputOpcode = 0x11, kAVCUnitChannelUsageOpcode = 0x12,
  kAVCUnitOutputPlugSignalFormatOpcode = 0x18, kAVCUnitInputPlugSignalFormatOpcode = 0x19, kAVCUnitConnectAVOpcode = 0x20, kAVCUnitDisconnectAVOpcode = 0x21,
  kAVCUnitConnectionsOpcode = 0x22, kAVCUnitConnectOpcode = 0x24, kAVCUnitDisconnectOpcode = 0x25, kAVCUnitUnitInfoOpcode = 0x30,
  kAVCUnitSubunitInfoOpcode = 0x31, kAVCUnitSignalSourceOpcode = 0x1a, kAVCUnitPowerOpcode = 0xb2, kAVCCommonOpenDescriptorOpcode = 0x08,
  kAVCCommonReadDescriptorOpcode = 0x09, kAVCCommonWriteDescriptorOpcode = 0x0A, kAVCCommonSearchDescriptorOpcode = 0x0B, kAVCCommonObjectNumberSelectOpcode = 0x0D,
  kAVCCommonPowerOpcode = 0xB2, kAVCCommonReserveOpcode = 0x01, kAVCCommonPlugInfoOpcode = 0x02, kAVCCommonVendorDependentOpcode = 0x00,
  kAVCPanelPassThrough = 0x7c
}
 
enum  IEEE1394UnitPowerParam0 : std::uint8_t { kAVCPowerStateOn = 0x70, kAVCPowerStateOff = 0x60, kAVCPowerStateQuery = 0x7f }
 
enum  IEEE1394PanelPassThroughParam0 : std::uint8_t {
  kAVCPanelKeySelect = 0x00, kAVCPanelKeyUp = 0x01, kAVCPanelKeyDown = 0x02, kAVCPanelKeyLeft = 0x03,
  kAVCPanelKeyRight = 0x04, kAVCPanelKeyRightUp = 0x05, kAVCPanelKeyRightDown = 0x06, kAVCPanelKeyLeftUp = 0x07,
  kAVCPanelKeyLeftDown = 0x08, kAVCPanelKeyRootMenu = 0x09, kAVCPanelKeySetupMenu = 0x0A, kAVCPanelKeyContentsMenu = 0x0B,
  kAVCPanelKeyFavoriteMenu = 0x0C, kAVCPanelKeyExit = 0x0D, kAVCPanelKey0 = 0x20, kAVCPanelKey1 = 0x21,
  kAVCPanelKey2 = 0x22, kAVCPanelKey3 = 0x23, kAVCPanelKey4 = 0x24, kAVCPanelKey5 = 0x25,
  kAVCPanelKey6 = 0x26, kAVCPanelKey7 = 0x27, kAVCPanelKey8 = 0x28, kAVCPanelKey9 = 0x29,
  kAVCPanelKeyDot = 0x2A, kAVCPanelKeyEnter = 0x2B, kAVCPanelKeyClear = 0x2C, kAVCPanelKeyChannelUp = 0x30,
  kAVCPanelKeyChannelDown = 0x31, kAVCPanelKeyPreviousChannel = 0x32, kAVCPanelKeySoundSelect = 0x33, kAVCPanelKeyInputSelect = 0x34,
  kAVCPanelKeyDisplayInfo = 0x35, kAVCPanelKeyHelp = 0x36, kAVCPanelKeyPageUp = 0x37, kAVCPanelKeyPageDown = 0x38,
  kAVCPanelKeyPower = 0x40, kAVCPanelKeyVolumeUp = 0x41, kAVCPanelKeyVolumeDown = 0x42, kAVCPanelKeyMute = 0x43,
  kAVCPanelKeyPlay = 0x44, kAVCPanelKeyStop = 0x45, kAVCPanelKeyPause = 0x46, kAVCPanelKeyRecord = 0x47,
  kAVCPanelKeyRewind = 0x48, kAVCPanelKeyFastForward = 0x49, kAVCPanelKeyEject = 0x4a, kAVCPanelKeyForward = 0x4b,
  kAVCPanelKeyBackward = 0x4c, kAVCPanelKeyAngle = 0x50, kAVCPanelKeySubPicture = 0x51, kAVCPanelKeyTuneFunction = 0x67,
  kAVCPanelKeyPress = 0x00, kAVCPanelKeyRelease = 0x80
}
 

Public Member Functions

virtual ~FirewireDevice ()=default
 
virtual bool OpenPort (void)=0
 
virtual bool ClosePort (void)=0
 
virtual bool ResetBus (void)
 
virtual void AddListener (TSDataListener *listener)
 
virtual void RemoveListener (TSDataListener *listener)
 
virtual bool SetPowerState (bool on)
 
virtual bool SetChannel (const QString &panel_model, uint alt_method, uint channel)
 
virtual bool IsPortOpen (void) const =0
 
bool IsSTBBufferCleared (void) const
 
virtual PowerState GetPowerState (void)
 

Static Public Member Functions

static bool IsSTBSupported (const QString &model)
 
static QString GetModelName (uint vendor_id, uint model_id)
 
static std::vector< AVCInfoGetSTBList (void)
 

Protected Member Functions

 FirewireDevice (uint64_t guid, uint subunitid, uint speed)
 
virtual bool SendAVCCommand (const std::vector< uint8_t > &cmd, std::vector< uint8_t > &result, int retry_cnt)=0
 
void SetLastChannel (uint channel)
 
void ProcessPATPacket (const TSPacket &tspacket)
 
virtual void BroadcastToListeners (const unsigned char *data, uint dataSize)
 

Protected Attributes

uint64_t m_guid
 
uint m_subunitid
 
uint m_speed
 
uint m_lastChannel {0}
 
uint m_lastCrc {0}
 
bool m_bufferCleared {true}
 
uint m_openPortCnt {0}
 
std::vector< TSDataListener * > m_listeners
 
QMutex m_lock
 

Static Protected Attributes

static QMap< uint64_t, QString > s_idToModel
 Vendor ID + Model ID to FirewireDevice STB model string. More...
 
static QMutex s_staticLock
 

Detailed Description

Definition at line 23 of file firewiredevice.h.

Member Enumeration Documentation

◆ PowerState

enum FirewireDevice::PowerState : std::uint8_t
Enumerator
kAVCPowerOn 
kAVCPowerOff 
kAVCPowerUnknown 
kAVCPowerQueryFailed 

Definition at line 28 of file firewiredevice.h.

◆ IEEE1394Command

enum FirewireDevice::IEEE1394Command : std::uint8_t
Enumerator
kAVCControlCommand 
kAVCStatusInquiryCommand 
kAVCSpecificInquiryCommand 
kAVCNotifyCommand 
kAVCGeneralInquiryCommand 
kAVCNotImplementedStatus 
kAVCAcceptedStatus 
kAVCRejectedStatus 
kAVCInTransitionStatus 
kAVCImplementedStatus 
kAVCChangedStatus 
kAVCInterimStatus 
kAVCResponseImplemented 

Definition at line 37 of file firewiredevice.h.

◆ IEEE1394UnitAddress

Enumerator
kAVCSubunitId0 
kAVCSubunitId1 
kAVCSubunitId2 
kAVCSubunitId3 
kAVCSubunitId4 
kAVCSubunitIdExtended 
kAVCSubunitIdIgnore 
kAVCSubunitTypeVideoMonitor 
kAVCSubunitTypeAudio 
kAVCSubunitTypePrinter 
kAVCSubunitTypeDiscRecorder 
kAVCSubunitTypeTapeRecorder 
kAVCSubunitTypeTuner 
kAVCSubunitTypeCA 
kAVCSubunitTypeVideoCamera 
kAVCSubunitTypePanel 
kAVCSubunitTypeBulletinBoard 
kAVCSubunitTypeCameraStorage 
kAVCSubunitTypeMusic 
kAVCSubunitTypeVendorUnique 
kAVCSubunitTypeExtended 
kAVCSubunitTypeUnit 

Definition at line 57 of file firewiredevice.h.

◆ IEEE1394Opcode

enum FirewireDevice::IEEE1394Opcode : std::uint8_t
Enumerator
kAVCUnitPlugInfoOpcode 
kAVCUnitDigitalOutputOpcode 
kAVCUnitDigitalInputOpcode 
kAVCUnitChannelUsageOpcode 
kAVCUnitOutputPlugSignalFormatOpcode 
kAVCUnitInputPlugSignalFormatOpcode 
kAVCUnitConnectAVOpcode 
kAVCUnitDisconnectAVOpcode 
kAVCUnitConnectionsOpcode 
kAVCUnitConnectOpcode 
kAVCUnitDisconnectOpcode 
kAVCUnitUnitInfoOpcode 
kAVCUnitSubunitInfoOpcode 
kAVCUnitSignalSourceOpcode 
kAVCUnitPowerOpcode 
kAVCCommonOpenDescriptorOpcode 
kAVCCommonReadDescriptorOpcode 
kAVCCommonWriteDescriptorOpcode 
kAVCCommonSearchDescriptorOpcode 
kAVCCommonObjectNumberSelectOpcode 
kAVCCommonPowerOpcode 
kAVCCommonReserveOpcode 
kAVCCommonPlugInfoOpcode 
kAVCCommonVendorDependentOpcode 
kAVCPanelPassThrough 

Definition at line 85 of file firewiredevice.h.

◆ IEEE1394UnitPowerParam0

Enumerator
kAVCPowerStateOn 
kAVCPowerStateOff 
kAVCPowerStateQuery 

Definition at line 120 of file firewiredevice.h.

◆ IEEE1394PanelPassThroughParam0

Enumerator
kAVCPanelKeySelect 
kAVCPanelKeyUp 
kAVCPanelKeyDown 
kAVCPanelKeyLeft 
kAVCPanelKeyRight 
kAVCPanelKeyRightUp 
kAVCPanelKeyRightDown 
kAVCPanelKeyLeftUp 
kAVCPanelKeyLeftDown 
kAVCPanelKeyRootMenu 
kAVCPanelKeySetupMenu 
kAVCPanelKeyContentsMenu 
kAVCPanelKeyFavoriteMenu 
kAVCPanelKeyExit 
kAVCPanelKey0 
kAVCPanelKey1 
kAVCPanelKey2 
kAVCPanelKey3 
kAVCPanelKey4 
kAVCPanelKey5 
kAVCPanelKey6 
kAVCPanelKey7 
kAVCPanelKey8 
kAVCPanelKey9 
kAVCPanelKeyDot 
kAVCPanelKeyEnter 
kAVCPanelKeyClear 
kAVCPanelKeyChannelUp 
kAVCPanelKeyChannelDown 
kAVCPanelKeyPreviousChannel 
kAVCPanelKeySoundSelect 
kAVCPanelKeyInputSelect 
kAVCPanelKeyDisplayInfo 
kAVCPanelKeyHelp 
kAVCPanelKeyPageUp 
kAVCPanelKeyPageDown 
kAVCPanelKeyPower 
kAVCPanelKeyVolumeUp 
kAVCPanelKeyVolumeDown 
kAVCPanelKeyMute 
kAVCPanelKeyPlay 
kAVCPanelKeyStop 
kAVCPanelKeyPause 
kAVCPanelKeyRecord 
kAVCPanelKeyRewind 
kAVCPanelKeyFastForward 
kAVCPanelKeyEject 
kAVCPanelKeyForward 
kAVCPanelKeyBackward 
kAVCPanelKeyAngle 
kAVCPanelKeySubPicture 
kAVCPanelKeyTuneFunction 
kAVCPanelKeyPress 
kAVCPanelKeyRelease 

Definition at line 127 of file firewiredevice.h.

Constructor & Destructor Documentation

◆ ~FirewireDevice()

virtual FirewireDevice::~FirewireDevice ( )
virtualdefault

◆ FirewireDevice()

FirewireDevice::FirewireDevice ( uint64_t  guid,
uint  subunitid,
uint  speed 
)
protected

Definition at line 31 of file firewiredevice.cpp.

Member Function Documentation

◆ OpenPort()

virtual bool FirewireDevice::OpenPort ( void  )
pure virtual

◆ ClosePort()

virtual bool FirewireDevice::ClosePort ( void  )
pure virtual

◆ ResetBus()

virtual bool FirewireDevice::ResetBus ( void  )
inlinevirtual

Reimplemented in LinuxFirewireDevice, and DarwinFirewireDevice.

Definition at line 197 of file firewiredevice.h.

◆ AddListener()

void FirewireDevice::AddListener ( TSDataListener listener)
virtual

◆ RemoveListener()

void FirewireDevice::RemoveListener ( TSDataListener listener)
virtual

◆ SetPowerState()

bool FirewireDevice::SetPowerState ( bool  on)
virtual

Definition at line 66 of file firewiredevice.cpp.

Referenced by FirewireChannel::SetPowerState().

◆ SetChannel()

bool FirewireDevice::SetChannel ( const QString &  panel_model,
uint  alt_method,
uint  channel 
)
virtual

◆ IsPortOpen()

virtual bool FirewireDevice::IsPortOpen ( void  ) const
pure virtual

◆ IsSTBBufferCleared()

bool FirewireDevice::IsSTBBufferCleared ( void  ) const
inline

Definition at line 209 of file firewiredevice.h.

Referenced by FirewireSignalMonitor::HandlePAT().

◆ GetPowerState()

FirewireDevice::PowerState FirewireDevice::GetPowerState ( void  )
virtual

Definition at line 100 of file firewiredevice.cpp.

Referenced by FirewireChannel::GetPowerState().

◆ IsSTBSupported()

bool FirewireDevice::IsSTBSupported ( const QString &  model)
static

Definition at line 483 of file firewiredevice.cpp.

Referenced by FirewireChannel::Open(), and SetChannel().

◆ GetModelName()

QString FirewireDevice::GetModelName ( uint  vendor_id,
uint  model_id 
)
static

Definition at line 350 of file firewiredevice.cpp.

Referenced by getFirewireList(), and FirewireModel::SetGUID().

◆ GetSTBList()

std::vector< AVCInfo > FirewireDevice::GetSTBList ( void  )
static

Definition at line 363 of file firewiredevice.cpp.

Referenced by FirewireGUID::FirewireGUID(), and getFirewireList().

◆ SendAVCCommand()

virtual bool FirewireDevice::SendAVCCommand ( const std::vector< uint8_t > &  cmd,
std::vector< uint8_t > &  result,
int  retry_cnt 
)
protectedpure virtual

◆ SetLastChannel()

void FirewireDevice::SetLastChannel ( uint  channel)
protected

Definition at line 320 of file firewiredevice.cpp.

Referenced by SetChannel().

◆ ProcessPATPacket()

void FirewireDevice::ProcessPATPacket ( const TSPacket tspacket)
protected

Definition at line 329 of file firewiredevice.cpp.

Referenced by BroadcastToListeners().

◆ BroadcastToListeners()

void FirewireDevice::BroadcastToListeners ( const unsigned char *  data,
uint  dataSize 
)
protectedvirtual

Reimplemented in DarwinFirewireDevice.

Definition at line 307 of file firewiredevice.cpp.

Referenced by DarwinFirewireDevice::BroadcastToListeners().

Member Data Documentation

◆ m_guid

uint64_t FirewireDevice::m_guid
protected

◆ m_subunitid

uint FirewireDevice::m_subunitid
protected

Definition at line 231 of file firewiredevice.h.

Referenced by SetChannel().

◆ m_speed

uint FirewireDevice::m_speed
protected

◆ m_lastChannel

uint FirewireDevice::m_lastChannel {0}
protected

Definition at line 233 of file firewiredevice.h.

Referenced by SetLastChannel().

◆ m_lastCrc

uint FirewireDevice::m_lastCrc {0}
protected

Definition at line 234 of file firewiredevice.h.

Referenced by ProcessPATPacket().

◆ m_bufferCleared

bool FirewireDevice::m_bufferCleared {true}
protected

Definition at line 235 of file firewiredevice.h.

Referenced by ProcessPATPacket(), and SetLastChannel().

◆ m_openPortCnt

uint FirewireDevice::m_openPortCnt {0}
protected

◆ m_listeners

std::vector<TSDataListener*> FirewireDevice::m_listeners
protected

◆ m_lock

QMutex FirewireDevice::m_lock
mutableprotected

◆ s_idToModel

QMap< uint64_t, QString > FirewireDevice::s_idToModel
staticprotected

Vendor ID + Model ID to FirewireDevice STB model string.

Definition at line 242 of file firewiredevice.h.

Referenced by GetModelName().

◆ s_staticLock

QMutex FirewireDevice::s_staticLock
staticprotected

Definition at line 243 of file firewiredevice.h.

Referenced by GetModelName().


The documentation for this class was generated from the following files: