TwiceAsNice  2019-02-18
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Basda::WebSocketImpl Class Reference

#include <WebSocketImpl.h>

Inheritance diagram for Basda::WebSocketImpl:
Inheritance graph
Collaboration diagram for Basda::WebSocketImpl:
Collaboration graph

Public Member Functions

 WebSocketImpl (const std::string &host, const uint16_t port, const std::string &pwd, WutSocketPtr socket, const unsigned timeoutInMicroSeconds)
 constructor More...
 
virtual ~WebSocketImpl ()
 destructor More...
 
const WebSocketImploperator<< (const std::string &) const
 operator to send a string More...
 
const WebSocketImploperator>> (std::string &) const
 operator to receive a string More...
 
virtual std::string getInputStatus (void)
 function to get the input status of all inputs More...
 
virtual std::string getInputStatus (const int inputPortIndex)
 function to get the input status for a specific input More...
 
virtual std::string getCounterReading (void)
 function to get the counter reading of all input More...
 
virtual std::string getCounterReading (const int inputPortIndex)
 function to get the counter reading of a specific input More...
 
virtual void setCounterValue (const int _input, const long int _value)
 function to set the counter of an input More...
 
virtual void setCounterValue (const long int _value)
 function to set the counter for all inputs More...
 
virtual std::string getOutputStatus (void)
 function to get the output status of all outputs More...
 
virtual std::string getOutputStatus (const int outputPortIndex)
 function to get the output status for a specific output More...
 
virtual void setOutputBits (const std::string _mask, const std::string _state)
 function to disable outputs with mask More...
 
virtual void setOutputBits (const int _output, const std::string _state)
 function to enable/disable one output More...
 
virtual void setOutputBits (const std::string _state)
 function to enable multiple outputs More...
 
virtual std::string getTime (void)
 function to get the time More...
 
virtual void setTime (const std::string _time)
 function to det the system time More...
 
virtual std::string getDiagnosticMemory (void)
 function to get the status of the diagnostic memory More...
 
virtual std::string getDiagnosticReport (const int _index)
 function to et a specific diagnostic report More...
 
virtual std::string getMessageText (const int _number)
 function to get the messages of the message bits More...
 
virtual void clearMessageMemory (void)
 function to clear the message memory More...
 
virtual void clearLoadErrors (void)
 function to clear load errors and to re-enable affected outputs More...
 
 WebSocketImpl (const std::string &host, const uint16_t port, const std::string &pwd, WutSocketPtr socket, const unsigned timeoutInMicroSeconds)
 constructor More...
 
virtual ~WebSocketImpl ()
 destructor More...
 
const WebSocketImploperator<< (const std::string &) const
 operator to send a string More...
 
const WebSocketImploperator>> (std::string &) const
 operator to receive a string More...
 
virtual std::string getInputStatus (void)
 function to get the input status of all inputs More...
 
virtual std::string getInputStatus (const int inputPortIndex)
 function to get the input status for a specific input More...
 
virtual std::string getCounterReading (void)
 function to get the counter reading of all input More...
 
virtual std::string getCounterReading (const int inputPortIndex)
 function to get the counter reading of a specific input More...
 
virtual void setCounterValue (const int _input, const long int _value)
 function to set the counter of an input More...
 
virtual void setCounterValue (const long int _value)
 function to set the counter for all inputs More...
 
virtual std::string getOutputStatus (void)
 function to get the output status of all outputs More...
 
virtual std::string getOutputStatus (const int outputPortIndex)
 function to get the output status for a specific output More...
 
virtual void setOutputBits (const std::string _mask, const std::string _state)
 function to disable outputs with mask More...
 
virtual void setOutputBits (const int _output, const std::string _state)
 function to enable/disable one output More...
 
virtual void setOutputBits (const std::string _state)
 function to enable multiple outputs More...
 
virtual std::string getTime (void)
 function to get the time More...
 
virtual void setTime (const std::string _time)
 function to det the system time More...
 
virtual std::string getDiagnosticMemory (void)
 function to get the status of the diagnostic memory More...
 
virtual std::string getDiagnosticReport (const int _index)
 function to et a specific diagnostic report More...
 
