|
IRremoteIDF
Infrared send & receive for ESP-IDF
|
Class for handling detailed Daikin 312-bit A/C messages. More...
#include <ir_Daikin.h>

Public Member Functions | |
| IRDaikin312 (const uint16_t pin, const bool inverted=false, const bool use_modulation=true) | |
| Class constructor. | |
| void | send (const uint16_t repeat=kDaikin312DefaultRepeat) |
| Send the current internal state as an IR message. | |
| int8_t | calibrate (void) |
| Run the calibration to calculate uSec timing offsets for this platform. | |
| void | begin (void) |
| Set up hardware to be able to send a message. | |
| void | on (void) |
| Change the power setting to On. | |
| void | off (void) |
| Change the power setting to Off. | |
| void | setPower (const bool state) |
| Change the power setting. | |
| bool | getPower (void) const |
| Get the value of the current power setting. | |
| void | setTemp (const float temp) |
| Set the temperature. | |
| float | getTemp (void) const |
| Get the current temperature setting. | |
| void | setFan (const uint8_t fan) |
| Set the speed of the fan. | |
| uint8_t | getFan (void) const |
| Get the current fan speed setting. | |
| uint8_t | getMode (void) const |
| Get the operating mode setting of the A/C. | |
| void | setMode (const uint8_t mode) |
| Set the operating mode of the A/C. | |
| void | setSwingVertical (const uint8_t position) |
| Set the Vertical Swing mode of the A/C. | |
| uint8_t | getSwingVertical (void) const |
| Get the Vertical Swing mode of the A/C. | |
| void | setSwingHorizontal (const uint8_t position) |
| Set the Horizontal Swing mode of the A/C. | |
| uint8_t | getSwingHorizontal (void) const |
| Get the Horizontal Swing mode of the A/C. | |
| bool | getQuiet (void) const |
| Get the Quiet mode status of the A/C. | |
| void | setQuiet (const bool on) |
| Set the Quiet mode of the A/C. | |
| bool | getPowerful (void) const |
| Get the Powerful (Turbo) mode of the A/C. | |
| void | setPowerful (const bool on) |
| Set the Powerful (Turbo) mode of the A/C. | |
| void | setEcono (const bool on) |
| Set the Economy mode of the A/C. | |
| bool | getEcono (void) const |
| Get the Economical mode of the A/C. | |
| void | setEye (const bool on) |
| Set the Eye (Sensor) mode of the A/C. | |
| bool | getEye (void) const |
| Get the Eye (Sensor) mode status of the A/C. | |
| void | setEyeAuto (const bool on) |
| Set the Automatic Eye (Sensor) mode of the A/C. | |
| bool | getEyeAuto (void) const |
| Get the Automatic Eye (Sensor) mode status of the A/C. | |
| void | setEyeTimer (const uint8_t duration) |
| Set the Eye (Sensor) timer duration of the A/C. | |
| uint8_t | getEyeTimer (void) const |
| Get the Eye (Sensor) timer duration of the A/C. | |
| void | setPurify (const bool on) |
| Set the Purify (Filter) mode of the A/C. | |
| bool | getPurify (void) const |
| Get the Purify (Filter) mode status of the A/C. | |
| void | setMold (const bool on) |
| Set the Mould (filter) mode of the A/C. | |
| bool | getMold (void) const |
| Get the Mould (filter) mode status of the A/C. | |
| void | enableOnTimer (const uint16_t starttime) |
| Set the enable status & time of the On Timer. | |
| void | disableOnTimer (void) |
| Disable the On timer. | |
| uint16_t | getOnTime (void) const |
| Get the On Timer time to be sent to the A/C unit. | |
| bool | getOnTimerEnabled (void) const |
| Get the enable status of the On Timer. | |
| void | enableSleepTimer (const uint16_t sleeptime) |
| Set the enable status & time of the Sleep Timer. | |
| void | disableSleepTimer (void) |
| Disable the sleep timer. | |
| uint16_t | getSleepTime (void) const |
| Get the Sleep Timer time to be sent to the A/C unit. | |
| bool | getSleepTimerEnabled (void) const |
| Get the Sleep timer enabled status of the A/C. | |
| void | enableOffTimer (const uint16_t endtime) |
| Set the enable status & time of the Off Timer. | |
| void | disableOffTimer (void) |
| Disable the Off timer. | |
| uint16_t | getOffTime (void) const |
| Get the Off Timer time to be sent to the A/C unit. | |
| bool | getOffTimerEnabled (void) const |
| Get the enable status of the Off Timer. | |
| void | setCurrentTime (const uint16_t time) |
| Set the clock on the A/C unit. | |
| uint16_t | getCurrentTime (void) const |
| Get the clock time to be sent to the A/C unit. | |
| void | setBeep (const uint8_t beep) |
| Set the Beep mode of the A/C. | |
| uint8_t | getBeep (void) const |
| Get the Beep status of the A/C. | |
| void | setLight (const uint8_t light) |
| Set the Light (LED) mode of the A/C. | |
| uint8_t | getLight (void) const |
| Get the Light status of the A/C. | |
| void | setAnnounce (const uint8_t category) |
| Set the verbal announcement item. The AC uses this to decide what state update to read aloud after receiving a command. Note that you will not hear the announcement if setBeep is set to kDaikinBeepOff. Additionally, the AC does not announce the mode (e.g., cool, heat) and simply beeps if it didn't change. Invalid item (e.g., kDaikin312AnnouncePower for operations other than powering off) will be ignored (AC simply beeps). | |
| uint8_t | getAnnounce (void) const |
| Get the current announce category. | |
| void | setClean (const bool on) |
| Set the Auto clean mode of the A/C. | |
| bool | getClean (void) const |
| Get the Auto Clean mode status of the A/C. | |
| void | setFreshAir (const bool on) |
| Set the Fresh Air mode of the A/C. | |
| bool | getFreshAir (void) const |
| Get the Fresh Air mode status of the A/C. | |
| void | setFreshAirHigh (const bool on) |
| Set the (High) Fresh Air mode of the A/C. | |
| bool | getFreshAirHigh (void) const |
| Get the (High) Fresh Air mode status of the A/C. | |
| uint8_t | getHumidity (void) const |
| Get the Humidity percentage setting of the A/C. | |
| void | setHumidity (const uint8_t percent) |
| Set the Humidity percentage setting of the A/C. | |
| uint8_t * | getRaw (void) |
| Get a PTR to the internal state/code for this protocol. | |
| void | setRaw (const uint8_t new_code[]) |
| Set the internal state from a valid code for this protocol. | |
| stdAc::state_t | toCommon (void) const |
| Convert the current internal state into its stdAc::state_t equivalent. | |
| String | toString (void) const |
| Convert the current internal state into a human readable string. | |
Static Public Member Functions | |
| static bool | validChecksum (uint8_t state[], const uint16_t length=kDaikin312StateLength) |
| Verify the checksum is valid for a given state. | |
| static uint8_t | convertMode (const stdAc::opmode_t mode) |
| Convert a stdAc::opmode_t enum into its native mode. | |
| static uint8_t | convertFan (const stdAc::fanspeed_t speed) |
| Convert a stdAc::fanspeed_t enum into it's native speed. | |
| static uint8_t | convertSwingV (const stdAc::swingv_t position) |
| Convert a stdAc::swingv_t enum into it's native setting. | |
| static uint8_t | convertSwingH (const stdAc::swingh_t position) |
| Convert a stdAc::swingh_t enum into it's native setting. | |
| static stdAc::swingv_t | toCommonSwingV (const uint8_t setting) |
| Convert a native vertical swing postion to it's common equivalent. | |
| static stdAc::swingh_t | toCommonSwingH (const uint8_t setting) |
| Convert a native horizontal swing postion to it's common equivalent. | |
Private Member Functions | |
| void | stateReset (void) |
| Reset the internal state to a fixed known good state. | |
| void | checksum (void) |
| Calculate and set the checksum values for the internal state. | |
| void | clearOnTimerFlag (void) |
| Clear the On Timer flag. | |
| void | clearSleepTimerFlag (void) |
| Clear the sleep timer flag. | |
Private Attributes | |
| IRsend | _irsend |
| instance of the IR send class | |
| Daikin312Protocol | _ |
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 IRDaikin312::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 IRDaikin312::disableOffTimer | ( | void | ) |
Disable the Off timer.
| void IRDaikin312::disableOnTimer | ( | void | ) |
Disable the On timer.
| void IRDaikin312::disableSleepTimer | ( | void | ) |
Disable the sleep timer.
| void IRDaikin312::enableOffTimer | ( | const uint16_t | endtime | ) |
Set the enable status & time of the Off Timer.
| [in] | endtime | The number of minutes past midnight. |
| void IRDaikin312::enableOnTimer | ( | const uint16_t | starttime | ) |
Set the enable status & time of the On Timer.
| [in] | starttime | The number of minutes past midnight. |
| void IRDaikin312::enableSleepTimer | ( | const uint16_t | sleeptime | ) |
Set the enable status & time of the Sleep Timer.
| [in] | sleeptime | The number of minutes past midnight. |
| uint8_t IRDaikin312::getAnnounce | ( | void | ) | const |
Get the current announce category.
| uint8_t IRDaikin312::getBeep | ( | void | ) | const |
Get the Beep status of the A/C.
| bool IRDaikin312::getClean | ( | void | ) | const |
Get the Auto Clean mode status of the A/C.
| uint16_t IRDaikin312::getCurrentTime | ( | void | ) | const |
Get the clock time to be sent to the A/C unit.
| bool IRDaikin312::getEcono | ( | void | ) | const |
Get the Economical mode of the A/C.
| bool IRDaikin312::getEye | ( | void | ) | const |
Get the Eye (Sensor) mode status of the A/C.
| bool IRDaikin312::getEyeAuto | ( | void | ) | const |
Get the Automatic Eye (Sensor) mode status of the A/C.
| uint8_t IRDaikin312::getEyeTimer | ( | void | ) | const |
Get the Eye (Sensor) timer duration of the A/C.
| uint8_t IRDaikin312::getFan | ( | void | ) | const |
Get the current fan speed setting.
| bool IRDaikin312::getFreshAir | ( | void | ) | const |
Get the Fresh Air mode status of the A/C.
| bool IRDaikin312::getFreshAirHigh | ( | void | ) | const |
Get the (High) Fresh Air mode status of the A/C.
| uint8_t IRDaikin312::getHumidity | ( | void | ) | const |
Get the Humidity percentage setting of the A/C.
| uint8_t IRDaikin312::getLight | ( | void | ) | const |
Get the Light status of the A/C.
| uint8_t IRDaikin312::getMode | ( | void | ) | const |
Get the operating mode setting of the A/C.
| bool IRDaikin312::getMold | ( | void | ) | const |
Get the Mould (filter) mode status of the A/C.
| uint16_t IRDaikin312::getOffTime | ( | void | ) | const |
Get the Off Timer time to be sent to the A/C unit.
| bool IRDaikin312::getOffTimerEnabled | ( | void | ) | const |
Get the enable status of the Off Timer.
| uint16_t IRDaikin312::getOnTime | ( | void | ) | const |
Get the On Timer time to be sent to the A/C unit.
| bool IRDaikin312::getOnTimerEnabled | ( | void | ) | const |
Get the enable status of the On Timer.
| bool IRDaikin312::getPower | ( | void | ) | const |
Get the value of the current power setting.
| bool IRDaikin312::getPowerful | ( | void | ) | const |
Get the Powerful (Turbo) mode of the A/C.
| bool IRDaikin312::getPurify | ( | void | ) | const |
Get the Purify (Filter) mode status of the A/C.
| bool IRDaikin312::getQuiet | ( | void | ) | const |
Get the Quiet mode status of the A/C.
| uint8_t * IRDaikin312::getRaw | ( | void | ) |
Get a PTR to the internal state/code for this protocol.
| uint16_t IRDaikin312::getSleepTime | ( | void | ) | const |
Get the Sleep Timer time to be sent to the A/C unit.
| bool IRDaikin312::getSleepTimerEnabled | ( | void | ) | const |
Get the Sleep timer enabled status of the A/C.
| uint8_t IRDaikin312::getSwingHorizontal | ( | void | ) | const |
Get the Horizontal Swing mode of the A/C.
| uint8_t IRDaikin312::getSwingVertical | ( | void | ) | const |
Get the Vertical Swing mode of the A/C.
| float IRDaikin312::getTemp | ( | void | ) | const |
Get the current temperature setting.
| void IRDaikin312::off | ( | void | ) |
Change the power setting to Off.
| void IRDaikin312::on | ( | void | ) |
Change the power setting to On.
| void IRDaikin312::send | ( | const uint16_t | repeat = kDaikin312DefaultRepeat | ) |
Send the current internal state as an IR message.
| [in] | repeat | Nr. of times the message will be repeated. |
| void IRDaikin312::setAnnounce | ( | const uint8_t | item | ) |
Set the verbal announcement item. The AC uses this to decide what state update to read aloud after receiving a command. Note that you will not hear the announcement if setBeep is set to kDaikinBeepOff. Additionally, the AC does not announce the mode (e.g., cool, heat) and simply beeps if it didn't change. Invalid item (e.g., kDaikin312AnnouncePower for operations other than powering off) will be ignored (AC simply beeps).
| [in] | item | A kDaikin312Announce* constant. kDaikin312AnnounceDisable disables the announcement. |
| void IRDaikin312::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 IRDaikin312::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 IRDaikin312::setCurrentTime | ( | const uint16_t | numMins | ) |
Set the clock on the A/C unit.
| [in] | numMins | Nr. of minutes past midnight. |
| void IRDaikin312::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 IRDaikin312::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 IRDaikin312::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 IRDaikin312::setEyeTimer | ( | const uint8_t | duration | ) |
Set the Eye (Sensor) timer duration of the A/C.
| [in] | duration | kDaikin312EyeTimerOff, kDaikin312EyeTimer1Hr, or kDaikin312EyeTimer3Hr. |
| void IRDaikin312::setFan | ( | const uint8_t | fan | ) |
Set the speed of the fan.
| [in] | fan | The desired setting. |
| void IRDaikin312::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 IRDaikin312::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 IRDaikin312::setHumidity | ( | const uint8_t | percent | ) |
Set the Humidity percentage setting of the A/C.
| [in] | percent | Percentage humidty. 255 is Auto. 0 is Off. |
| void IRDaikin312::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 IRDaikin312::setMode | ( | const uint8_t | desired_mode | ) |
Set the operating mode of the A/C.
| [in] | desired_mode | The desired operating mode. |
| void IRDaikin312::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 IRDaikin312::setPower | ( | const bool | on | ) |
Change the power setting.
| [in] | on | true, the setting is on. false, the setting is off. |
| void IRDaikin312::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 IRDaikin312::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 IRDaikin312::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 IRDaikin312::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 IRDaikin312::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 IRDaikin312::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 IRDaikin312::setTemp | ( | const float | 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 IRDaikin312::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 IRDaikin312::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