Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
PERIPHERALS::CPeripheralBusAndroid Class Reference

#include <PeripheralBusAndroid.h>

Inheritance diagram for PERIPHERALS::CPeripheralBusAndroid:
PERIPHERALS::CPeripheralBus IInputDeviceCallbacks IInputDeviceEventHandler CThread

Public Member Functions

 CPeripheralBusAndroid (CPeripherals &manager)
 
 ~CPeripheralBusAndroid () override
 
bool InitializeProperties (CPeripheral &peripheral) override
 Initialize the properties of a peripheral with a known location.
 
void Initialise (void) override
 Initialise this bus and start a polling thread if this bus needs polling.
 
void ProcessEvents () override
 Poll for events.
 
void OnInputDeviceAdded (int deviceId) override
 
void OnInputDeviceChanged (int deviceId) override
 
void OnInputDeviceRemoved (int deviceId) override
 
bool OnInputDeviceEvent (const AInputEvent *event) override
 
- Public Member Functions inherited from PERIPHERALS::CPeripheralBus
 CPeripheralBus (const std::string &threadname, CPeripherals &manager, PeripheralBusType type)
 
 ~CPeripheralBus (void) override
 
PeripheralBusType Type (void) const
 
bool NeedsPolling (void) const
 
virtual PeripheralPtr GetPeripheral (const std::string &strLocation) const
 Get the instance of the peripheral at the given location.
 
virtual bool HasPeripheral (const std::string &strLocation) const
 Check whether a peripheral is present at the given location.
 
virtual bool SupportsFeature (PeripheralFeature feature) const
 Check if the bus supports the given feature.
 
virtual unsigned int GetPeripheralsWithFeature (PeripheralVector &results, const PeripheralFeature feature) const
 Get all peripheral instances that have the given feature.
 
virtual unsigned int GetNumberOfPeripherals () const
 
virtual unsigned int GetNumberOfPeripheralsWithId (const int iVendorId, const int iProductId) const
 
virtual void GetFeatures (std::vector< PeripheralFeature > &features) const
 Get all features that are supported by devices on this bus.
 
virtual bool HasFeature (const PeripheralFeature feature) const
 Check whether there is at least one device present with the given feature.
 
virtual void OnDeviceAdded (const std::string &strLocation)
 Callback method for when a device has been added. Will perform a device scan.
 
virtual void OnDeviceChanged (const std::string &strLocation)
 Callback method for when a device has been changed. Will perform a device scan.
 
virtual void OnDeviceRemoved (const std::string &strLocation)
 Callback method for when a device has been removed. Will perform a device scan.
 
virtual void Clear (void)
 Stop the polling thread and clear all known devices on this bus.
 
virtual void TriggerDeviceScan (void)
 Scan for devices.
 
virtual void GetDirectory (const std::string &strPath, CFileItemList &items) const
 Get all fileitems for a path.
 
virtual PeripheralPtr GetByPath (const std::string &strPath) const
 Get the instance of a peripheral given it's path.
 
virtual void Register (const PeripheralPtr &peripheral)
 Register a new peripheral on this bus.
 
virtual bool FindComPort (std::string &strLocation)
 
virtual void EnableButtonMapping ()
 Initialize button mapping.
 
virtual void PowerOff (const std::string &strLocation)
 Power off the specified device.
 
- Public Member Functions inherited from IInputDeviceCallbacks
virtual ~IInputDeviceCallbacks ()=default
 
- Public Member Functions inherited from IInputDeviceEventHandler
virtual ~IInputDeviceEventHandler ()=default
 

Protected Member Functions

bool PerformDeviceScan (PeripheralScanResults &results) override
 Scan for devices on this bus and add them to the results list. This will have to be implemented for each bus.
 
- Protected Member Functions inherited from PERIPHERALS::CPeripheralBus
void Process (void) override
 
virtual bool ScanForDevices (void)
 
virtual void UnregisterRemovedDevices (const PeripheralScanResults &results)
 
virtual void RegisterNewDevices (const PeripheralScanResults &results)
 
