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

#include <EventClient.h>

Public Member Functions

 CEventClient ()
 
 CEventClient (SOCKETS::CAddress &addr)
 
void Initialize ()
 
const std::string & Name () const
 
void RefreshSettings ()
 
SOCKETS::CAddressAddress ()
 
virtual ~CEventClient ()
 
bool AddPacket (std::unique_ptr< EVENTPACKET::CEventPacket > packet)
 
bool Alive () const
 
bool ProcessQueue ()
 
void ProcessEvents ()
 
bool GetNextAction (CEventAction &action)
 
void FreePacketQueues ()
 
unsigned int GetButtonCode (std::string &strMapName, bool &isAxis, float &amount, bool &isJoystick)
 
bool GetMousePos (float &x, float &y)
 

Protected Member Functions

bool ProcessPacket (EVENTPACKET::CEventPacket *packet)
 
virtual bool OnPacketHELO (EVENTPACKET::CEventPacket *packet)
 
virtual bool OnPacketBYE (EVENTPACKET::CEventPacket *packet)
 
virtual bool OnPacketBUTTON (EVENTPACKET::CEventPacket *packet)
 
virtual bool OnPacketMOUSE (EVENTPACKET::CEventPacket *packet)
 
virtual bool OnPacketNOTIFICATION (EVENTPACKET::CEventPacket *packet)
 
virtual bool OnPacketLOG (EVENTPACKET::CEventPacket *packet)
 
virtual bool OnPacketACTION (EVENTPACKET::CEventPacket *packet)
 
bool CheckButtonRepeat (std::chrono::time_point< std::chrono::steady_clock > &next)
 
bool Greeted ()
 
void ResetTimeout ()
 
bool ParseString (unsigned char *&payload, int &psize, std::string &parsedVal)
 
bool ParseByte (unsigned char *&payload, int &psize, unsigned char &parsedVal)
 
bool ParseUInt32 (unsigned char *&payload, int &psize, unsigned int &parsedVal)
 
bool ParseUInt16 (unsigned char *&payload, int &psize, unsigned short &parsedVal)
 

Protected Attributes

std::string m_deviceName
 
int m_iCurrentSeqLen
 
time_t m_lastPing
 
time_t m_lastSeq
 
int m_iRemotePort
 
bool m_bGreeted
 
std::chrono::milliseconds m_iRepeatDelay
 
std::chrono::milliseconds m_iRepeatSpeed
 
unsigned int m_iMouseX
 
unsigned int m_iMouseY
 
bool m_bMouseMoved
 
bool m_bSequenceError
 
SOCKETS::CAddress m_remoteAddr
 
EVENTPACKET::LogoType m_eLogoType
 
CCriticalSection m_critSection
 
std::map< unsigned int, std::unique_ptr< EVENTPACKET::CEventPacket > > m_seqPackets
 
std::queue< std::unique_ptr< EVENTPACKET::CEventPacket > > m_readyPackets
 
std::list< CEventButtonStatem_buttonQueue
 
std::queue< CEventActionm_actionQueue
 
CEventButtonState m_currentButton
 

Constructor & Destructor Documentation

◆ CEventClient() [1/2]

EVENTCLIENT::CEventClient::CEventClient ( )
inline

◆ CEventClient() [2/2]

EVENTCLIENT::CEventClient::CEventClient ( SOCKETS::CAddress & addr)
inlineexplicit

◆ ~CEventClient()

virtual EVENTCLIENT::CEventClient::~CEventClient ( )
inlinevirtual

Member Function Documentation

◆ AddPacket()

bool CEventClient::AddPacket ( std::unique_ptr< EVENTPACKET::CEventPacket > packet)
Todo
limit payload size

◆ Address()

SOCKETS::CAddress & EVENTCLIENT::CEventClient::Address ( )
inline

◆ Alive()

bool CEventClient::Alive ( ) const

◆ CheckButtonRepeat()

bool CEventClient::CheckButtonRepeat ( std::chrono::time_point< std::chrono::steady_clock > & next)
protected

◆ FreePacketQueues()

void CEventClient::FreePacketQueues ( )

◆ GetButtonCode()

unsigned int CEventClient::GetButtonCode ( std::string & strMapName,
bool & isAxis,
float & amount,
bool & isJoystick )

◆ GetMousePos()

bool CEventClient::GetMousePos ( float & x,
float & y )

◆ GetNextAction()

bool CEventClient::GetNextAction ( CEventAction & action)

◆ Greeted()

bool EVENTCLIENT::CEventClient::Greeted ( )
inlineprotected

◆ Initialize()

void EVENTCLIENT::CEventClient::Initialize ( )
inline

◆ Name()

const std::string & EVENTCLIENT::CEventClient::Name ( ) const
inline

