Go to the documentation of this file.
18 #define __STDC_LIMIT_MACROS
26 #include "IRsend_test.h"
109 explicit IRCoronaAc(
const uint16_t pin,
const bool inverted =
false,
110 const bool use_modulation =
true);
120 #endif // SEND_CORONA_AC
122 static bool validSection(
const uint8_t state[],
const uint16_t pos,
123 const uint8_t section);
129 void setTemp(
const uint8_t temp);
133 void setFan(
const uint8_t speed);
134 uint8_t
getFan(
void)
const;
135 void setMode(
const uint8_t mode);
144 void setRaw(
const uint8_t new_code[],
163 static void checksum(uint8_t* data);
165 void _setTimer(
const uint8_t section,
const uint16_t nr_of_mins);
166 uint16_t
_getTimer(
const uint8_t section)
const;
168 #endif // IR_CORONA_H_
uint8_t Header1
Definition: ir_Corona.h:32
const uint8_t kCoronaAcSectionBytes
Definition: ir_Corona.h:74
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Corona.cpp:346
void setFan(const uint8_t speed)
Set the operating speed of the A/C Fan.
Definition: ir_Corona.cpp:398
void setEcono(const bool on)
Change the powersave setting.
Definition: ir_Corona.cpp:407
void setRaw(const uint8_t new_code[], const uint16_t length=kCoronaAcStateLength)
Set the internal state from a valid code for this protocol.
Definition: ir_Corona.cpp:282
const uint8_t kCoronaAcSectionLabelBase
Definition: ir_Corona.h:77
const uint8_t kCoronaAcModeFan
Definition: ir_Corona.h:94
uint8_t Data1Inv
Definition: ir_Corona.h:37
void setPowerButton(const bool on)
Change the power button setting.
Definition: ir_Corona.cpp:328
Class for handling detailed Corona A/C messages.
Definition: ir_Corona.h:107
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:61
const uint8_t kCoronaAcModeDry
Definition: ir_Corona.h:92
const uint8_t kCoronaAcSectionData0Base
Definition: ir_Corona.h:78
uint8_t Power
Definition: ir_Corona.h:65
uint16_t getOffTimer(void) const
Get the current Off Timer time.
Definition: ir_Corona.cpp:511
void setPower(const bool on)
Change the power setting. (in practice Standby, remote power)
Definition: ir_Corona.cpp:304
void stateReset()
Reset the internal state to a fixed known good state.
Definition: ir_Corona.cpp:154
uint8_t getFan(void) const
Get the operating speed of the A/C Fan.
Definition: ir_Corona.cpp:392
stdAc::state_t toCommon(void) const
Convert the A/C state to it's common stdAc::state_t equivalent.
Definition: ir_Corona.cpp:552
void begin()
Set up hardware to be able to send a message.
Definition: ir_Corona.cpp:252
const uint8_t kCoronaAcFanMedium
Definition: ir_Corona.h:82
const uint16_t kCoronaAcTimerUnitsPerMin
Definition: ir_Corona.h:102
void setOffTimer(const uint16_t nr_of_mins)
Set the Off Timer time.
Definition: ir_Corona.cpp:518
const uint8_t kCoronaAcFanLow
Definition: ir_Corona.h:81
Native representation of a Corona A/C message.
Definition: ir_Corona.h:43
uint8_t Header0
Definition: ir_Corona.h:31
void setTemp(const uint8_t temp)
Set the temp in deg C.
Definition: ir_Corona.cpp:288
String toString(void) const
Convert the internal state into a human readable string.
Definition: ir_Corona.cpp:527
const uint8_t kCoronaAcSectionHeader0
Definition: ir_Corona.h:75
void setOnTimer(const uint16_t nr_of_mins)
Set the On Timer time.
Definition: ir_Corona.cpp:502
Class for sending all basic IR protocols.
Definition: IRsend.h:237
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a standard A/C Fan speed into its native fan speed.
Definition: ir_Corona.cpp:420
CoronaProtocol _
Definition: ir_Corona.h:161
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
uint8_t Econo
Definition: ir_Corona.h:56
std::string String
Definition: IRremoteESP8266.h:1521
const uint8_t kCoronaAcOffTimerSection
Definition: ir_Corona.h:98
const uint16_t kCoronaAcTimerMax
Definition: ir_Corona.h:99
static bool validSection(const uint8_t state[], const uint16_t pos, const uint8_t section)
Check that a CoronaAc Section part is valid with section byte and inverted.
Definition: ir_Corona.cpp:187
uint16_t getOnTimer(void) const
Get the current On Timer time.
Definition: ir_Corona.cpp:495
bool getPower(void) const
Get the current power setting. (in practice Standby, remote power)
Definition: ir_Corona.cpp:315
const uint8_t kCoronaAcSectionHeader1
Definition: ir_Corona.h:76
void send(const uint16_t repeat=kNoRepeat)
Send the current internal state as an IR message.
Definition: ir_Corona.cpp:257
const uint8_t kCoronaAcSections
Definition: ir_Corona.h:40
uint16_t _getTimer(const uint8_t section) const
Get the current Timer time.
Definition: ir_Corona.cpp:482
const uint16_t kNoRepeat
Definition: IRremoteESP8266.h:1145
const uint8_t kCoronaAcFanHigh
Definition: ir_Corona.h:83
const uint16_t kCoronaAcStateLength
Definition: IRremoteESP8266.h:1186
static void checksum(uint8_t *data)
Calculate and set the check values for the internal state.
Definition: ir_Corona.cpp:240
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a standard A/C mode into its native mode.
Definition: ir_Corona.cpp:369
uint8_t Data0
Definition: ir_Corona.h:34
uint8_t PowerButton
Definition: ir_Corona.h:66
bool getPowerButton(void) const
Get the value of the current power button setting.
Definition: ir_Corona.cpp:334
void off(void)
Change the power setting to Off.
Definition: ir_Corona.cpp:342
void _setTimer(const uint8_t section, const uint16_t nr_of_mins)
Set the Timer time.
Definition: ir_Corona.cpp:462
const uint8_t kCoronaAcModeCool
Definition: ir_Corona.h:93
const uint8_t kCoronaAcMinTemp
Definition: ir_Corona.h:89
uint8_t Data1
Definition: ir_Corona.h:36
uint8_t Temp
Definition: ir_Corona.h:64
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode to it's common stdAc::opmode_t equivalent.
Definition: ir_Corona.cpp:381
uint8_t getTemp(void) const
Get the current temperature from the internal state.
Definition: ir_Corona.cpp:296
bool getSwingVToggle(void) const
Get the Vertical Swing toggle setting.
Definition: ir_Corona.cpp:453
IRCoronaAc(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor for handling detailed Corona A/C messages.
Definition: ir_Corona.cpp:148
uint8_t Data0Inv
Definition: ir_Corona.h:35
uint8_t * getRaw()
Get a copy of the internal state as a valid code for this protocol.
Definition: ir_Corona.cpp:274
void on(void)
Change the power setting to On.
Definition: ir_Corona.cpp:339
const uint8_t kCoronaAcSettingsSection
Definition: ir_Corona.h:96
uint8_t SwingVToggle
Definition: ir_Corona.h:59
uint8_t raw[kCoronaAcStateLength]
The state of the IR remote.
Definition: ir_Corona.h:44
CoronaSection sections[kCoronaAcSections]
Definition: ir_Corona.h:45
const uint8_t kCoronaAcModeHeat
Definition: ir_Corona.h:91
uint8_t Label
Definition: ir_Corona.h:33
IRsend _irsend
Instance of the IR send class.
Definition: ir_Corona.h:155
void setSwingVToggle(const bool on)
Set the Vertical Swing toggle setting.
Definition: ir_Corona.cpp:447
static uint8_t getSectionByte(const uint8_t section)
Get the byte that identifies the section.
Definition: ir_Corona.cpp:171
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Corona.cpp:352
Native representation of a section of a Corona A/C message.
Definition: ir_Corona.h:30
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed to it's common equivalent.
Definition: ir_Corona.cpp:434
bool getEcono(void) const
Get the value of the current powersave setting.
Definition: ir_Corona.cpp:413
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Corona.h:119
const uint16_t kCoronaAcTimerOff
Definition: ir_Corona.h:101
uint8_t Mode
Definition: ir_Corona.h:67
const uint8_t kCoronaAcOnTimerSection
Definition: ir_Corona.h:97
uint8_t Fan
Definition: ir_Corona.h:54
Structure to hold a common A/C state.
Definition: IRsend.h:114
const uint8_t kCoronaAcMaxTemp
Definition: ir_Corona.h:90
const uint8_t kCoronaAcFanAuto
Definition: ir_Corona.h:80
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:49