# IRremoteESP8266: IRDaikin64 Class Reference

IRDaikin64 Class Reference

Class for handling detailed Daikin 64-bit A/C messages. More...

`#include <ir_Daikin.h>`

Collaboration diagram for IRDaikin64:
[legend]

## Public Member Functions

| IRDaikin64 (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
| Class constructor. More...
void | send (const uint16_t repeat=kDaikin64DefaultRepeat)
| 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...
uint64_t | getRaw (void)
| Get a copy of the internal state as a valid code for this protocol. More...
void | setRaw (const uint64_t new_state)
| Set the internal state from a valid code for this protocol. More...
void | setPowerToggle (const bool on)
| Set the Power toggle setting of the A/C. More...
bool | getPowerToggle (void) const
| Get the Power toggle setting of the A/C. 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 | setSwingVertical (const bool on)
| Set the Vertical Swing mode of the A/C. More...
bool | getSwingVertical (void) const
| Get the Vertical Swing mode of the A/C. More...
void | setSleep (const bool on)
| Set the Sleep mode of the A/C. More...
bool | getSleep (void) const
| Get the Sleep mode of the A/C. More...
bool | getQuiet (void) const
| Get the Quiet mode status of the A/C. More...
void | setQuiet (const bool on)
| Set the Quiet mode of the A/C. More...
bool | getTurbo (void) const
| Get the Turbo (Powerful) mode status of the A/C. More...
void | setTurbo (const bool on)
| Set the Turbo (Powerful) mode of the A/C. More...
void | setClock (const uint16_t mins_since_midnight)
| Set the clock on the A/C unit. More...
uint16_t | getClock (void) const
| Get the clock time to be sent to the A/C unit. More...
void | setOnTimeEnabled (const bool on)
| Set the enable status of the On Timer. More...
bool | getOnTimeEnabled (void) const
| Get the enable status of the On Timer. More...
void | setOnTime (const uint16_t mins_since_midnight)
| Set the On Timer time for the A/C unit. More...
uint16_t | getOnTime (void) const
| Get the On Timer time to be sent to the A/C unit. More...
void | setOffTimeEnabled (const bool on)
| Set the enable status of the Off Timer. More...
bool | getOffTimeEnabled (void) const
| Get the enable status of the Off Timer. More...
void | setOffTime (const uint16_t mins_since_midnight)
| Set the Off Timer time for the A/C unit. More...
uint16_t | getOffTime (void) const
| Get the Off Timer time to be sent to the A/C unit. More...
stdAc::state_t | toCommon (const stdAc::state_t *prev=NULL) 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 uint64_t state)
| Calculate the checksum for a given state. More...
static bool | validChecksum (const uint64_t state)
| 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 | stateReset (void)
| Reset the internal state to a fixed known good state. More...
void | checksum (void)
| Calculate and set the checksum values for the internal state. More...

## Private Attributes

IRsend | _irsend
| instance of the IR send class More...
Daikin64Protocol | _

## Detailed Description

Class for handling detailed Daikin 64-bit A/C messages.

## Constructor & Destructor Documentation

## IRDaikin64()

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

Set up hardware to be able to send a message.

## calcChecksum()

uint8_t IRDaikin64::calcChecksum | ( | const uint64_t | state | ) |

static

Calculate the checksum for a given state.

Parameters

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

Returns
  The 4-bit checksum stored in a uint_8.

## calibrate()

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

private

Calculate and set the checksum values for the internal state.

## convertFan()

uint8_t IRDaikin64::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 IRDaikin64::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 IRDaikin64::getClock | ( | void |  | ) | const

Get the clock time to be sent to the A/C unit.

Returns
  The number of minutes past midnight.

## getFan()

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

Get the current fan speed setting.

Returns
  The current fan speed.

## getMode()

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

Get the operating mode setting of the A/C.

Returns
  The current operating mode setting.

## getOffTime()

uint16_t IRDaikin64::getOffTime | ( | void |  | ) | const

Get the Off Timer time to be sent to the A/C unit.

Returns
  The number of minutes past midnight.

## getOffTimeEnabled()

bool IRDaikin64::getOffTimeEnabled | ( | void |  | ) | const

Get the enable status of the Off Timer.

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

## getOnTime()

