IRremoteESP8266

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

Class for handling detailed Airton 56-bit A/C messages. More...

`#include <ir_Airton.h>`

Collaboration diagram for IRAirtonAc:
[legend]

## Public Member Functions
| IRAirtonAc (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=kAirtonDefaultRepeat)
| 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) const
| Get the power setting from the internal state. More...
void | setTemp (const uint8_t degrees)
| 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 | setMode (const uint8_t mode)
| Set the desired operation mode. More...
uint8_t | getMode (void) const
| Get the current operation mode setting. More...
uint64_t | getRaw (void)
| Get the raw state of the object, suitable to be sent with the appropriate IRsend object method. More...
void | setRaw (const uint64_t data)
| Set the raw state of the object. More...
void | setLight (const bool on)
| Set the Light/LED/Display setting of the A/C. More...
bool | getLight (void) const
| Get the Light/LED/Display setting of the A/C. More...
void | setEcono (const bool on)
| Set the Economy setting of the A/C. More...
bool | getEcono (void) const
| Get the Economy setting of the A/C. More...
void | setTurbo (const bool on)
| Set the Turbo setting of the A/C. More...
bool | getTurbo (void) const
| Get the Turbo setting of the A/C. More...
void | setHealth (const bool on)
| Set the Health/Filter setting of the A/C. More...
bool | getHealth (void) const
| Get the Health/Filter setting of the A/C. More...
void | setSleep (const bool on)
| Set the Sleep setting of the A/C. More...
bool | getSleep (void) const
| Get the Sleep setting of the A/C. More...
void | setSwingV (const bool on)
| Set the Vertical Swing setting of the A/C. More...
bool | getSwingV (void) const
| Get the Vertical Swing setting of the A/C. 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 bool | validChecksum (const uint64_t data)
| Verify the checksum is valid for a given state. More...
static uint8_t | calcChecksum (const uint64_t data)
| Calculate the checksum for the supplied 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 uint8_t | convertSwingV (const stdAc::swingv_t position)
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
| Instance of the IR send class. More...
AirtonProtocol | _

## Detailed Description

Class for handling detailed Airton 56-bit A/C messages.

## Constructor & Destructor Documentation

## ◆ IRAirtonAc()

IRAirtonAc::IRAirtonAc | ( | const uint16_t | pin,
|  | const bool | inverted = `false`,
|  | const bool | use_modulation = `true`
| ) |  |
| explicit

Class constructor.

Parameters

  [in] | pin | GPIO to be used when sending.
  [in] | inverted | Is the output signal to be inverted?
  [in] | use_modulation | Is frequency modulation to be used?

## Member Function Documentation

## ◆ begin()

void IRAirtonAc::begin | ( | void |  | ) |

Set up hardware to be able to send a message.

## ◆ calcChecksum()

uint8_t IRAirtonAc::calcChecksum | ( | const uint64_t | state | ) |
| static

Calculate the checksum for the supplied state.

Parameters

  [in] | state | The source state to generate the checksum from.

Returns
  The checksum value.

## ◆ calibrate()

int8_t IRAirtonAc::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 IRAirtonAc::checksum | ( | void |  | ) |
| private

Update the checksum value for the internal state.

## ◆ convertFan()

uint8_t IRAirtonAc::convertFan | ( | const stdAc::fanspeed_t | speed | ) |
| static

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

Parameters

  [in] | speed | The enum to be converted.

Returns
  The native equivalent of the enum.

## ◆ convertMode()

uint8_t IRAirtonAc::convertMode | ( | const stdAc::opmode_t | mode | ) |
| static

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

Parameters

  [in] | mode | The enum to be converted.

Returns
  The native equivalent of the enum.

## ◆ convertSwingV()

static uint8_t IRAirtonAc::convertSwingV | ( | const stdAc::swingv_t | position | ) |
| static

## ◆ getEcono()

bool IRAirtonAc::getEcono | ( | void |  | ) | const

Get the Economy setting of the A/C.

Returns
  true, the setting is on. false, the setting is off.

## ◆ getFan()

uint8_t IRAirtonAc::getFan | ( | void |  | ) | const

Get the current fan speed setting.

Returns
  The current fan speed.

## ◆ getHealth()

bool IRAirtonAc::getHealth | ( | void |  | ) | const

Get the Health/Filter setting of the A/C.

Returns
  true, the setting is on. false, the setting is off.

## ◆ getLight()

bool IRAirtonAc::getLight | ( | void |  | ) | const

Get the Light/LED/Display setting of the A/C.

Returns
  true, the setting is on. false, the setting is off.

## ◆ getMode()

uint8_t IRAirtonAc::getMode | ( | void |  | ) | const

Get the current operation mode setting.

Returns
  The current operation mode.

## ◆ getPower()

bool IRAirtonAc::getPower | ( | void |  | ) | const

Get the power setting from the internal state.

Returns
  A boolean indicating the power setting.

## ◆ getRaw()

uint64_t IRAirtonAc::getRaw | ( | void |  | ) |

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

Returns
  A copy to the internal state.

