IRremoteESP8266
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
IRRhossAc Class Reference

Class for handling detailed Rhoss A/C messages. More...

#include <ir_Rhoss.h>

Collaboration diagram for IRRhossAc:
Collaboration graph
[legend]

Public Member Functions

 IRRhossAc (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
 Class constructor. More...
 
void stateReset ()
 Reset the internals of the object to a known good state. More...
 
void send (const uint16_t repeat=kRhossDefaultRepeat)
 Send the current internal state as an IR message. More...
 
int8_t calibrate (void)
 Run the calibration to calculate uSec timing offsets for this platform. More...
 
void begin ()
 Set up hardware to be able to send a message. More...
 
void setPower (const bool state)
 Set the internal state to have the desired power. More...
 
bool getPower (void) const
 Get the power setting from the internal state. More...
 
void on (void)
 Set the internal state to have the power on. More...
 
void off (void)
 Set the internal state to have the power off. More...
 
void setTemp (const uint8_t temp)
 Set the temperature. More...
 
uint8_t getTemp (void) const
 Get the current temperature setting. More...
 
void setFan (const uint8_t speed)
 Set the speed of the fan. More...
 
uint8_t getFan (void) const
 Get the current fan speed setting. More...
 
void setSwing (const bool state)
 Set the Vertical Swing mode of the A/C. More...
 
uint8_t getSwing (void) const
 Get the Vertical Swing speed of the A/C. More...
 
void setMode (const uint8_t mode)
 Set the desired operation mode. More...
 
uint8_t getMode (void) const
 Get the current operation mode setting. More...
 
uint8_t * getRaw (void)
 Get the raw state of the object, suitable to be sent with the appropriate IRsend object method. More...
 
void setRaw (const uint8_t state[])
 Set the raw state of the object. More...
 
stdAc::state_t toCommon (void) const
 Convert the current internal state into its stdAc::state_t equivalent. More...
 
String toString (void) const
 Convert the current internal state into a human readable string. More...
 

Static Public Member Functions

static uint8_t calcChecksum (const uint8_t state[], const uint16_t length=kRhossStateLength)
 Calculate the checksum for the supplied state. More...
 
static bool validChecksum (const uint8_t state[], const uint16_t length=kRhossStateLength)
 Verify the checksum is valid for a given state. More...
 
static uint8_t convertMode (const stdAc::opmode_t mode)
 Convert a stdAc::opmode_t enum into its native mode. More...
 
static uint8_t convertFan (const stdAc::fanspeed_t speed)
 Convert a stdAc::fanspeed_t enum into it's native speed. More...
 
static stdAc::opmode_t toCommonMode (const uint8_t mode)
 Convert a native mode into its stdAc equivalent. More...
 
static stdAc::fanspeed_t toCommonFanSpeed (const uint8_t speed)
 Convert a native fan speed into its stdAc equivalent. More...
 

Private Member Functions

void checksum (void)
 Update the checksum value for the internal state. More...
 

Private Attributes

IRsend _irsend
 
RhossProtocol _
 

Detailed Description

Class for handling detailed Rhoss A/C messages.

Constructor & Destructor Documentation

◆ IRRhossAc()

IRRhossAc::IRRhossAc ( const uint16_t  pin,
const bool  inverted = false,
const bool  use_modulation = true 
)
explicit

Class constructor.

Parameters
[in]pinGPIO to be used when sending.
[in]invertedIs the output signal to be inverted?
[in]use_modulationIs frequency modulation to be used?

Member Function Documentation

◆ begin()

void IRRhossAc::begin ( )

Set up hardware to be able to send a message.

◆ calcChecksum()

uint8_t IRRhossAc::calcChecksum ( const uint8_t  state[],
const uint16_t  length = kRhossStateLength 
)
static

Calculate the checksum for the supplied state.

Parameters
[in]stateThe source state to generate the checksum from.
[in]lengthLength of the supplied state to checksum.
Returns
The checksum value.

◆ calibrate()

int8_t IRRhossAc::calibrate ( void  )
inline

Run the calibration to calculate uSec timing offsets for this platform.

Returns
The uSec timing offset needed per modulation of the IR Led.
Note
This will produce a 65ms IR signal pulse at 38kHz. Only ever needs to be run once per object instantiation, if at all.

◆ checksum()

void IRRhossAc::checksum ( void  )
private

Update the checksum value for the internal state.

◆ convertFan()

uint8_t IRRhossAc::convertFan ( const stdAc::fanspeed_t  speed)
static

Convert a stdAc::fanspeed_t enum into it's native speed.

Parameters
[in]speedThe enum to be converted.
Returns
The native equivalent of the enum.

◆ convertMode()

uint8_t IRRhossAc::convertMode ( const stdAc::opmode_t  mode)
static

Convert a stdAc::opmode_t enum into its native mode.

Parameters
[in]modeThe enum to be converted.
Returns
The native equivalent of the enum.

◆ getFan()

uint8_t IRRhossAc::getFan ( void  ) const

Get the current fan speed setting.

Returns
The current fan speed.

◆ getMode()

uint8_t IRRhossAc::getMode ( void  ) const

Get the current operation mode setting.

Returns
The current operation mode.

◆ getPower()

bool IRRhossAc::getPower ( void  ) const

Get the power setting from the internal state.

Returns
A boolean indicating the power setting.

◆ getRaw()

uint8_t * IRRhossAc::getRaw ( void  )

Get the raw state of the object, suitable to be sent with the appropriate IRsend object method.

Returns
A PTR to the internal state.

◆ getSwing()

uint8_t IRRhossAc::getSwing ( void  ) const

Get the Vertical Swing speed of the A/C.

Returns
The native swing speed setting.

◆ getTemp()

uint8_t IRRhossAc::getTemp ( void  ) const

Get the current temperature setting.

Returns
Get current setting for temp. in degrees celsius.

◆ off()

void IRRhossAc::off ( void  )

Set the internal state to have the power off.

◆ on()

void IRRhossAc::on ( void  )

Set the internal state to have the power on.

◆ send()

void IRRhossAc::send ( const uint16_t  repeat = kRhossDefaultRepeat)

Send the current internal state as an IR message.

Parameters
[in]repeatNr. of times the message will be repeated.

◆ setFan()

void IRRhossAc::setFan ( const uint8_t  speed)

Set the speed of the fan.

Parameters
[in]speedThe desired setting.

◆ setMode()

void IRRhossAc::setMode ( const uint8_t  mode)

Set the desired operation mode.

Parameters
[in]modeThe desired operation mode.

◆ setPower()

void IRRhossAc::setPower ( const bool  on)

Set the internal state to have the desired power.

Parameters
[in]onThe desired power state.

◆ setRaw()

void IRRhossAc::setRaw ( const uint8_t  state[])

Set the raw state of the object.

Parameters
[state]state The raw state from the native IR message.

◆ setSwing()

void IRRhossAc::setSwing ( const bool  state)

Set the Vertical Swing mode of the A/C.

Parameters
[in]statetrue, the Swing is on. false, the Swing is off.

◆ setTemp()

void IRRhossAc::setTemp ( const uint8_t  degrees)

Set the temperature.

Parameters
[in]degreesThe temperature in degrees celsius.

◆ stateReset()

void IRRhossAc::stateReset ( )

Reset the internals of the object to a known good state.

◆ toCommon()

stdAc::state_t IRRhossAc::toCommon ( void  ) const

Convert the current internal state into its stdAc::state_t equivalent.

Returns
The stdAc equivalent of the native settings.

◆ toCommonFanSpeed()

stdAc::fanspeed_t IRRhossAc::toCommonFanSpeed ( const uint8_t  speed)
static

Convert a native fan speed into its stdAc equivalent.

Parameters
[in]speedThe native setting to be converted.
Returns
The stdAc equivalent of the native setting.

◆ toCommonMode()

stdAc::opmode_t IRRhossAc::toCommonMode ( const uint8_t  mode)
static

Convert a native mode into its stdAc equivalent.

Parameters
[in]modeThe native setting to be converted.
Returns
The stdAc equivalent of the native setting.

◆ toString()

String IRRhossAc::toString ( void  ) const

Convert the current internal state into a human readable string.

Returns
A human readable string.

◆ validChecksum()

bool IRRhossAc::validChecksum ( const uint8_t  state[],
const uint16_t  length = kRhossStateLength 
)
static

Verify the checksum is valid for a given state.

Parameters
[in]stateThe array to verify the checksum of.
[in]lengthThe size of the state.
Returns
A boolean indicating if it's checksum is valid.

Member Data Documentation

◆ _

RhossProtocol IRRhossAc::_
private

◆ _irsend

IRsend IRRhossAc::_irsend
private

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