uint16_t IRDaikin64::getOnTime | ( | void |  | ) | const

Get the On Timer time to be sent to the A/C unit.

Returns
  The number of minutes past midnight.

## getOnTimeEnabled()

bool IRDaikin64::getOnTimeEnabled | ( | void |  | ) | const

Get the enable status of the On Timer.

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

## getPowerToggle()

bool IRDaikin64::getPowerToggle | ( | void |  | ) | const

Get the Power toggle setting of the A/C.

Returns
  The current operating mode setting.

## getQuiet()

bool IRDaikin64::getQuiet | ( | void |  | ) | const

Get the Quiet mode status of the A/C.

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

## getRaw()

uint64_t IRDaikin64::getRaw | ( | void |  | ) |

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

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

## getSleep()

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

Get the Sleep mode of the A/C.

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

## getSwingVertical()

bool IRDaikin64::getSwingVertical | ( | void |  | ) | const

Get the Vertical Swing mode of the A/C.

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

## getTemp()

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

Get the current temperature setting.

Returns
  The current setting for temp. in degrees celsius.

## getTurbo()

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

Get the Turbo (Powerful) mode status of the A/C.

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

## send()

void IRDaikin64::send | ( | const uint16_t | repeat = `kDaikin64DefaultRepeat` | ) |

Send the current internal state as an IR message.

Parameters

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

## setClock()

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

Set the clock on the A/C unit.

Parameters

  [in] | mins_since_midnight | Nr. of minutes past midnight.

## setFan()

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

Set the speed of the fan.

Parameters

  [in] | speed | The desired setting.

## setMode()

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

Set the operating mode of the A/C.

Parameters

  [in] | mode | The desired operating mode.

## setOffTime()

void IRDaikin64::setOffTime | ( | const uint16_t | mins_since_midnight | ) |

Set the Off Timer time for the A/C unit.

Parameters

  [in] | mins_since_midnight | Nr. of minutes past midnight.

## setOffTimeEnabled()

void IRDaikin64::setOffTimeEnabled | ( | const bool | on | ) |

Set the enable status of the Off Timer.

Parameters

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

## setOnTime()

void IRDaikin64::setOnTime | ( | const uint16_t | mins_since_midnight | ) |

Set the On Timer time for the A/C unit.

Parameters

  [in] | mins_since_midnight | Nr. of minutes past midnight.

## setOnTimeEnabled()

void IRDaikin64::setOnTimeEnabled | ( | const bool | on | ) |

Set the enable status of the On Timer.

Parameters

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

## setPowerToggle()

void IRDaikin64::setPowerToggle | ( | const bool | on | ) |

Set the Power toggle setting of the A/C.

Parameters

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

## setQuiet()

void IRDaikin64::setQuiet | ( | const bool | on | ) |

Set the Quiet mode of the A/C.

Parameters

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

## setRaw()

void IRDaikin64::setRaw | ( | const uint64_t | new_state | ) |

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

Parameters

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

## setSleep()

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

Set the Sleep mode of the A/C.

Parameters

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

## setSwingVertical()

void IRDaikin64::setSwingVertical | ( | const bool | on | ) |

Set the Vertical Swing mode of the A/C.

Parameters

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

## setTemp()

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

Set the temperature.

Parameters

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

## setTurbo()

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

Set the Turbo (Powerful) mode of the A/C.

Parameters

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

## stateReset()

void IRDaikin64::stateReset | ( | void |  | ) |

private

Reset the internal state to a fixed known good state.

## toCommon()

stdAc::state_t IRDaikin64::toCommon | ( | const stdAc::state_t * | prev = `NULL` | ) | const

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

Parameters

  [in] | prev | Ptr to a previous state.

Returns
  The stdAc equivalent of the native settings.

## toCommonFanSpeed()

stdAc::fanspeed_t IRDaikin64::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 IRDaikin64::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 IRDaikin64::toString | ( | void |  | ) | const

Convert the current internal state into a human readable string.

Returns
  A human readable string.

## validChecksum()

bool IRDaikin64::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

## _

Daikin64Protocol IRDaikin64::_

private

## _irsend

IRsend IRDaikin64::_irsend

private

instance of the IR send class

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

- src/ir_Daikin.h
- src/ir_Daikin.cpp