virtual std::string getMessageText (const int _number)
 function to get the messages of the message bits More...
 
virtual void clearMessageMemory (void)
 function to clear the message memory More...
 
virtual void clearLoadErrors (void)
 function to clear load errors and to re-enable affected outputs More...
 
 WebSocketImpl (const std::string &host, const uint16_t port, const std::string &pwd, WutSocketPtr socket, const unsigned timeoutInMicroSeconds)
 constructor More...
 
virtual ~WebSocketImpl ()
 destructor More...
 
const WebSocketImploperator<< (const std::string &) const
 operator to send a string More...
 
const WebSocketImploperator>> (std::string &) const
 operator to receive a string More...
 
virtual std::string getInputStatus (void)
 function to get the input status of all inputs More...
 
virtual std::string getInputStatus (const int inputPortIndex)
 function to get the input status for a specific input More...
 
virtual std::string getCounterReading (void)
 function to get the counter reading of all input More...
 
virtual std::string getCounterReading (const int inputPortIndex)
 function to get the counter reading of a specific input More...
 
virtual void setCounterValue (const int _input, const long int _value)
 function to set the counter of an input More...
 
virtual void setCounterValue (const long int _value)
 function to set the counter for all inputs More...
 
virtual std::string getOutputStatus (void)
 function to get the output status of all outputs More...
 
virtual std::string getOutputStatus (const int outputPortIndex)
 function to get the output status for a specific output More...
 
virtual void setOutputBits (const std::string _mask, const std::string _state)
 function to disable outputs with mask More...
 
virtual void setOutputBits (const int _output, const std::string _state)
 function to enable/disable one output More...
 
virtual void setOutputBits (const std::string _state)
 function to enable multiple outputs More...
 
virtual std::string getTime (void)
 function to get the time More...
 
virtual void setTime (const std::string _time)
 function to det the system time More...
 
virtual std::string getDiagnosticMemory (void)
 function to get the status of the diagnostic memory More...
 
virtual std::string getDiagnosticReport (const int _index)
 function to et a specific diagnostic report More...
 
virtual std::string getMessageText (const int _number)
 function to get the messages of the message bits More...
 
virtual void clearMessageMemory (void)
 function to clear the message memory More...
 
virtual void clearLoadErrors (void)
 function to clear load errors and to re-enable affected outputs More...
 
- Public Member Functions inherited from Basda::WebSocket
virtual ~WebSocket ()=0
 
virtual ~WebSocket ()=0
 
virtual ~WebSocket ()=0
 

Private Member Functions

std::string getOutputStatusFromResponseString (const std::string &response)
 
std::string getOutputStatusFromResponseString (const std::string &response)
 
std::string getOutputStatusFromResponseString (const std::string &response)
 

Private Attributes

std::string m_pwd
 administrator password More...
 
WutSocketPtr socket_
 

Additional Inherited Members

- Static Public Member Functions inherited from Basda::WebSocket
static WebSocketPtr null ()
 
static WebSocketPtr null ()
 
static WebSocketPtr null ()
 

Constructor & Destructor Documentation

◆ WebSocketImpl() [1/3]

Basda::WebSocketImpl::WebSocketImpl ( const std::string &  host,
const uint16_t  port,
const std::string &  pwd,
WutSocketPtr  socket,
const unsigned  timeoutInMicroSeconds 
)

constructor

Parameters
hostName or IP address of the host
portport of the host (default 80)
pwdadministrator password
timeoutInMicroSecondstimeout for connecting, sending and receiving

◆ ~WebSocketImpl() [1/3]

virtual Basda::WebSocketImpl::~WebSocketImpl ( )
inlinevirtual

destructor

◆ WebSocketImpl() [2/3]

Basda::WebSocketImpl::WebSocketImpl ( const std::string &  host,
const uint16_t  port,
const std::string &  pwd,
WutSocketPtr  socket,
const unsigned  timeoutInMicroSeconds 
)

constructor

Parameters
hostName or IP address of the host
portport of the host (default 80)
pwdadministrator password
timeoutInMicroSecondstimeout for connecting, sending and receiving

