Go to the documentation of this file.
25 #include "IRsend_test.h"
127 explicit IRTcl112Ac(
const uint16_t pin,
const bool inverted =
false,
128 const bool use_modulation =
true);
140 void setRaw(
const uint8_t new_code[],
148 void setTemp(
const float celsius);
150 void setMode(
const uint8_t mode);
156 void setFan(
const uint8_t speed);
157 uint8_t
getFan(
void)
const;
171 bool getQuiet(
const bool def =
false)
const;
176 static bool isTcl(
const uint8_t state[]);
Tcl112Protocol _
Definition: ir_Tcl.h:194
void setSwingHorizontal(const bool on)
Set the horizontal swing setting of the A/C.
Definition: ir_Tcl.cpp:288
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Tcl.cpp:391
static uint8_t calcChecksum(uint8_t state[], const uint16_t length=kTcl112AcStateLength)
Calculate the checksum for a given state.
Definition: ir_Tcl.cpp:101
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Tcl.cpp:195
const float kTcl112AcTempMin
Definition: ir_Tcl.h:110
swingv_t
Common A/C settings for Vertical Swing.
Definition: IRsend.h:74
static uint8_t convertSwingV(const stdAc::swingv_t position)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Tcl.cpp:418
const uint16_t kTcl112AcHdrSpace
Definition: ir_Tcl.h:86
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Tcl.cpp:378
uint8_t SwingH
Definition: ir_Tcl.h:74
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:61
uint16_t getOffTimer(void) const
Get how long the Off Timer is set for, in minutes.
Definition: ir_Tcl.cpp:362
void setOffTimer(const uint16_t mins)
Set or cancel the Off Timer function.
Definition: ir_Tcl.cpp:369
const uint32_t kDefaultMessageGap
Definition: IRsend.h:41
static bool isTcl(const uint8_t state[])
Check the supplied state looks like a TCL112AC message.
Definition: ir_Tcl.cpp:134
const uint8_t kTcl112AcFanQuiet
Definition: ir_Tcl.h:107
tcl_ac_remote_model_t
TCL (& Teknopoint) A/C model numbers.
Definition: IRsend.h:199
const uint8_t kTcl112AcFanLow
Definition: ir_Tcl.h:103
void send(const uint16_t repeat=kTcl112AcDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Tcl.cpp:70
uint8_t Quiet
Definition: ir_Tcl.h:46
const uint16_t kTcl112AcBitMark
Definition: ir_Tcl.h:87
bool getEcono(void) const
Get the economy setting of the A/C.
Definition: ir_Tcl.cpp:268
const uint8_t kTcl112AcSpecial
Definition: ir_Tcl.h:121
bool _quiet_prev
Definition: ir_Tcl.h:195
const uint8_t kTcl112AcSwingVMiddle
Definition: ir_Tcl.h:115
const uint8_t kTcl112AcFanMed
Definition: ir_Tcl.h:104
uint8_t isTcl
Definition: ir_Tcl.h:78
uint8_t Temp
Definition: ir_Tcl.h:55
bool getSwingHorizontal(void) const
Get the horizontal swing setting of the A/C.
Definition: ir_Tcl.cpp:292
bool getQuiet(const bool def=false) const
Get the Quiet setting of the A/C.
Definition: ir_Tcl.cpp:338
const uint8_t kTcl112AcSwingVLowest
Definition: ir_Tcl.h:117
float getTemp(void) const
Get the current temperature setting.
Definition: ir_Tcl.cpp:235
Class for sending all basic IR protocols.
Definition: IRsend.h:237
void setEcono(const bool on)
Set the economy setting of the A/C.
Definition: ir_Tcl.cpp:264
const uint8_t kTcl112AcNormal
Definition: ir_Tcl.h:120
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
bool getHealth(void) const
Get the Health (Filter) setting of the A/C.
Definition: ir_Tcl.cpp:276
const uint16_t kTcl112AcOneSpace
Definition: ir_Tcl.h:88
std::string String
Definition: IRremoteESP8266.h:1521
void stateReset(void)
Reset the internal state of the emulation. (On, Cool, 24C)
Definition: ir_Tcl.cpp:141
bool _quiet_explictly_set
Definition: ir_Tcl.h:197
const uint8_t kTcl112AcSwingVHighest
Definition: ir_Tcl.h:113
Class for handling detailed TCL A/C messages.
Definition: ir_Tcl.h:125
void checksum(const uint16_t length=kTcl112AcStateLength)
Calculate & set the checksum for the current internal state of the remote.
Definition: ir_Tcl.cpp:115
uint8_t Turbo
Definition: ir_Tcl.h:52
uint8_t OnTimer
Definition: ir_Tcl.h:68
Native representation of a TCL 112 A/C message.
Definition: ir_Tcl.h:29
uint8_t HalfDegree
Definition: ir_Tcl.h:76
IRsend _irsend
Instance of the IR send class.
Definition: ir_Tcl.h:188
void setTemp(const float celsius)
Set the temperature.
Definition: ir_Tcl.cpp:221
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Tcl.cpp:167
void setLight(const bool on)
Set the Light (LED/Display) setting of the A/C.
Definition: ir_Tcl.cpp:280
void setPower(const bool on)
Change the power setting.
Definition: ir_Tcl.cpp:187
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Tcl.h:135
uint8_t Light
Definition: ir_Tcl.h:47
const uint32_t kTcl112AcGap
Definition: ir_Tcl.h:90
static bool validChecksum(uint8_t state[], const uint16_t length=kTcl112AcStateLength)
Verify the checksum is valid for a given state.
Definition: ir_Tcl.cpp:125
bool _quiet
Definition: ir_Tcl.h:196
uint8_t Fan
Definition: ir_Tcl.h:58
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Tcl.cpp:65
uint8_t Mode
Definition: ir_Tcl.h:50
void setOnTimer(const uint16_t mins)
Set or cancel the On Timer function.
Definition: ir_Tcl.cpp:354
const uint8_t kTcl112AcSwingVOn
Definition: ir_Tcl.h:118
const uint8_t kTcl112AcAuto
Definition: ir_Tcl.h:99
const uint16_t kTcl112AcDefaultRepeat
Definition: IRremoteESP8266.h:1394
uint8_t OnTimerEnabled
Definition: ir_Tcl.h:45
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Tcl.cpp:433
const float kTcl112AcTempMax
Definition: ir_Tcl.h:109
const uint16_t kTcl112AcHdrMark
Definition: ir_Tcl.h:85
bool getLight(void) const
Get the Light (LED/Display) setting of the A/C.
Definition: ir_Tcl.cpp:284
const uint8_t kTcl112AcFanNight
Definition: ir_Tcl.h:106
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Tcl.cpp:201
uint8_t OffTimerEnabled
Definition: ir_Tcl.h:44
const uint8_t kTcl112AcSwingVHigh
Definition: ir_Tcl.h:114
const uint8_t kTcl112AcFanAuto
Definition: ir_Tcl.h:101
void setQuiet(const bool on)
Set the Quiet setting of the A/C.
Definition: ir_Tcl.cpp:329
const uint8_t kTcl112AcCool
Definition: ir_Tcl.h:97
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Tcl.cpp:180
uint16_t getOnTimer(void) const
Get how long the On Timer is set for, in minutes.
Definition: ir_Tcl.cpp:347
uint8_t SwingV
Definition: ir_Tcl.h:59
const uint8_t kTcl112AcSwingVLow
Definition: ir_Tcl.h:116
uint8_t Health
Definition: ir_Tcl.h:51
tcl_ac_remote_model_t getModel(void) const
Get/Detect the model of the A/C.
Definition: ir_Tcl.cpp:154
uint8_t raw[kTcl112AcStateLength]
The State in IR code form.
Definition: ir_Tcl.h:30
void setHealth(const bool on)
Set the Health (Filter) setting of the A/C.
Definition: ir_Tcl.cpp:272
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Tcl.cpp:183
void setRaw(const uint8_t new_code[], const uint16_t length=kTcl112AcStateLength)
Set the internal state from a valid code for this protocol.
Definition: ir_Tcl.cpp:175
const uint8_t kTcl112AcSwingVOff
Definition: ir_Tcl.h:112
uint8_t Sum
Definition: ir_Tcl.h:80
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Tcl.cpp:244
uint8_t TimerIndicator
Definition: ir_Tcl.h:60
const uint8_t kTcl112AcHdrMarkTolerance
Definition: ir_Tcl.h:92
const uint8_t kTcl112AcDry
Definition: ir_Tcl.h:96
uint8_t MsgType
Definition: ir_Tcl.h:37
bool getTurbo(void) const
Get the Turbo setting of the A/C.
Definition: ir_Tcl.cpp:325
const uint8_t kTcl112AcFanHigh
Definition: ir_Tcl.h:105
const uint16_t kTcl112AcStateLength
Definition: IRremoteESP8266.h:1392
stdAc::state_t toCommon(const stdAc::state_t *prev=NULL) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Tcl.cpp:455
uint8_t getSwingVertical(void) const
Get the vertical swing setting of the A/C.
Definition: ir_Tcl.cpp:311
static stdAc::swingv_t toCommonSwingV(const uint8_t setting)
Convert a native vertical swing postion to it's common equivalent.
Definition: ir_Tcl.cpp:446
const uint8_t kTcl112AcFan
Definition: ir_Tcl.h:98
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Tcl.cpp:486
const uint16_t kTcl112AcZeroSpace
Definition: ir_Tcl.h:89
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Tcl.cpp:191
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Tcl.cpp:405
void setTurbo(const bool on)
Set the Turbo setting of the A/C.
Definition: ir_Tcl.cpp:315
void setModel(const tcl_ac_remote_model_t model)
Set the model of the A/C to emulate.
Definition: ir_Tcl.cpp:161
IRTcl112Ac(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Tcl.cpp:60
void setSwingVertical(const uint8_t setting)
Set the vertical swing setting of the A/C.
Definition: ir_Tcl.cpp:296
const uint8_t kTcl112AcTolerance
Definition: ir_Tcl.h:93
const uint8_t kTcl112AcHeat
Definition: ir_Tcl.h:95
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Tcl.cpp:260
Structure to hold a common A/C state.
Definition: IRsend.h:114
uint8_t OffTimer
Definition: ir_Tcl.h:64
uint8_t Econo
Definition: ir_Tcl.h:48
const uint8_t kTcl112AcFanMin
Definition: ir_Tcl.h:102
uint8_t Power
Definition: ir_Tcl.h:43
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:49