IRremoteESP8266
|
Class for handling detailed Daikin 312-bit A/C messages. More...
#include <ir_Daikin.h>
Public Member Functions | |
IRDaikin2 (const uint16_t pin, const bool inverted=false, const bool use_modulation=true) | |
Class constructor. More... | |
void | send (const uint16_t repeat=kDaikin2DefaultRepeat) |
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) |
Change the power setting to On. More... | |
void | off (void) |
Change the power setting to Off. More... | |
void | setPower (const bool state) |
Change the power setting. More... | |
bool | getPower (void) const |
Get the value of the current power setting. 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... | |
uint8_t | getMode (void) const |
Get the operating mode setting of the A/C. More... | |
void | setMode (const uint8_t mode) |
Set the operating mode of the A/C. More... | |
void | setSwingVertical (const uint8_t position) |
Set the Vertical Swing mode of the A/C. More... | |
uint8_t | getSwingVertical (void) const |
Get the Vertical Swing mode of the A/C. More... | |
void | setSwingHorizontal (const uint8_t position) |
Set the Horizontal Swing mode of the A/C. More... | |
uint8_t | getSwingHorizontal (void) const |
Get the Horizontal Swing 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 | getPowerful (void) const |
Get the Powerful (Turbo) mode of the A/C. More... | |
void | setPowerful (const bool on) |
Set the Powerful (Turbo) mode of the A/C. More... | |
void | setEcono (const bool on) |
Set the Economy mode of the A/C. More... | |
bool | getEcono (void) const |
Get the Economical mode of the A/C. More... | |
void | setEye (const bool on) |
Set the Eye (Sensor) mode of the A/C. More... | |
bool | getEye (void) const |
Get the Eye (Sensor) mode status of the A/C. More... | |
void | setEyeAuto (const bool on) |
Set the Automatic Eye (Sensor) mode of the A/C. More... | |
bool | getEyeAuto (void) const |
Get the Automaitc Eye (Sensor) mode status of the A/C. More... | |
void | setPurify (const bool on) |
Set the Purify (Filter) mode of the A/C. More... | |
bool | getPurify (void) const |
Get the Purify (Filter) mode status of the A/C. More... | |
void | setMold (const bool on) |
Set the Mould (filter) mode of the A/C. More... | |
bool | getMold (void) const |
Get the Mould (filter) mode status of the A/C. More... | |
void | enableOnTimer (const uint16_t starttime) |
Set the enable status & time of the On Timer. More... | |
void | disableOnTimer (void) |
Disable the On timer. More... | |
uint16_t | getOnTime (void) const |
Get the On Timer time to be sent to the A/C unit. More... | |
bool | getOnTimerEnabled (void) const |
Get the enable status of the On Timer. More... | |
void | enableSleepTimer (const uint16_t sleeptime) |
Set the enable status & time of the Sleep Timer. More... | |
void | disableSleepTimer (void) |
Disable the sleep timer. More... | |
uint16_t | getSleepTime (void) const |
Get the Sleep Timer time to be sent to the A/C unit. More... | |
bool | getSleepTimerEnabled (void) const |
Get the Sleep timer enabled status of the A/C. More... | |
void | enableOffTimer (const uint16_t endtime) |
Set the enable status & time of the Off Timer. More... | |
void | disableOffTimer (void) |
Disable the Off timer. More... | |
uint16_t | getOffTime (void) const |
Get the Off Timer time to be sent to the A/C unit. More... | |
bool | getOffTimerEnabled (void) const |
Get the enable status of the Off Timer. More... | |
void | setCurrentTime (const uint16_t time) |
Set the clock on the A/C unit. More... | |
uint16_t | getCurrentTime (void) const |
Get the clock time to be sent to the A/C unit. More... | |
void | setBeep (const uint8_t beep) |
Set the Beep mode of the A/C. More... | |
uint8_t | getBeep (void) const |
Get the Beep status of the A/C. More... | |
void | setLight (const uint8_t light) |
Set the Light (LED) mode of the A/C. More... | |
uint8_t | getLight (void) const |
Get the Light status of the A/C. More... | |
void | setClean (const bool on) |
Set the Auto clean mode of the A/C. More... | |
bool | getClean (void) const |
Get the Auto Clean mode status of the A/C. More... | |
void | setFreshAir (const bool on) |
Set the Fresh Air mode of the A/C. More... | |
bool | getFreshAir (void) const |
Get the Fresh Air mode status of the A/C. More... | |
void | setFreshAirHigh (const bool on) |
Set the (High) Fresh Air mode of the A/C. More... | |
bool | getFreshAirHigh (void) const |
Get the (High) Fresh Air mode status of the A/C. More... | |
uint8_t * | getRaw (void) |
Get a PTR to the internal state/code for this protocol. More... | |
void | setRaw (const uint8_t new_code[]) |
Set the internal state from a valid code for this protocol. 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 (uint8_t state[], const uint16_t length=kDaikin2StateLength) |
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 uint8_t | convertSwingV (const stdAc::swingv_t position) |
Convert a stdAc::swingv_t enum into it's native setting. More... | |
static uint8_t | convertSwingH (const stdAc::swingh_t position) |
Convert a stdAc::swingh_t enum into it's native setting. More... | |
static stdAc::swingv_t | toCommonSwingV (const uint8_t setting) |
Convert a native vertical swing postion to it's common equivalent. More... | |
static stdAc::swingh_t | toCommonSwingH (const uint8_t setting) |
Convert a native horizontal swing postion to it's common 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... | |
void | clearOnTimerFlag (void) |
Clear the On Timer flag. More... | |
void | clearSleepTimerFlag (void) |
Clear the sleep timer flag. More... | |
Private Attributes | |
IRsend | _irsend |
instance of the IR send class More... | |
Daikin2Protocol | _ |
Class for handling detailed Daikin 312-bit A/C messages.
|
explicit |
Class constructor.
[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? |
void IRDaikin2::begin | ( | void | ) |
Set up hardware to be able to send a message.
|
inline |
Run the calibration to calculate uSec timing offsets for this platform.
|
private |
Calculate and set the checksum values for the internal state.
|
private |
Clear the On Timer flag.
|
private |
Clear the sleep timer flag.
|
static |
Convert a stdAc::fanspeed_t enum into it's native speed.
[in] | speed | The enum to be converted. |
|
static |
Convert a stdAc::opmode_t enum into its native mode.
[in] | mode | The enum to be converted. |
|
static |
Convert a stdAc::swingh_t enum into it's native setting.
[in] | position | The enum to be converted. |
|
static |
Convert a stdAc::swingv_t enum into it's native setting.
[in] | position | The enum to be converted. |
void IRDaikin2::disableOffTimer | ( | void | ) |
Disable the Off timer.
void IRDaikin2::disableOnTimer | ( | void | ) |
Disable the On timer.
void IRDaikin2::disableSleepTimer | ( | void | ) |
Disable the sleep timer.
void IRDaikin2::enableOffTimer | ( | const uint16_t | endtime | ) |
Set the enable status & time of the Off Timer.
[in] | endtime | The number of minutes past midnight. |
void IRDaikin2::enableOnTimer | ( | const uint16_t | starttime | ) |
Set the enable status & time of the On Timer.
[in] | starttime | The number of minutes past midnight. |
void IRDaikin2::enableSleepTimer | ( | const uint16_t | sleeptime | ) |
Set the enable status & time of the Sleep Timer.
[in] | sleeptime | The number of minutes past midnight. |
uint8_t IRDaikin2::getBeep | ( | void | ) | const |
Get the Beep status of the A/C.
bool IRDaikin2::getClean | ( | void | ) | const |
Get the Auto Clean mode status of the A/C.
uint16_t IRDaikin2::getCurrentTime | ( | void | ) | const |
Get the clock time to be sent to the A/C unit.
bool IRDaikin2::getEcono | ( | void | ) | const |
Get the Economical mode of the A/C.
bool IRDaikin2::getEye | ( | void | ) | const |
Get the Eye (Sensor) mode status of the A/C.
bool IRDaikin2::getEyeAuto | ( | void | ) | const |
Get the Automaitc Eye (Sensor) mode status of the A/C.
uint8_t IRDaikin2::getFan | ( | void | ) | const |
Get the current fan speed setting.
bool IRDaikin2::getFreshAir | ( | void | ) | const |
Get the Fresh Air mode status of the A/C.
bool IRDaikin2::getFreshAirHigh | ( | void | ) | const |
Get the (High) Fresh Air mode status of the A/C.
uint8_t IRDaikin2::getLight | ( | void | ) | const |
Get the Light status of the A/C.
uint8_t IRDaikin2::getMode | ( | void | ) | const |
Get the operating mode setting of the A/C.
bool IRDaikin2::getMold | ( | void | ) | const |
Get the Mould (filter) mode status of the A/C.
uint16_t IRDaikin2::getOffTime | ( | void | ) | const |
Get the Off Timer time to be sent to the A/C unit.
bool IRDaikin2::getOffTimerEnabled | ( | void | ) | const |
Get the enable status of the Off Timer.
uint16_t IRDaikin2::getOnTime | ( | void | ) | const |
Get the On Timer time to be sent to the A/C unit.
bool IRDaikin2::getOnTimerEnabled | ( | void | ) | const |
Get the enable status of the On Timer.
bool IRDaikin2::getPower | ( | void | ) | const |
Get the value of the current power setting.
bool IRDaikin2::getPowerful | ( | void | ) | const |
Get the Powerful (Turbo) mode of the A/C.
bool IRDaikin2::getPurify | ( | void | ) | const |
Get the Purify (Filter) mode status of the A/C.
bool IRDaikin2::getQuiet | ( | void | ) | const |
Get the Quiet mode status of the A/C.
uint8_t * IRDaikin2::getRaw | ( | void | ) |
Get a PTR to the internal state/code for this protocol.
uint16_t IRDaikin2::getSleepTime | ( | void | ) | const |
Get the Sleep Timer time to be sent to the A/C unit.
bool IRDaikin2::getSleepTimerEnabled | ( | void | ) | const |
Get the Sleep timer enabled status of the A/C.
uint8_t IRDaikin2::getSwingHorizontal | ( | void | ) | const |
Get the Horizontal Swing mode of the A/C.
uint8_t IRDaikin2::getSwingVertical | ( | void | ) | const |
Get the Vertical Swing mode of the A/C.
uint8_t IRDaikin2::getTemp | ( | void | ) | const |
Get the current temperature setting.
void IRDaikin2::off | ( | void | ) |
Change the power setting to Off.
void IRDaikin2::on | ( | void | ) |
Change the power setting to On.
void IRDaikin2::send | ( | const uint16_t | repeat = kDaikin2DefaultRepeat | ) |
Send the current internal state as an IR message.
[in] | repeat | Nr. of times the message will be repeated. |
void IRDaikin2::setBeep | ( | const uint8_t | beep | ) |
Set the Beep mode of the A/C.
[in] | beep | true, the setting is on. false, the setting is off. |
void IRDaikin2::setClean | ( | const bool | on | ) |
Set the Auto clean mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setCurrentTime | ( | const uint16_t | numMins | ) |
Set the clock on the A/C unit.
[in] | numMins | Nr. of minutes past midnight. |
void IRDaikin2::setEcono | ( | const bool | on | ) |
Set the Economy mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setEye | ( | const bool | on | ) |
Set the Eye (Sensor) mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setEyeAuto | ( | const bool | on | ) |
Set the Automatic Eye (Sensor) mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setFan | ( | const uint8_t | fan | ) |
Set the speed of the fan.
[in] | fan | The desired setting. |
void IRDaikin2::setFreshAir | ( | const bool | on | ) |
Set the Fresh Air mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setFreshAirHigh | ( | const bool | on | ) |
Set the (High) Fresh Air mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setLight | ( | const uint8_t | light | ) |
Set the Light (LED) mode of the A/C.
[in] | light | true, the setting is on. false, the setting is off. |
void IRDaikin2::setMode | ( | const uint8_t | desired_mode | ) |
Set the operating mode of the A/C.
[in] | desired_mode | The desired operating mode. |
void IRDaikin2::setMold | ( | const bool | on | ) |
Set the Mould (filter) mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setPower | ( | const bool | on | ) |
Change the power setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setPowerful | ( | const bool | on | ) |
Set the Powerful (Turbo) mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setPurify | ( | const bool | on | ) |
Set the Purify (Filter) mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setQuiet | ( | const bool | on | ) |
Set the Quiet mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRDaikin2::setRaw | ( | const uint8_t | new_code[] | ) |
Set the internal state from a valid code for this protocol.
[in] | new_code | A valid code for this protocol. |
void IRDaikin2::setSwingHorizontal | ( | const uint8_t | position | ) |
Set the Horizontal Swing mode of the A/C.
[in] | position | The position/mode to set the swing to. |
void IRDaikin2::setSwingVertical | ( | const uint8_t | position | ) |
Set the Vertical Swing mode of the A/C.
[in] | position | The position/mode to set the swing to. |
void IRDaikin2::setTemp | ( | const uint8_t | desired | ) |
Set the temperature.
[in] | desired | The temperature in degrees celsius. |
|
private |
Reset the internal state to a fixed known good state.
stdAc::state_t IRDaikin2::toCommon | ( | void | ) | const |
Convert the current internal state into its stdAc::state_t equivalent.
|
static |
Convert a native horizontal swing postion to it's common equivalent.
[in] | setting | A native position to convert. |
|
static |
Convert a native vertical swing postion to it's common equivalent.
[in] | setting | A native position to convert. |
String IRDaikin2::toString | ( | void | ) | const |
Convert the current internal state into a human readable string.
|
static |
Verify the checksum is valid for a given state.
[in] | state | The array to verify the checksum of. |
[in] | length | The length of the state array. |
|
private |
|
private |
instance of the IR send class