◆ ~WebSocketImpl() [2/3]

virtual Basda::WebSocketImpl::~WebSocketImpl ( )
inlinevirtual

destructor

◆ WebSocketImpl() [3/3]

Basda::WebSocketImpl::WebSocketImpl ( const std::string &  host,
const uint16_t  port,
const std::string &  pwd,
WutSocketPtr  socket,
const unsigned  timeoutInMicroSeconds 
)

constructor

Parameters
hostName or IP address of the host
portport of the host (default 80)
pwdadministrator password
timeoutInMicroSecondstimeout for connecting, sending and receiving

◆ ~WebSocketImpl() [3/3]

virtual Basda::WebSocketImpl::~WebSocketImpl ( )
inlinevirtual

destructor

Member Function Documentation

◆ clearLoadErrors() [1/3]

void Basda::WebSocketImpl::clearLoadErrors ( void  )
virtual

function to clear load errors and to re-enable affected outputs

Implements Basda::WebSocket.

◆ clearLoadErrors() [2/3]

virtual void Basda::WebSocketImpl::clearLoadErrors ( void  )
virtual

function to clear load errors and to re-enable affected outputs

Implements Basda::WebSocket.

◆ clearLoadErrors() [3/3]

virtual void Basda::WebSocketImpl::clearLoadErrors ( void  )
virtual

function to clear load errors and to re-enable affected outputs

Implements Basda::WebSocket.

◆ clearMessageMemory() [1/3]

void Basda::WebSocketImpl::clearMessageMemory ( void  )
virtual

function to clear the message memory

Implements Basda::WebSocket.

◆ clearMessageMemory() [2/3]

virtual void Basda::WebSocketImpl::clearMessageMemory ( void  )
virtual

function to clear the message memory

Implements Basda::WebSocket.

◆ clearMessageMemory() [3/3]

virtual void Basda::WebSocketImpl::clearMessageMemory ( void  )
virtual

function to clear the message memory

Implements Basda::WebSocket.

◆ getCounterReading() [1/6]

std::string Basda::WebSocketImpl::getCounterReading ( void  )
virtual

function to get the counter reading of all input

Returns
counters of the inputs devided by ';'

Implements Basda::WebSocket.

◆ getCounterReading() [2/6]

virtual std::string Basda::WebSocketImpl::getCounterReading ( void  )
virtual

function to get the counter reading of all input

Returns
counters of the inputs devided by ';'

Implements Basda::WebSocket.

◆ getCounterReading() [3/6]

virtual std::string Basda::WebSocketImpl::getCounterReading ( void  )
virtual

function to get the counter reading of all input

Returns
counters of the inputs devided by ';'

Implements Basda::WebSocket.

◆ getCounterReading() [4/6]

std::string Basda::WebSocketImpl::getCounterReading ( const int  inputPortIndex)
virtual

function to get the counter reading of a specific input

Parameters
_inputspecifies the input (0-11)
Returns
counter reading of that input

Implements Basda::WebSocket.

◆ getCounterReading() [5/6]

virtual std::string Basda::WebSocketImpl::getCounterReading ( const int  inputPortIndex)
virtual

function to get the counter reading of a specific input

Parameters
_inputspecifies the input (0-11)
Returns
counter reading of that input

Implements Basda::WebSocket.

◆ getCounterReading() [6/6]

virtual std::string Basda::WebSocketImpl::getCounterReading ( const int  inputPortIndex)
virtual

function to get the counter reading of a specific input

Parameters
_inputspecifies the input (0-11)
Returns
counter reading of that input

Implements Basda::WebSocket.

◆ getDiagnosticMemory() [1/3]

std::string Basda::WebSocketImpl::getDiagnosticMemory ( void  )
virtual

function to get the status of the diagnostic memory

Returns
status of the diagnostic memory

Implements Basda::WebSocket.

◆ getDiagnosticMemory() [2/3]

virtual std::string Basda::WebSocketImpl::getDiagnosticMemory ( void  )
virtual

function to get the status of the diagnostic memory

Returns
status of the diagnostic memory

Implements Basda::WebSocket.

