IRremoteESP8266
|
Class for handling detailed Daikin 312-bit A/C messages. Code by crankyoldgit, Reverse engineering analysis by sheppy99. 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 () |
Set up hardware to be able to send a message. More... | |
void | on () |
Change the power setting to On. More... | |
void | off () |
Change the power setting to Off. More... | |
void | setPower (const bool state) |
Change the power setting. More... | |
bool | getPower () |
Get the value of the current power setting. More... | |
void | setTemp (const uint8_t temp) |
Set the temperature. More... | |
uint8_t | getTemp () |
Get the current temperature setting. More... | |
void | setFan (const uint8_t fan) |
Set the speed of the fan. More... | |
uint8_t | getFan () |
Get the current fan speed setting. More... | |
uint8_t | getMode () |
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 () |
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 () |
Get the Horizontal Swing mode of the A/C. More... | |
bool | getQuiet () |
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 () |
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 () |
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 () |
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 () |
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 () |
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 () |
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 () |
Disable the On timer. More... | |
uint16_t | getOnTime () |
Get the On Timer time to be sent to the A/C unit. More... | |
bool | getOnTimerEnabled () |
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 () |
Disable the sleep timer. More... | |
uint16_t | getSleepTime () |
Get the Sleep Timer time to be sent to the A/C unit. More... | |
bool | getSleepTimerEnabled () |
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 () |
Disable the Off timer. More... | |
uint16_t | getOffTime () |
Get the Off Timer time to be sent to the A/C unit. More... | |
bool | getOffTimerEnabled () |
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 () |
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 () |
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 () |
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 () |
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 () |
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 () |
Get the (High) Fresh Air mode status of the A/C. More... | |
uint8_t * | getRaw () |
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) |
Convert the current internal state into its stdAc::state_t equivilant. More... | |
String | toString () |
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 () |
Reset the internal state to a fixed known good state. More... | |
void | checksum () |
Calculate and set the checksum values for the internal state. More... | |
void | clearOnTimerFlag () |
Clear the On Timer flag. More... | |
void | clearSleepTimerFlag () |
Clear the sleep timer flag. More... | |
Private Attributes | |
IRsend | _irsend |
instance of the IR send class More... | |
uint8_t | remote_state [kDaikin2StateLength] |
The state of the IR remote. More... | |
Class for handling detailed Daikin 312-bit A/C messages. Code by crankyoldgit, Reverse engineering analysis by sheppy99.
|
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 | ( | ) |
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 | ( | ) |
Disable the Off timer.
void IRDaikin2::disableOnTimer | ( | ) |
Disable the On timer.
void IRDaikin2::disableSleepTimer | ( | ) |
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 | ( | ) |
Get the Beep status of the A/C.
bool IRDaikin2::getClean | ( | ) |
Get the Auto Clean mode status of the A/C.
uint16_t IRDaikin2::getCurrentTime | ( | ) |
Get the clock time to be sent to the A/C unit.
bool IRDaikin2::getEcono | ( | ) |
Get the Economical mode of the A/C.
bool IRDaikin2::getEye | ( | ) |
Get the Eye (Sensor) mode status of the A/C.
bool IRDaikin2::getEyeAuto | ( | ) |
Get the Automaitc Eye (Sensor) mode status of the A/C.
uint8_t IRDaikin2::getFan | ( | ) |
Get the current fan speed setting.
bool IRDaikin2::getFreshAir | ( | ) |
Get the Fresh Air mode status of the A/C.
bool IRDaikin2::getFreshAirHigh | ( | ) |
Get the (High) Fresh Air mode status of the A/C.
uint8_t IRDaikin2::getLight | ( | ) |
Get the Light status of the A/C.
uint8_t IRDaikin2::getMode | ( | ) |
Get the operating mode setting of the A/C.
bool IRDaikin2::getMold | ( | ) |
Get the Mould (filter) mode status of the A/C.
uint16_t IRDaikin2::getOffTime | ( | ) |
Get the Off Timer time to be sent to the A/C unit.
bool IRDaikin2::getOffTimerEnabled | ( | ) |
Get the enable status of the Off Timer.
uint16_t IRDaikin2::getOnTime | ( | ) |
Get the On Timer time to be sent to the A/C unit.
bool IRDaikin2::getOnTimerEnabled | ( | ) |
Get the enable status of the On Timer.
bool IRDaikin2::getPower | ( | ) |
Get the value of the current power setting.
bool IRDaikin2::getPowerful | ( | ) |
Get the Powerful (Turbo) mode of the A/C.
bool IRDaikin2::getPurify | ( | ) |
Get the Purify (Filter) mode status of the A/C.
bool IRDaikin2::getQuiet | ( | ) |
Get the Quiet mode status of the A/C.
uint8_t * IRDaikin2::getRaw | ( | ) |
Get a PTR to the internal state/code for this protocol.
uint16_t IRDaikin2::getSleepTime | ( | ) |
Get the Sleep Timer time to be sent to the A/C unit.
bool IRDaikin2::getSleepTimerEnabled | ( | ) |
Get the Sleep timer enabled status of the A/C.
uint8_t IRDaikin2::getSwingHorizontal | ( | ) |
Get the Horizontal Swing mode of the A/C.
uint8_t IRDaikin2::getSwingVertical | ( | ) |
Get the Vertical Swing mode of the A/C.
uint8_t IRDaikin2::getTemp | ( | ) |
Get the current temperature setting.
void IRDaikin2::off | ( | ) |
Change the power setting to Off.
void IRDaikin2::on | ( | ) |
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 | ) |
Convert the current internal state into its stdAc::state_t equivilant.
|
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 | ( | ) |
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 |
instance of the IR send class
|
private |
The state of the IR remote.