◆ OnPacketACTION()

bool CEventClient::OnPacketACTION ( EVENTPACKET::CEventPacket * packet)
protectedvirtual

◆ OnPacketBUTTON()

bool CEventClient::OnPacketBUTTON ( EVENTPACKET::CEventPacket * packet)
protectedvirtual

◆ OnPacketBYE()

bool CEventClient::OnPacketBYE ( EVENTPACKET::CEventPacket * packet)
protectedvirtual

◆ OnPacketHELO()

bool CEventClient::OnPacketHELO ( EVENTPACKET::CEventPacket * packet)
protectedvirtual
Todo
check it last HELO packet was received less than 5 minutes back if so, do not show notification of connection.

◆ OnPacketLOG()

bool CEventClient::OnPacketLOG ( EVENTPACKET::CEventPacket * packet)
protectedvirtual

◆ OnPacketMOUSE()

bool CEventClient::OnPacketMOUSE ( EVENTPACKET::CEventPacket * packet)
protectedvirtual

◆ OnPacketNOTIFICATION()

bool CEventClient::OnPacketNOTIFICATION ( EVENTPACKET::CEventPacket * packet)
protectedvirtual

◆ ParseByte()

bool CEventClient::ParseByte ( unsigned char *& payload,
int & psize,
unsigned char & parsedVal )
protected

◆ ParseString()

bool CEventClient::ParseString ( unsigned char *& payload,
int & psize,
std::string & parsedVal )
protected

◆ ParseUInt16()

bool CEventClient::ParseUInt16 ( unsigned char *& payload,
int & psize,
unsigned short & parsedVal )
protected

◆ ParseUInt32()

bool CEventClient::ParseUInt32 ( unsigned char *& payload,
int & psize,
unsigned int & parsedVal )
protected

◆ ProcessEvents()

void CEventClient::ProcessEvents ( )

◆ ProcessPacket()

bool CEventClient::ProcessPacket ( EVENTPACKET::CEventPacket * packet)
protected

◆ ProcessQueue()

bool EVENTCLIENT::CEventClient::ProcessQueue ( )

◆ RefreshSettings()

void EVENTCLIENT::CEventClient::RefreshSettings ( )
inline

◆ ResetTimeout()

void EVENTCLIENT::CEventClient::ResetTimeout ( )
inlineprotected

Member Data Documentation

◆ m_actionQueue

std::queue<CEventAction> EVENTCLIENT::CEventClient::m_actionQueue
protected

◆ m_bGreeted

bool EVENTCLIENT::CEventClient::m_bGreeted
protected

◆ m_bMouseMoved

bool EVENTCLIENT::CEventClient::m_bMouseMoved
protected

◆ m_bSequenceError

bool EVENTCLIENT::CEventClient::m_bSequenceError
protected

◆ m_buttonQueue

std::list<CEventButtonState> EVENTCLIENT::CEventClient::m_buttonQueue
protected

◆ m_critSection

CCriticalSection EVENTCLIENT::CEventClient::m_critSection
protected

◆ m_currentButton

CEventButtonState EVENTCLIENT::CEventClient::m_currentButton
protected

◆ m_deviceName

std::string EVENTCLIENT::CEventClient::m_deviceName
protected

◆ m_eLogoType

EVENTPACKET::LogoType EVENTCLIENT::CEventClient::m_eLogoType
protected

◆ m_iCurrentSeqLen

int EVENTCLIENT::CEventClient::m_iCurrentSeqLen
protected

◆ m_iMouseX

unsigned int EVENTCLIENT::CEventClient::m_iMouseX
protected

◆ m_iMouseY

unsigned int EVENTCLIENT::CEventClient::m_iMouseY
protected

◆ m_iRemotePort

int EVENTCLIENT::CEventClient::m_iRemotePort
protected

◆ m_iRepeatDelay

std::chrono::milliseconds EVENTCLIENT::CEventClient::m_iRepeatDelay
protected

◆ m_iRepeatSpeed

std::chrono::milliseconds EVENTCLIENT::CEventClient::m_iRepeatSpeed
protected

◆ m_lastPing

time_t EVENTCLIENT::CEventClient::m_lastPing
protected

◆ m_lastSeq

time_t EVENTCLIENT::CEventClient::m_lastSeq
protected

◆ m_readyPackets

std::queue<std::unique_ptr<EVENTPACKET::CEventPacket> > EVENTCLIENT::CEventClient::m_readyPackets
protected

◆ m_remoteAddr

SOCKETS::CAddress EVENTCLIENT::CEventClient::m_remoteAddr
protected

◆ m_seqPackets

std::map<unsigned int, std::unique_ptr<EVENTPACKET::CEventPacket> > EVENTCLIENT::CEventClient::m_seqPackets
protected

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