- Protected Member Functions inherited from CThread
 CThread (const char *ThreadName)
 
virtual void OnStartup ()
 
virtual void OnExit ()
 
WaitResponse AbortableWait (CEvent &event, std::chrono::milliseconds duration=std::chrono::milliseconds(-1))
 
 CThread (IRunnable *pRunnable, const char *ThreadName)
 
virtual ~CThread ()
 
void Create (bool bAutoDelete=false)
 
template<typename Rep , typename Period >
void Sleep (std::chrono::duration< Rep, Period > duration)
 
bool IsAutoDelete () const
 
virtual void StopThread (bool bWait=true)
 
bool IsRunning () const
 
bool IsCurrentThread () const
 
bool Join (std::chrono::milliseconds duration)
 
bool SetPriority (const ThreadPriority &priority)
 Set the threads priority. This uses the platforms native threading library to do so.
 
virtual void OnException ()
 
- Protected Member Functions inherited from IInputDeviceCallbacks
 IInputDeviceCallbacks ()=default
 
- Protected Member Functions inherited from IInputDeviceEventHandler
 IInputDeviceEventHandler ()=default
 

Additional Inherited Members

- Protected Types inherited from CThread
enum  WaitResponse { WAIT_INTERRUPTED = -1 , WAIT_SIGNALED = 0 , WAIT_TIMEDOUT = 1 }
 
- Static Protected Member Functions inherited from CThread
static const std::thread::id GetCurrentThreadId ()
 
static CThreadGetCurrentThread ()
 
- Protected Attributes inherited from PERIPHERALS::CPeripheralBus
PeripheralVector m_peripherals
 
std::chrono::milliseconds m_iRescanTime
 
bool m_bNeedsPolling
 
CPeripheralsm_manager
 
const PeripheralBusType m_type
 
CCriticalSection m_critSection
 
CEvent m_triggerEvent
 
- Protected Attributes inherited from CThread
std::atomic< boolm_bStop
 

Constructor & Destructor Documentation

◆ CPeripheralBusAndroid()

CPeripheralBusAndroid::CPeripheralBusAndroid ( CPeripherals & manager)
explicit

◆ ~CPeripheralBusAndroid()

CPeripheralBusAndroid::~CPeripheralBusAndroid ( )
override

Member Function Documentation

◆ Initialise()

void CPeripheralBusAndroid::Initialise ( void )
overridevirtual

Initialise this bus and start a polling thread if this bus needs polling.

Reimplemented from PERIPHERALS::CPeripheralBus.

◆ InitializeProperties()

bool CPeripheralBusAndroid::InitializeProperties ( CPeripheral & peripheral)
overridevirtual

Initialize the properties of a peripheral with a known location.

Reimplemented from PERIPHERALS::CPeripheralBus.

◆ OnInputDeviceAdded()

void CPeripheralBusAndroid::OnInputDeviceAdded ( int deviceId)
overridevirtual

Implements IInputDeviceCallbacks.

◆ OnInputDeviceChanged()

void CPeripheralBusAndroid::OnInputDeviceChanged ( int deviceId)
overridevirtual

Implements IInputDeviceCallbacks.

◆ OnInputDeviceEvent()

bool CPeripheralBusAndroid::OnInputDeviceEvent ( const AInputEvent * event)
overridevirtual

◆ OnInputDeviceRemoved()

void CPeripheralBusAndroid::OnInputDeviceRemoved ( int deviceId)
overridevirtual

Implements IInputDeviceCallbacks.

◆ PerformDeviceScan()

bool CPeripheralBusAndroid::PerformDeviceScan ( PeripheralScanResults & results)
overrideprotectedvirtual

Scan for devices on this bus and add them to the results list. This will have to be implemented for each bus.

Parameters
resultsThe result list.
Returns
True when the scan was successful, false otherwise.

Implements PERIPHERALS::CPeripheralBus.

◆ ProcessEvents()

void CPeripheralBusAndroid::ProcessEvents ( void )
overridevirtual

Poll for events.

Reimplemented from PERIPHERALS::CPeripheralBus.


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