◆ getDiagnosticMemory() [3/3]

virtual std::string Basda::WebSocketImpl::getDiagnosticMemory ( void  )
virtual

function to get the status of the diagnostic memory

Returns
status of the diagnostic memory

Implements Basda::WebSocket.

◆ getDiagnosticReport() [1/3]

std::string Basda::WebSocketImpl::getDiagnosticReport ( const int  _index)
virtual

function to et a specific diagnostic report

Parameters
_indexindex of the diagnostic report
Returns
diagnostic message

Implements Basda::WebSocket.

◆ getDiagnosticReport() [2/3]

virtual std::string Basda::WebSocketImpl::getDiagnosticReport ( const int  _index)
virtual

function to et a specific diagnostic report

Parameters
_indexindex of the diagnostic report
Returns
diagnostic message

Implements Basda::WebSocket.

◆ getDiagnosticReport() [3/3]

virtual std::string Basda::WebSocketImpl::getDiagnosticReport ( const int  _index)
virtual

function to et a specific diagnostic report

Parameters
_indexindex of the diagnostic report
Returns
diagnostic message

Implements Basda::WebSocket.

◆ getInputStatus() [1/6]

std::string Basda::WebSocketImpl::getInputStatus ( void  )
virtual

function to get the input status of all inputs

Returns
Mask for the activatet inputs (in hexadecimal form)

Implements Basda::WebSocket.

◆ getInputStatus() [2/6]

virtual std::string Basda::WebSocketImpl::getInputStatus ( void  )
virtual

function to get the input status of all inputs

Returns
Mask for the activatet inputs (in hexadecimal form)

Implements Basda::WebSocket.

◆ getInputStatus() [3/6]

virtual std::string Basda::WebSocketImpl::getInputStatus ( void  )
virtual

function to get the input status of all inputs

Returns
Mask for the activatet inputs (in hexadecimal form)

Implements Basda::WebSocket.

◆ getInputStatus() [4/6]

std::string Basda::WebSocketImpl::getInputStatus ( const int  inputPortIndex)
virtual

function to get the input status for a specific input

Parameters
_inputspecifies the input number (0-11)
Returns
status of the input (ON or OFF)

Implements Basda::WebSocket.

◆ getInputStatus() [5/6]

virtual std::string Basda::WebSocketImpl::getInputStatus ( const int  inputPortIndex)
virtual

function to get the input status for a specific input

Parameters
_inputspecifies the input number (0-11)
Returns
status of the input (ON or OFF)

Implements Basda::WebSocket.

◆ getInputStatus() [6/6]

virtual std::string Basda::WebSocketImpl::getInputStatus ( const int  inputPortIndex)
virtual

function to get the input status for a specific input

Parameters
_inputspecifies the input number (0-11)
Returns
status of the input (ON or OFF)

Implements Basda::WebSocket.

◆ getMessageText() [1/3]

std::string Basda::WebSocketImpl::getMessageText ( const int  _number)
virtual

function to get the messages of the message bits

Parameters
_numberspecifies the message bit (max 64)
Returns
message

Implements Basda::WebSocket.

◆ getMessageText() [2/3]

virtual std::string Basda::WebSocketImpl::getMessageText ( const int  _number)
virtual

function to get the messages of the message bits

Parameters
_numberspecifies the message bit (max 64)
Returns
message

Implements Basda::WebSocket.

◆ getMessageText() [3/3]

virtual std::string Basda::WebSocketImpl::getMessageText ( const int  _number)
virtual

function to get the messages of the message bits

Parameters
_numberspecifies the message bit (max 64)
Returns
message

Implements Basda::WebSocket.

◆ getOutputStatus() [1/6]

std::string Basda::WebSocketImpl::getOutputStatus ( void  )
virtual

function to get the output status of all outputs

Returns
Mask for the activatet outputs (in hexadecimal form)

Implements Basda::WebSocket.

◆ getOutputStatus() [2/6]

virtual std::string Basda::WebSocketImpl::getOutputStatus ( void  )
virtual

function to get the output status of all outputs

Returns
Mask for the activatet outputs (in hexadecimal form)

Implements Basda::WebSocket.