## ◆ getSleep()

bool IRAirtonAc::getSleep | ( | void |  | ) | const

Get the Sleep setting of the A/C.

Returns
  true, the setting is on. false, the setting is off.

## ◆ getSwingV()

bool IRAirtonAc::getSwingV | ( | void |  | ) | const

Get the Vertical Swing setting of the A/C.

Returns
  true, the setting is on. false, the setting is off.

## ◆ getTemp()

uint8_t IRAirtonAc::getTemp | ( | void |  | ) | const

Get the current temperature setting.

Returns
  Get current setting for temp. in degrees celsius.

## ◆ getTurbo()

bool IRAirtonAc::getTurbo | ( | void |  | ) | const

Get the Turbo setting of the A/C.

Returns
  true, the setting is on. false, the setting is off.

## ◆ off()

void IRAirtonAc::off | ( | void |  | ) |

Set the internal state to have the power off.

## ◆ on()

void IRAirtonAc::on | ( | void |  | ) |

Set the internal state to have the power on.

## ◆ send()

void IRAirtonAc::send | ( | const uint16_t | repeat = `kAirtonDefaultRepeat` | ) |

Send the current internal state as an IR message.

Parameters

  [in] | repeat | Nr. of times the message will be repeated.

## ◆ setEcono()

void IRAirtonAc::setEcono | ( | const bool | on | ) |

Set the Economy setting of the A/C.

Parameters

  [in] | on | true, the setting is on. false, the setting is off.

Note
  Only available in Cool mode.

## ◆ setFan()

void IRAirtonAc::setFan | ( | const uint8_t | speed | ) |

Set the speed of the fan.

Parameters

  [in] | speed | The desired setting.

## ◆ setHealth()

void IRAirtonAc::setHealth | ( | const bool | on | ) |

Set the Health/Filter setting of the A/C.

Parameters

  [in] | on | true, the setting is on. false, the setting is off.

## ◆ setLight()

void IRAirtonAc::setLight | ( | const bool | on | ) |

Set the Light/LED/Display setting of the A/C.

Parameters

  [in] | on | true, the setting is on. false, the setting is off.

## ◆ setMode()

void IRAirtonAc::setMode | ( | const uint8_t | mode | ) |

Set the desired operation mode.

Parameters

  [in] | mode | The desired operation mode.

## ◆ setPower()

void IRAirtonAc::setPower | ( | const bool | on | ) |

Set the internal state to have the desired power.

Parameters

  [in] | on | The desired power state.

## ◆ setRaw()

void IRAirtonAc::setRaw | ( | const uint64_t | state | ) |

Set the raw state of the object.

Parameters

  [in] | state | The raw state from the native IR message.

## ◆ setSleep()

void IRAirtonAc::setSleep | ( | const bool | on | ) |

Set the Sleep setting of the A/C.

Parameters

  [in] | on | true, the setting is on. false, the setting is off.

Note
  Sleep not available in fan or auto mode.

## ◆ setSwingV()

void IRAirtonAc::setSwingV | ( | const bool | on | ) |

Set the Vertical Swing setting of the A/C.

Parameters

  [in] | on | true, the setting is on. false, the setting is off.

## ◆ setTemp()

void IRAirtonAc::setTemp | ( | const uint8_t | degrees | ) |

Set the temperature.

Parameters

  [in] | degrees | The temperature in degrees celsius.

## ◆ setTurbo()

void IRAirtonAc::setTurbo | ( | const bool | on | ) |

Set the Turbo setting of the A/C.

Parameters

  [in] | on | true, the setting is on. false, the setting is off.

## ◆ stateReset()

void IRAirtonAc::stateReset | ( | void |  | ) |

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

## ◆ toCommon()

stdAc::state_t IRAirtonAc::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 IRAirtonAc::toCommonFanSpeed | ( | const uint8_t | speed | ) |
| static

Convert a native fan speed into its stdAc equivalent.

Parameters

  [in] | speed | The native setting to be converted.

Returns
  The stdAc equivalent of the native setting.

## ◆ toCommonMode()

stdAc::opmode_t IRAirtonAc::toCommonMode | ( | const uint8_t | mode | ) |
| static

Convert a native mode into its stdAc equivalent.

Parameters

  [in] | mode | The native setting to be converted.

Returns
  The stdAc equivalent of the native setting.

## ◆ toString()

String IRAirtonAc::toString | ( | void |  | ) | const

Convert the current internal state into a human readable string.

Returns
  A human readable string.

## ◆ validChecksum()

bool IRAirtonAc::validChecksum | ( | const uint64_t | state | ) |
| static

Verify the checksum is valid for a given state.

Parameters

  [in] | state | The value to verify the checksum of.

Returns
  A boolean indicating if it's checksum is valid.

## Member Data Documentation

## ◆ _

AirtonProtocol IRAirtonAc::_
| private

## ◆ _irsend

IRsend IRAirtonAc::_irsend
| private

Instance of the IR send class.

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

- src/ir_Airton.h
- src/ir_Airton.cpp