libhomegear-base  0.7
Base library for Homegear and Homegear family modules.
BaseLib::Hgdc Class Reference

#include <Hgdc.h>

Inheritance diagram for BaseLib::Hgdc:
BaseLib::IQueue BaseLib::IQueueBase

Public Member Functions

 Hgdc (SharedObjects *bl, uint16_t port)
 
 ~Hgdc ()
 
void start ()
 
void stop ()
 
PVariable invoke (const std::string &methodName, const PArray &parameters, int32_t timeout=10000)
 
int32_t registerPacketReceivedEventHandler (int64_t familyId, std::function< void(int64_t, const std::string &, const std::vector< uint8_t > &)> value)
 
void unregisterPacketReceivedEventHandler (int32_t eventHandlerId)
 
int32_t registerModuleUpdateEventHandler (std::function< void(const BaseLib::PVariable &)> value)
 
void unregisterModuleUpdateEventHandler (int32_t eventHandlerId)
 
int32_t registerReconnectedEventHandler (std::function< void()> value)
 
void unregisterReconnectedEventHandler (int32_t eventHandlerId)
 
bool isMaster ()
 
PVariable getModules (int64_t familyId=-1)
 
bool sendPacket (const std::string &serialNumber, const std::vector< uint8_t > &packet)
 
bool sendPacket (const std::string &serialNumber, const std::vector< char > &packet)
 
bool moduleReset (const std::string &serialNumber)
 
bool setMode (const std::string &serialNumber, uint8_t mode)
 
- Public Member Functions inherited from BaseLib::IQueue
 IQueue (SharedObjects *baseLib, uint32_t queueCount, uint32_t bufferSize)
 Constructor. More...
 
virtual ~IQueue ()
 
void startQueue (int32_t index, bool waitWhenFull, uint32_t processingThreadCount, int32_t threadPriority=0, int32_t threadPolicy=SCHED_OTHER)
 Starts the threads of a queue. More...
 
void startQueue (int32_t index, bool waitWhenFull, uint32_t initialProcessingThreadCount, uint32_t maxProcessingThreadCount)
 Starts the threads of a queue using a thread count that can be increased later. More...
 
void stopQueue (int32_t index)
 Stops the threads of a queue previously started with startQueue(). More...
 
bool queueIsStarted (int32_t index)
 Checks if the specified queue has been started. More...
 
bool addThread (int32_t index)
 Start an additional thread. More...
 
bool enqueue (int32_t index, std::shared_ptr< IQueueEntry > &entry, bool waitWhenFull=false)
 Enqueues an item. More...
 
virtual void processQueueEntry (int32_t index, std::shared_ptr< IQueueEntry > &entry)=0
 This method is called by the processing threads for each item to process. More...
 
bool queueEmpty (int32_t index)
 Checks if a queue is empty. More...
 
uint32_t processingThreadCount (int32_t index)
 Returns the number of processing threads. More...
 
uint32_t maxProcessingThreadCount (int32_t index)
 Returns the maximum number of processing threads. More...
 
int32_t queueSize (int32_t index)
 Returns the number of items queued in a queue. More...
 
double threadLoad (int32_t index)
 
double maxThreadLoad (int32_t index)
 
double maxThreadLoad1m (int32_t index)
 
double maxThreadLoad10m (int32_t index)
 
double maxThreadLoad1h (int32_t index)
 
int64_t maxWait (int32_t index)
 
int64_t maxWait1m (int32_t index)
 
int64_t maxWait10m (int32_t index)
 
int64_t maxWait1h (int32_t index)
 
- Public Member Functions inherited from BaseLib::IQueueBase
 IQueueBase (SharedObjects *baseLib, uint32_t queueCount)
 
virtual ~IQueueBase ()
 
void printQueueFullError (BaseLib::Output &out, const std::string &message)
 Prints a rate limited (1 output per 10 seconds) error message and keeps count of error messages. More...
 

Additional Inherited Members

- Protected Attributes inherited from BaseLib::IQueueBase
SharedObjects_bl = nullptr
 
int32_t _queueCount = 2
 
std::unique_ptr< std::atomic_bool[]> _stopProcessingThread
 
std::atomic< uint32_t > _droppedEntries {0}
 
std::atomic< int64_t > _lastQueueFullError {0}
 

Constructor & Destructor Documentation

§ Hgdc()

BaseLib::Hgdc::Hgdc ( SharedObjects bl,
uint16_t  port 
)
explicit

§ ~Hgdc()

BaseLib::Hgdc::~Hgdc ( )

Member Function Documentation

§ getModules()

PVariable BaseLib::Hgdc::getModules ( int64_t  familyId = -1)

§ invoke()

PVariable BaseLib::Hgdc::invoke ( const std::string &  methodName,
const PArray parameters,
int32_t  timeout = 10000 
)

§ isMaster()

bool BaseLib::Hgdc::isMaster ( )

§ moduleReset()

bool BaseLib::Hgdc::moduleReset ( const std::string &  serialNumber)

§ registerModuleUpdateEventHandler()

int32_t BaseLib::Hgdc::registerModuleUpdateEventHandler ( std::function< void(const BaseLib::PVariable &)>  value)

§ registerPacketReceivedEventHandler()

int32_t BaseLib::Hgdc::registerPacketReceivedEventHandler ( int64_t  familyId,
std::function< void(int64_t, const std::string &, const std::vector< uint8_t > &)>  value 
)

§ registerReconnectedEventHandler()

int32_t BaseLib::Hgdc::registerReconnectedEventHandler ( std::function< void()>  value)

§ sendPacket() [1/2]

bool BaseLib::Hgdc::sendPacket ( const std::string &  serialNumber,
const std::vector< uint8_t > &  packet 
)

§ sendPacket() [2/2]

bool BaseLib::Hgdc::sendPacket ( const std::string &  serialNumber,
const std::vector< char > &  packet 
)

§ setMode()

bool BaseLib::Hgdc::setMode ( const std::string &  serialNumber,
uint8_t  mode 
)

§ start()

void BaseLib::Hgdc::start ( )

§ stop()

void BaseLib::Hgdc::stop ( )

§ unregisterModuleUpdateEventHandler()

void BaseLib::Hgdc::unregisterModuleUpdateEventHandler ( int32_t  eventHandlerId)

§ unregisterPacketReceivedEventHandler()

void BaseLib::Hgdc::unregisterPacketReceivedEventHandler ( int32_t  eventHandlerId)

§ unregisterReconnectedEventHandler()

void BaseLib::Hgdc::unregisterReconnectedEventHandler ( int32_t  eventHandlerId)

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