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

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

#include <ir_Kelvinator.h>

Collaboration diagram for IRKelvinatorAC:
Collaboration graph
[legend]

Public Member Functions

 IRKelvinatorAC (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
 Class constructor. More...
 
void stateReset (void)
 Reset the internals of the object to a known good state. More...
 
void send (const uint16_t repeat=kKelvinatorDefaultRepeat)
 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 (void)
 Set up hardware to be able to send a message. 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 setPower (const bool on)
 Set the internal state to have the desired power. More...
 
bool getPower (void)
 Get the power setting from the internal state. More...
 
void setTemp (const uint8_t degrees)
 Set the temperature setting. More...
 
uint8_t getTemp (void)
 Get the current temperature setting. More...
 
void setFan (const uint8_t speed)
 Set the speed of the fan. More...
 
uint8_t getFan (void)
 Get the current fan speed setting. More...
 
void setMode (const uint8_t mode)
 Set the desired operation mode. More...
 
uint8_t getMode (void)
 Get the current operation mode setting. More...
 
void setSwingVertical (const bool on)
 Control the current vertical swing setting. More...
 
bool getSwingVertical (void)
 Is the vertical swing setting on? More...
 
void setSwingHorizontal (const bool on)
 Control the current horizontal swing setting. More...
 
bool getSwingHorizontal (void)
 Is the horizontal swing setting on? More...
 
void setQuiet (const bool on)
 Control the current Quiet setting. More...
 
bool getQuiet (void)
 Is the Quiet setting on? More...
 
void setIonFilter (const bool on)
 Control the current Ion Filter setting. More...
 
bool getIonFilter (void)
 Is the Ion Filter setting on? More...
 
void setLight (const bool on)
 Control the current Light setting. i.e. The LED display on the A/C unit that shows the basic settings. More...
 
bool getLight (void)
 Is the Light (Display) setting on? More...
 
void setXFan (const bool on)
 Control the current XFan setting. This setting will cause the unit blow air after power off to dry out the A/C device. More...
 
bool getXFan (void)
 Is the XFan setting on? More...
 
void setTurbo (const bool on)
 Control the current Turbo setting. More...
 
bool getTurbo (void)
 Is the Turbo setting on? 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 new_code[])
 Set the raw state of the object. More...
 
uint8_t convertMode (const stdAc::opmode_t mode)
 Convert a standard A/C mode (stdAc::opmode_t) into it a native mode. More...
 
stdAc::state_t toCommon (void)
 Convert the internal A/C object state to it's stdAc::state_t equivalent. More...
 
String toString (void)
 Convert the internal settings into a human readable string. More...
 

Static Public Member Functions

static uint8_t calcBlockChecksum (const uint8_t *block, const uint16_t length=kKelvinatorStateLength/2)
 Calculate the checksum for a given block of state. More...
 
static bool validChecksum (const uint8_t state[], const uint16_t length=kKelvinatorStateLength)
 Verify the checksum is valid for a given state. More...
 
static stdAc::opmode_t toCommonMode (const uint8_t mode)
 Convert a native mode to it's stdAc::opmode_t equivalent. More...
 
static stdAc::fanspeed_t toCommonFanSpeed (const uint8_t speed)
 Convert a native fan speed to it's stdAc::fanspeed_t equivalent. More...
 

Private Member Functions

void checksum (const uint16_t length=kKelvinatorStateLength)
 Calculate the checksum for the internal state. More...
 
void fixup (void)
 Fix up any odd conditions for the current state. More...
 

Private Attributes

IRsend _irsend
 Instance of the IR send class. More...
 
uint8_t remote_state [kKelvinatorStateLength]
 The state in IR code form. More...
 

Detailed Description

Class for handling detailed Kelvinator A/C messages.

Constructor & Destructor Documentation

◆ IRKelvinatorAC()

