IRremoteESP8266

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

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

`#include <ir_Vestel.h>`

Collaboration diagram for IRVestelAc:
[legend]

## Public Member Functions
| IRVestelAc (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
| Class constructor. More...
void | stateReset (void)
| Reset the state of the remote to a known good state/sequence. More...
void | send (const uint16_t repeat=kNoRepeat)
| 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 requested power state of the A/C to on. More...
void | off (void)
| Set the requested power state of the A/C to off. More...
void | setPower (const bool on)
| Change the power setting. More...
bool | getPower (void) const
| Get the value of the current power setting. More...
void | setAuto (const int8_t autoLevel)
| Set Auto mode/level of the A/C. More...
void | setTimer (const uint16_t minutes)
| Set Timer option of A/C. More...
uint16_t | getTimer (void) const
| Get the Timer time of A/C. More...
void | setTime (const uint16_t minutes)
| Set the A/C's internal clock. More...
uint16_t | getTime (void) const
| Get the A/C's internal clock's time. More...
void | setOnTimer (const uint16_t minutes)
| Set the On timer time on the A/C. More...
uint16_t | getOnTimer (void) const
| Get the A/C's On Timer time. More...
void | setOffTimer (const uint16_t minutes)
| Set the Off timer time on the A/C. More...
uint16_t | getOffTimer (void) const
| Get the A/C's Off Timer time. 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 fan)
| 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 operating mode of the A/C. More...
uint8_t | getMode (void) const
| Get the operating mode setting of the A/C. More...
void | setRaw (const uint8_t *newState)
| Set the internal state from a valid code for this protocol. More...
void | setRaw (const uint64_t newState)
| Set the internal state from a valid code for this protocol. More...
uint64_t | getRaw (void)
| Get a copy of the internal state/code for this protocol. More...
void | setSwing (const bool on)
| Set the Swing Roaming setting of the A/C. More...
bool | getSwing (void) const
| Get the Swing Roaming 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 | 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 | setIon (const bool on)
| Set the Ion (Filter) setting of the A/C. More...
bool | getIon (void) const
| Get the Ion (Filter) setting of the A/C. More...
bool | isTimeCommand (void) const
| Is the current state a time command? More...
bool | isOnTimerActive (void) const
| Get if the On Timer is active on the A/C. More...
void | setOnTimerActive (const bool on)
| Set the On timer to be active on the A/C. More...
bool | isOffTimerActive (void) const
| Get if the Off Timer is active on the A/C. More...
void | setOffTimerActive (const bool on)
| Set the Off timer to be active on the A/C. More...
bool | isTimerActive (void) const
| Get if the Timer is active on the A/C. More...
void | setTimerActive (const bool on)
| Set the timer to be active on 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 state)
| Verify the checksum is valid for a given state. More...
static uint8_t | calcChecksum (const uint64_t state)
| Calculate the checksum 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)
| Calculate & set the checksum for the current internal state of the remote. More...

## Private Attributes
IRsend | _irsend
| Instance of the IR send class. More...
VestelProtocol | _

## Detailed Description

Class for handling detailed Vestel A/C messages.

## Constructor & Destructor Documentation

## ◆ IRVestelAc()

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

Set up hardware to be able to send a message.

## ◆ calcChecksum()

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

Calculate the checksum for a given state.

Parameters

  [in] | state | The state to calc the checksum of.

Returns
  The calculated checksum value.

## ◆ calibrate()

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

Calculate & set the checksum for the current internal state of the remote.

## ◆ convertFan()

uint8_t IRVestelAc::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 IRVestelAc::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.

## ◆ getFan()

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

Get the current fan speed setting.

Returns
  The current fan speed/mode.

## ◆ getIon()

bool IRVestelAc::getIon | ( | void |  | ) | const

Get the Ion (Filter) setting of the A/C.

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

## ◆ getMode()

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

Get the operating mode setting of the A/C.

Returns
  The current operating mode setting.

## ◆ getOffTimer()

uint16_t IRVestelAc::getOffTimer | ( | void |  | ) | const

Get the A/C's Off Timer time.

Returns
  The time expressed in nr. of minutes.

## ◆ getOnTimer()

uint16_t IRVestelAc::getOnTimer | ( | void |  | ) | const

Get the A/C's On Timer time.

Returns
  The time expressed in nr. of minutes.

## ◆ getPower()

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

Get the value of the current power setting.

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

## ◆ getRaw()

uint64_t IRVestelAc::getRaw | ( | void |  | ) |

Get a copy of the internal state/code for this protocol.

Returns
  A code for this protocol based on the current internal state.

## ◆ getSleep()

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

Get the Sleep setting of the A/C.

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

## ◆ getSwing()

bool IRVestelAc::getSwing | ( | void |  | ) | const

Get the Swing Roaming setting of the A/C.

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

## ◆ getTemp()

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

Get the current temperature setting.

Returns
  The current setting for temp. in degrees celsius.

## ◆ getTime()

uint16_t IRVestelAc::getTime | ( | void |  | ) | const

Get the A/C's internal clock's time.

Returns
  The time expressed in nr. of minutes past midnight.

## ◆ getTimer()

uint16_t IRVestelAc::getTimer | ( | void |  | ) | const

Get the Timer time of A/C.

Returns
  The number of minutes of time on the timer.