◆ getOutputStatus() [3/6]

virtual std::string Basda::WebSocketImpl::getOutputStatus ( void  )
virtual

function to get the output status of all outputs

Returns
Mask for the activatet outputs (in hexadecimal form)

Implements Basda::WebSocket.

◆ getOutputStatus() [4/6]

virtual std::string Basda::WebSocketImpl::getOutputStatus ( const int  outputPortIndex)
virtual

function to get the output status for a specific output

Parameters
_outputspecifies the output number (0-11)
Returns
status of the output (ON or OFF)

Implements Basda::WebSocket.

◆ getOutputStatus() [5/6]

std::string Basda::WebSocketImpl::getOutputStatus ( const int  outputPortIndex)
virtual

function to get the output status for a specific output

Parameters
_outputspecifies the output number (0-11)
Returns
status of the output (ON or OFF)

Implements Basda::WebSocket.

◆ getOutputStatus() [6/6]

virtual std::string Basda::WebSocketImpl::getOutputStatus ( const int  outputPortIndex)
virtual

function to get the output status for a specific output

Parameters
_outputspecifies the output number (0-11)
Returns
status of the output (ON or OFF)

Implements Basda::WebSocket.

◆ getOutputStatusFromResponseString() [1/3]

std::string Basda::WebSocketImpl::getOutputStatusFromResponseString ( const std::string &  response)
private

◆ getOutputStatusFromResponseString() [2/3]

std::string Basda::WebSocketImpl::getOutputStatusFromResponseString ( const std::string &  response)
private

◆ getOutputStatusFromResponseString() [3/3]

string Basda::WebSocketImpl::getOutputStatusFromResponseString ( const std::string &  response)
private

◆ getTime() [1/3]

virtual std::string Basda::WebSocketImpl::getTime ( void  )
virtual

function to get the time

Returns
system time

Implements Basda::WebSocket.

◆ getTime() [2/3]

virtual std::string Basda::WebSocketImpl::getTime ( void  )
virtual

function to get the time

Returns
system time

Implements Basda::WebSocket.

◆ getTime() [3/3]

std::string Basda::WebSocketImpl::getTime ( void  )
virtual

function to get the time

Returns
system time

Implements Basda::WebSocket.

◆ operator<<() [1/3]

const WebSocketImpl & Basda::WebSocketImpl::operator<< ( const std::string &  s) const

operator to send a string

◆ operator<<() [2/3]

const WebSocketImpl& Basda::WebSocketImpl::operator<< ( const std::string &  ) const

operator to send a string

◆ operator<<() [3/3]

const WebSocketImpl& Basda::WebSocketImpl::operator<< ( const std::string &  ) const

operator to send a string

◆ operator>>() [1/3]

const WebSocketImpl & Basda::WebSocketImpl::operator>> ( std::string &  s) const

operator to receive a string

◆ operator>>() [2/3]

const WebSocketImpl& Basda::WebSocketImpl::operator>> ( std::string &  ) const

operator to receive a string

◆ operator>>() [3/3]

const WebSocketImpl& Basda::WebSocketImpl::operator>> ( std::string &  ) const

operator to receive a string

◆ setCounterValue() [1/6]

virtual void Basda::WebSocketImpl::setCounterValue ( const int  _input,
const long int  _value 
)
virtual

function to set the counter of an input

Parameters
_inputspecifies the input (0-11)
_valuespecifies the counter value (0-2Mrd)

Implements Basda::WebSocket.

◆ setCounterValue() [2/6]

void Basda::WebSocketImpl::setCounterValue ( const int  _input,
const long int  _value 
)
virtual

function to set the counter of an input

Parameters
_inputspecifies the input (0-11)
_valuespecifies the counter value (0-2Mrd)

Implements Basda::WebSocket.

◆ setCounterValue() [3/6]

virtual void Basda::WebSocketImpl::setCounterValue ( const int  _input,
const long int  _value 
)
virtual

function to set the counter of an input

Parameters
_inputspecifies the input (0-11)
_valuespecifies the counter value (0-2Mrd)

Implements Basda::WebSocket.

◆ setCounterValue() [4/6]

