IRremoteESP8266
|
Class for handling detailed TCL A/C messages. More...
#include <ir_Tcl.h>
Public Member Functions | |
IRTcl112Ac (const uint16_t pin, const bool inverted=false, const bool use_modulation=true) | |
Class constructor. More... | |
void | send (const uint16_t repeat=kTcl112AcDefaultRepeat) |
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 | stateReset (void) |
Reset the internal state of the emulation. (On, Cool, 24C) More... | |
uint8_t * | getRaw (void) |
Get a PTR to the internal state/code for this protocol. More... | |
void | setRaw (const uint8_t new_code[], const uint16_t length=kTcl112AcStateLength) |
Set the internal state from a valid code for this protocol. 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) |
Get the value of the current power setting. More... | |
void | setTemp (const float celsius) |
Set the temperature. More... | |
float | getTemp (void) |
Get the current temperature setting. More... | |
void | setMode (const uint8_t mode) |
Set the operating mode of the A/C. More... | |
uint8_t | getMode (void) |
Get the operating mode setting of the A/C. More... | |
void | setFan (const uint8_t speed) |
Set the speed of the fan. More... | |
uint8_t | getFan (void) |
Get the current fan speed setting. More... | |
void | setEcono (const bool on) |
Set the economy setting of the A/C. More... | |
bool | getEcono (void) |
Get the economy setting of the A/C. More... | |
void | setHealth (const bool on) |
Set the Health (Filter) setting of the A/C. More... | |
bool | getHealth (void) |
Get the Health (Filter) setting of the A/C. More... | |
void | setLight (const bool on) |
Set the Light (LED/Display) setting of the A/C. More... | |
bool | getLight (void) |
Get the Light (LED/Display) setting of the A/C. More... | |
void | setSwingHorizontal (const bool on) |
Set the horizontal swing setting of the A/C. More... | |
bool | getSwingHorizontal (void) |
Get the horizontal swing setting of the A/C. More... | |
void | setSwingVertical (const bool on) |
Set the vertical swing setting of the A/C. More... | |
bool | getSwingVertical (void) |
Get the vertical swing setting of the A/C. More... | |
void | setTurbo (const bool on) |
Set the Turbo setting of the A/C. More... | |
bool | getTurbo (void) |
Get the Turbo setting of the A/C. More... | |
uint8_t | convertMode (const stdAc::opmode_t mode) |
Convert a stdAc::opmode_t enum into its native mode. More... | |
uint8_t | convertFan (const stdAc::fanspeed_t speed) |
Convert a stdAc::fanspeed_t enum into it's native speed. More... | |
stdAc::state_t | toCommon (void) |
Convert the current internal state into its stdAc::state_t equivalent. More... | |
String | toString (void) |
Convert the current internal state into a human readable string. More... | |
Static Public Member Functions | |
static uint8_t | calcChecksum (uint8_t state[], const uint16_t length=kTcl112AcStateLength) |
Calculate the checksum for a given state. More... | |
static bool | validChecksum (uint8_t state[], const uint16_t length=kTcl112AcStateLength) |
Verify the checksum is valid for a given state. 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 (const uint16_t length=kTcl112AcStateLength) |
Calculate & set the checksum for the current internal state of the remote. More... | |
Private Attributes | |
IRsend | _irsend |
Instance of the IR send class. More... | |
uint8_t | remote_state [kTcl112AcStateLength] |
The State in IR code form. More... | |
Class for handling detailed TCL 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 IRTcl112Ac::begin | ( | void | ) |
Set up hardware to be able to send a message.
|
static |
Calculate the checksum for a given state.
[in] | state | The array to calc the checksum of. |
[in] | length | The length/size of the array. |
|
inline |
Run the calibration to calculate uSec timing offsets for this platform.
|
private |
Calculate & set the checksum for the current internal state of the remote.
[in] | length | The length/size of the internal array to checksum. |
uint8_t IRTcl112Ac::convertFan | ( | const stdAc::fanspeed_t | speed | ) |
Convert a stdAc::fanspeed_t enum into it's native speed.
[in] | speed | The enum to be converted. |
uint8_t IRTcl112Ac::convertMode | ( | const stdAc::opmode_t | mode | ) |
Convert a stdAc::opmode_t enum into its native mode.
[in] | mode | The enum to be converted. |
bool IRTcl112Ac::getEcono | ( | void | ) |
Get the economy setting of the A/C.
uint8_t IRTcl112Ac::getFan | ( | void | ) |
Get the current fan speed setting.
bool IRTcl112Ac::getHealth | ( | void | ) |
Get the Health (Filter) setting of the A/C.
bool IRTcl112Ac::getLight | ( | void | ) |
Get the Light (LED/Display) setting of the A/C.
uint8_t IRTcl112Ac::getMode | ( | void | ) |
Get the operating mode setting of the A/C.
bool IRTcl112Ac::getPower | ( | void | ) |
Get the value of the current power setting.
uint8_t * IRTcl112Ac::getRaw | ( | void | ) |
Get a PTR to the internal state/code for this protocol.
bool IRTcl112Ac::getSwingHorizontal | ( | void | ) |
Get the horizontal swing setting of the A/C.
bool IRTcl112Ac::getSwingVertical | ( | void | ) |
Get the vertical swing setting of the A/C.
float IRTcl112Ac::getTemp | ( | void | ) |
Get the current temperature setting.
bool IRTcl112Ac::getTurbo | ( | void | ) |
Get the Turbo setting of the A/C.
void IRTcl112Ac::off | ( | void | ) |
Set the requested power state of the A/C to off.
void IRTcl112Ac::on | ( | void | ) |
Set the requested power state of the A/C to on.
void IRTcl112Ac::send | ( | const uint16_t | repeat = kTcl112AcDefaultRepeat | ) |
Send the current internal state as an IR message.
[in] | repeat | Nr. of times the message will be repeated. |
void IRTcl112Ac::setEcono | ( | const bool | on | ) |
Set the economy setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRTcl112Ac::setFan | ( | const uint8_t | speed | ) |
Set the speed of the fan.
[in] | speed | The desired setting. |
void IRTcl112Ac::setHealth | ( | const bool | on | ) |
Set the Health (Filter) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRTcl112Ac::setLight | ( | const bool | on | ) |
Set the Light (LED/Display) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRTcl112Ac::setMode | ( | const uint8_t | mode | ) |
Set the operating mode of the A/C.
[in] | mode | The desired operating mode. |
void IRTcl112Ac::setPower | ( | const bool | on | ) |
Change the power setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRTcl112Ac::setRaw | ( | const uint8_t | new_code[], |
const uint16_t | length = kTcl112AcStateLength |
||
) |
Set the internal state from a valid code for this protocol.
[in] | new_code | A valid code for this protocol. |
[in] | length | The length/size of the new_code array. |
void IRTcl112Ac::setSwingHorizontal | ( | const bool | on | ) |
Set the horizontal swing setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRTcl112Ac::setSwingVertical | ( | const bool | on | ) |
Set the vertical swing setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRTcl112Ac::setTemp | ( | const float | celsius | ) |
Set the temperature.
[in] | celsius | The temperature in degrees celsius. |
void IRTcl112Ac::setTurbo | ( | const bool | on | ) |
Set the Turbo setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRTcl112Ac::stateReset | ( | void | ) |
Reset the internal state of the emulation. (On, Cool, 24C)
stdAc::state_t IRTcl112Ac::toCommon | ( | void | ) |
Convert the current internal state into its stdAc::state_t equivalent.
|
static |
|
static |
String IRTcl112Ac::toString | ( | void | ) |
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/size of the array. |
|
private |
Instance of the IR send class.
|
private |
The State in IR code form.