## ◆ getTurbo()

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

Get the Turbo setting of the A/C.

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

## ◆ isOffTimerActive()

bool IRVestelAc::isOffTimerActive | ( | void |  | ) | const

Get if the Off Timer is active on the A/C.

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

## ◆ isOnTimerActive()

bool IRVestelAc::isOnTimerActive | ( | void |  | ) | const

Get if the On Timer is active on the A/C.

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

## ◆ isTimeCommand()

bool IRVestelAc::isTimeCommand | ( | void |  | ) | const

Is the current state a time command?

Returns
  true, if the state is a time message. Otherwise, false.

## ◆ isTimerActive()

bool IRVestelAc::isTimerActive | ( | void |  | ) | const

Get if the Timer is active on the A/C.

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

## ◆ off()

void IRVestelAc::off | ( | void |  | ) |

Set the requested power state of the A/C to off.

## ◆ on()

void IRVestelAc::on | ( | void |  | ) |

Set the requested power state of the A/C to on.

## ◆ send()

void IRVestelAc::send | ( | const uint16_t | repeat = `kNoRepeat` | ) |

Send the current internal state as an IR message.

Parameters

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

## ◆ setAuto()

void IRVestelAc::setAuto | ( | const int8_t | autoLevel | ) |

Set Auto mode/level of the A/C.

Parameters

  [in] | autoLevel | The auto mode/level setting.

## ◆ setFan()

void IRVestelAc::setFan | ( | const uint8_t | fan | ) |

Set the speed of the fan.

Parameters

  [in] | fan | The desired setting.

## ◆ setIon()

void IRVestelAc::setIon | ( | const bool | on | ) |

Set the Ion (Filter) setting of the A/C.

Parameters

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

## ◆ setMode()

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

Set the operating mode of the A/C.

Parameters

  [in] | mode | The desired operating mode.

Note
  If we get an unexpected mode, default to AUTO.

## ◆ setOffTimer()

void IRVestelAc::setOffTimer | ( | const uint16_t | minutes | ) |

Set the Off timer time on the A/C.

Parameters

  [in] | minutes | Time in nr. of minutes.

## ◆ setOffTimerActive()

void IRVestelAc::setOffTimerActive | ( | const bool | on | ) |

Set the Off timer to be active on the A/C.

Parameters

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

## ◆ setOnTimer()

void IRVestelAc::setOnTimer | ( | const uint16_t | minutes | ) |

Set the On timer time on the A/C.

Parameters

  [in] | minutes | Time in nr. of minutes.

## ◆ setOnTimerActive()

void IRVestelAc::setOnTimerActive | ( | const bool | on | ) |

Set the On timer to be active on the A/C.

Parameters

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

## ◆ setPower()

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

Change the power setting.

Parameters

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

## ◆ setRaw() [1/2]

void IRVestelAc::setRaw | ( | const uint64_t | newState | ) |

Set the internal state from a valid code for this protocol.

Parameters

  [in] | newState | A valid code for this protocol.

## ◆ setRaw() [2/2]

void IRVestelAc::setRaw | ( | const uint8_t * | newState | ) |

Set the internal state from a valid code for this protocol.

Parameters

  [in] | newState | A valid code for this protocol.

## ◆ setSleep()

void IRVestelAc::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.

## ◆ setSwing()

void IRVestelAc::setSwing | ( | const bool | on | ) |

Set the Swing Roaming setting of the A/C.

Parameters

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

## ◆ setTemp()

void IRVestelAc::setTemp | ( | const uint8_t | temp | ) |

Set the temperature.

Parameters

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

## ◆ setTime()

void IRVestelAc::setTime | ( | const uint16_t | minutes | ) |

Set the A/C's internal clock.

Parameters

  [in] | minutes | The time expressed in nr. of minutes past midnight.

## ◆ setTimer()

void IRVestelAc::setTimer | ( | const uint16_t | minutes | ) |

Set Timer option of A/C.

Parameters

  [in] | minutes | Nr of minutes the timer is to be set for.

Note
  Valid arguments are 0, 0.5, 1, 2, 3 and 5 hours (in minutes). 0 disables the timer.

## ◆ setTimerActive()

void IRVestelAc::setTimerActive | ( | const bool | on | ) |

Set the timer to be active on the A/C.

Parameters

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

## ◆ setTurbo()

void IRVestelAc::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 IRVestelAc::stateReset | ( | void |  | ) |

Reset the state of the remote to a known good state/sequence.

Note
  Power On, Mode Auto, Fan Auto, Temp = 25C/77F

## ◆ toCommon()

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

Convert a native fan speed into its stdAc equivalent.

Parameters

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

Returns
  The stdAc equivalent of the native setting.

## ◆ toCommonMode()

stdAc::opmode_t IRVestelAc::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 IRVestelAc::toString | ( | void |  | ) | const

Convert the current internal state into a human readable string.

Returns
  A human readable string.

## ◆ validChecksum()

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

Verify the checksum is valid for a given state.

Parameters

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

Returns
  true, if the state has a valid checksum. Otherwise, false.

## Member Data Documentation

## ◆ _

VestelProtocol IRVestelAc::_
| private

## ◆ _irsend

IRsend IRVestelAc::_irsend
| private

Instance of the IR send class.

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

- src/ir_Vestel.h
- src/ir_Vestel.cpp