void Basda::WebSocketImpl::setCounterValue ( const long int  _value)
virtual

function to set the counter for all inputs

Parameters
_valuespecifies the counter value (0-2Mrd)

Implements Basda::WebSocket.

◆ setCounterValue() [5/6]

virtual void Basda::WebSocketImpl::setCounterValue ( const long int  _value)
virtual

function to set the counter for all inputs

Parameters
_valuespecifies the counter value (0-2Mrd)

Implements Basda::WebSocket.

◆ setCounterValue() [6/6]

virtual void Basda::WebSocketImpl::setCounterValue ( const long int  _value)
virtual

function to set the counter for all inputs

Parameters
_valuespecifies the counter value (0-2Mrd)

Implements Basda::WebSocket.

◆ setOutputBits() [1/9]

void Basda::WebSocketImpl::setOutputBits ( const std::string  _mask,
const std::string  _state 
)
virtual

function to disable outputs with mask

Parameters
_maskspecifies the outputs activated (in hex form)
_stateOFF

Implements Basda::WebSocket.

◆ setOutputBits() [2/9]

virtual void Basda::WebSocketImpl::setOutputBits ( const std::string  _mask,
const std::string  _state 
)
virtual

function to disable outputs with mask

Parameters
_maskspecifies the outputs activated (in hex form)
_stateOFF

Implements Basda::WebSocket.

◆ setOutputBits() [3/9]

virtual void Basda::WebSocketImpl::setOutputBits ( const std::string  _mask,
const std::string  _state 
)
virtual

function to disable outputs with mask

Parameters
_maskspecifies the outputs activated (in hex form)
_stateOFF

Implements Basda::WebSocket.

◆ setOutputBits() [4/9]

virtual void Basda::WebSocketImpl::setOutputBits ( const int  _output,
const std::string  _state 
)
virtual

function to enable/disable one output

Parameters
_outputspecifies the output (0-11)
_stateON or OFF

Implements Basda::WebSocket.

◆ setOutputBits() [5/9]

void Basda::WebSocketImpl::setOutputBits ( const int  _output,
const std::string  _state 
)
virtual

function to enable/disable one output

Parameters
_outputspecifies the output (0-11)
_stateON or OFF

Implements Basda::WebSocket.

◆ setOutputBits() [6/9]

virtual void Basda::WebSocketImpl::setOutputBits ( const int  _output,
const std::string  _state 
)
virtual

function to enable/disable one output

Parameters
_outputspecifies the output (0-11)
_stateON or OFF

Implements Basda::WebSocket.

◆ setOutputBits() [7/9]

virtual void Basda::WebSocketImpl::setOutputBits ( const std::string  _state)
virtual

function to enable multiple outputs

Parameters
_statehex form of outputs to be enabled

Implements Basda::WebSocket.

◆ setOutputBits() [8/9]

virtual void Basda::WebSocketImpl::setOutputBits ( const std::string  _state)
virtual

function to enable multiple outputs

Parameters
_statehex form of outputs to be enabled

Implements Basda::WebSocket.

◆ setOutputBits() [9/9]

void Basda::WebSocketImpl::setOutputBits ( const std::string  _state)
virtual

function to enable multiple outputs

Parameters
_statehex form of outputs to be enabled

Implements Basda::WebSocket.

◆ setTime() [1/3]

void Basda::WebSocketImpl::setTime ( const std::string  _time)
virtual

function to det the system time

Parameters
_timethe time to be set

Implements Basda::WebSocket.

◆ setTime() [2/3]

virtual void Basda::WebSocketImpl::setTime ( const std::string  _time)
virtual

function to det the system time

Parameters
_timethe time to be set

Implements Basda::WebSocket.

◆ setTime() [3/3]

virtual void Basda::WebSocketImpl::setTime ( const std::string  _time)
virtual

function to det the system time

Parameters
_timethe time to be set

Implements Basda::WebSocket.

Member Data Documentation

◆ m_pwd

std::string Basda::WebSocketImpl::m_pwd
private

administrator password

◆ socket_

WutSocketPtr Basda::WebSocketImpl::socket_
private

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