IRKelvinatorAC::IRKelvinatorAC ( 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 IRKelvinatorAC::begin ( void  )

Set up hardware to be able to send a message.

◆ calcBlockChecksum()

uint8_t IRKelvinatorAC::calcBlockChecksum ( const uint8_t *  block,
const uint16_t  length = kKelvinatorStateLength / 2 
)
static

Calculate the checksum for a given block of state.

Parameters
[in]blockA pointer to a block to calc the checksum of.
[in]lengthLength of the block array to checksum.
Returns
The calculated checksum value.
Note
Many Bothans died to bring us this information.

◆ calibrate()

int8_t IRKelvinatorAC::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 IRKelvinatorAC::checksum ( const uint16_t  length = kKelvinatorStateLength)
private

Calculate the checksum for the internal state.

Parameters
[in]lengthLength of the internal state to checksum.

◆ convertMode()

uint8_t IRKelvinatorAC::convertMode ( const stdAc::opmode_t  mode)

Convert a standard A/C mode (stdAc::opmode_t) into it a native mode.

Parameters
[in]modeA stdAc::opmode_t operation mode.
Returns
The native mode equivilant.

◆ fixup()

void IRKelvinatorAC::fixup ( void  )
private

Fix up any odd conditions for the current state.

◆ getFan()

uint8_t IRKelvinatorAC::getFan ( void  )

Get the current fan speed setting.

Returns
The current fan speed.

◆ getIonFilter()

bool IRKelvinatorAC::getIonFilter ( void  )

Is the Ion Filter setting on?

Returns
The current value.

◆ getLight()

bool IRKelvinatorAC::getLight ( void  )

Is the Light (Display) setting on?

Returns
The current value.

◆ getMode()

uint8_t IRKelvinatorAC::getMode ( void  )

Get the current operation mode setting.

Returns
The current operation mode.

◆ getPower()

bool IRKelvinatorAC::getPower ( void  )

Get the power setting from the internal state.

Returns
A boolean indicating if the power setting.

◆ getQuiet()

bool IRKelvinatorAC::getQuiet ( void  )

Is the Quiet setting on?

Returns
The current value.

◆ getRaw()

uint8_t * IRKelvinatorAC::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.

◆ getSwingHorizontal()

bool IRKelvinatorAC::getSwingHorizontal ( void  )

Is the horizontal swing setting on?

Returns
The current value.

◆ getSwingVertical()

bool IRKelvinatorAC::getSwingVertical ( void  )

Is the vertical swing setting on?

Returns
The current value.

◆ getTemp()

uint8_t IRKelvinatorAC::getTemp ( void  )

Get the current temperature setting.

Returns
Get current setting for temp. in degrees celsius.

◆ getTurbo()

bool IRKelvinatorAC::getTurbo ( void  )

Is the Turbo setting on?

Returns
The current value.

◆ getXFan()

bool IRKelvinatorAC::getXFan ( void  )

Is the XFan setting on?

Returns
The current value.

◆ off()

void IRKelvinatorAC::off ( void  )

Set the internal state to have the power off.

◆ on()

void IRKelvinatorAC::on ( void  )

Set the internal state to have the power on.

◆ send()

void IRKelvinatorAC::send ( const uint16_t  repeat = kKelvinatorDefaultRepeat)

Send the current internal state as an IR message.

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

◆ setFan()

void IRKelvinatorAC::setFan ( const uint8_t  speed)

Set the speed of the fan.

Parameters
[in]speed0 is auto, 1-5 is the speed

◆ setIonFilter()

void IRKelvinatorAC::setIonFilter ( const bool  on)

Control the current Ion Filter setting.

Parameters
[in]onThe desired setting.

◆ setLight()

void IRKelvinatorAC::setLight ( const bool  on)

Control the current Light setting. i.e. The LED display on the A/C unit that shows the basic settings.

Parameters
[in]onThe desired setting.

◆ setMode()

void IRKelvinatorAC::setMode ( const uint8_t  mode)

Set the desired operation mode.

Parameters
[in]modeThe desired operation mode.

◆ setPower()

void IRKelvinatorAC::setPower ( const bool  on)

Set the internal state to have the desired power.

Parameters
[in]onThe desired power state.

◆ setQuiet()

void IRKelvinatorAC::setQuiet ( const bool  on)

Control the current Quiet setting.

Parameters
[in]onThe desired setting.

◆ setRaw()

void IRKelvinatorAC::setRaw ( const uint8_t  new_code[])

Set the raw state of the object.

Parameters
[in]new_codeThe raw state from the native IR message.

◆ setSwingHorizontal()

void IRKelvinatorAC::setSwingHorizontal ( const bool  on)

Control the current horizontal swing setting.

Parameters
[in]onThe desired setting.

◆ setSwingVertical()

void IRKelvinatorAC::setSwingVertical ( const bool  on)

Control the current vertical swing setting.

Parameters
[in]onThe desired setting.

◆ setTemp()

void IRKelvinatorAC::setTemp ( const uint8_t  degrees)

Set the temperature setting.

Parameters
[in]degreesThe temperature in degrees celsius.

◆ setTurbo()

void IRKelvinatorAC::setTurbo ( const bool  on)

Control the current Turbo setting.

Note
Turbo mode is turned off if the fan speed is changed.
Parameters
[in]onThe desired setting.

◆ setXFan()

void IRKelvinatorAC::setXFan ( const bool  on)

Control the current XFan setting. This setting will cause the unit blow air after power off to dry out the A/C device.

Note
XFan mode is only valid in Cool or Dry mode.
Parameters
[in]onThe desired setting.

◆ stateReset()

void IRKelvinatorAC::stateReset ( void  )

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

◆ toCommon()

stdAc::state_t IRKelvinatorAC::toCommon ( void  )

Convert the internal A/C object state to it's stdAc::state_t equivalent.

Returns
A stdAc::state_t containing the current settings.

◆ toCommonFanSpeed()

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

Convert a native fan speed to it's stdAc::fanspeed_t equivalent.

Parameters
[in]speedA native fan speed value.
Returns
The stdAc::fanspeed_t equivilant.

◆ toCommonMode()

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

Convert a native mode to it's stdAc::opmode_t equivalent.

Parameters
[in]modeA native operating mode value.
Returns
The stdAc::opmode_t equivilant.

◆ toString()

String IRKelvinatorAC::toString ( void  )

Convert the internal settings into a human readable string.

Returns
A String.

◆ validChecksum()

bool IRKelvinatorAC::validChecksum ( const uint8_t  state[],
const uint16_t  length = kKelvinatorStateLength 
)
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 is valid.

Member Data Documentation

◆ _irsend

IRsend IRKelvinatorAC::_irsend
private

Instance of the IR send class.

◆ remote_state

uint8_t IRKelvinatorAC::remote_state[kKelvinatorStateLength]
private

The state in IR code form.


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