IRremoteESP8266

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

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

`#include <ir_Sanyo.h>`

Collaboration diagram for IRSanyoAc88:
[legend]

## Public Member Functions
| IRSanyoAc88 (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=kSanyoAc88MinRepeat)
| Send the current internal state as IR messages. 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 | setTemp (const uint8_t degrees)
| Set the desired temperature. More...
uint8_t | getTemp (void) const
| Get the current desired 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 operating mode of the A/C. More...
uint8_t | getMode (void) const
| Get the operating mode setting of the A/C. More...
void | setSleep (const bool on)
| Change the Sleep setting. More...
bool | getSleep (void) const
| Get the value of the current Sleep setting. More...
void | setTurbo (const bool on)
| Change the Turbo setting. More...
bool | getTurbo (void) const
| Get the value of the current Turbo setting. More...
void | setFilter (const bool on)
| Change the Filter setting. More...
bool | getFilter (void) const
| Get the value of the current Filter setting. More...
void | setSwingV (const bool on)
| Change the SwingV setting. More...
bool | getSwingV (void) const
| Get the value of the current SwingV setting. More...
uint16_t | getClock (void) const
| Get the current clock time. More...
void | setClock (const uint16_t mins_since_midnight)
| Set the current clock time. More...
void | setRaw (const uint8_t newState[])
| Set the internal state from a valid code for this protocol. More...
uint8_t * | getRaw (void)
| Get a PTR to the internal state/code for this protocol with all integrity checks passing. 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 | 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)

## Static Private Member Functions
static uint8_t | calcChecksum (const uint8_t state[], const uint16_t length=kSanyoAcStateLength)

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

## Detailed Description

Class for handling detailed Sanyo A/C messages.

## Constructor & Destructor Documentation

## ◆ IRSanyoAc88()

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

Set up hardware to be able to send a message.

## ◆ calcChecksum()

static uint8_t IRSanyoAc88::calcChecksum | ( | const uint8_t | state[],
|  | const uint16_t | length = `kSanyoAcStateLength`
| ) |  |
| static private

## ◆ calibrate()

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

## ◆ convertFan()

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

## ◆ getClock()

uint16_t IRSanyoAc88::getClock | ( | void |  | ) | const

Get the current clock time.

Returns
  The time as the nr. of minutes past midnight.

## ◆ getFan()

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

Get the current fan speed setting.

Returns
  The current fan speed/mode.

## ◆ getFilter()

bool IRSanyoAc88::getFilter | ( | void |  | ) | const

Get the value of the current Filter setting.

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

## ◆ getMode()

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

Get the operating mode setting of the A/C.

Returns
  The current operating mode setting.

## ◆ getPower()

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

Get the value of the current power setting.

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

## ◆ getRaw()

uint8_t * IRSanyoAc88::getRaw | ( | void |  | ) |

Get a PTR to the internal state/code for this protocol with all integrity checks passing.

Returns
  PTR to a code for this protocol based on the current internal state.

## ◆ getSleep()

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

Get the value of the current Sleep setting.

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

## ◆ getSwingV()

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

Get the value of the current SwingV setting.

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

## ◆ getTemp()

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

Get the current desired temperature setting.

Returns
  The current setting for temp. in degrees celsius.

## ◆ getTurbo()

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

Get the value of the current Turbo setting.

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

## ◆ off()

void IRSanyoAc88::off | ( | void |  | ) |

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

## ◆ on()

void IRSanyoAc88::on | ( | void |  | ) |

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

## ◆ send()

void IRSanyoAc88::send | ( | const uint16_t | repeat = `kSanyoAc88MinRepeat` | ) |

Send the current internal state as IR messages.

Parameters

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

## ◆ setClock()

void IRSanyoAc88::setClock | ( | const uint16_t | mins_since_midnight | ) |

Set the current clock time.

Parameters

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

## ◆ setFan()

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

Set the speed of the fan.

Parameters

  [in] | speed | The desired setting.

## ◆ setFilter()

void IRSanyoAc88::setFilter | ( | const bool | on | ) |

Change the Filter setting.

Parameters

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

## ◆ setMode()

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

## ◆ setPower()

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

Change the power setting.

Parameters

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

## ◆ setRaw()

void IRSanyoAc88::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 IRSanyoAc88::setSleep | ( | const bool | on | ) |

Change the Sleep setting.

Parameters

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

## ◆ setSwingV()

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

Change the SwingV setting.

Parameters

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

## ◆ setTemp()

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

Set the desired temperature.

Parameters

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

## ◆ setTurbo()

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

Change the Turbo setting.

Parameters

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

## ◆ stateReset()

void IRSanyoAc88::stateReset | ( | void |  | ) |

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

See also
  https://docs.google.com/spreadsheets/d/1dYfLsnYvpjV-SgO8pdinpfuBIpSzm8Q1R5SabrLeskw/edit?ts=5f0190a5#gid=1050142776&range=A2:B2

## ◆ toCommon()

stdAc::state_t IRSanyoAc88::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 IRSanyoAc88::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 IRSanyoAc88::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 IRSanyoAc88::toString | ( | void |  | ) | const

Convert the current internal state into a human readable string.

Returns
  A human readable string.

## Member Data Documentation

## ◆ _

SanyoAc88Protocol IRSanyoAc88::_
| private

## ◆ _irsend

IRsend IRSanyoAc88::_irsend
| private

Instance of the IR send class.

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

- src/ir_Sanyo.h
- src/ir_Sanyo.cpp