Go to the documentation of this file.
32 #include "IRsend_test.h"
115 explicit IRSharpAc(
const uint16_t pin,
const bool inverted =
false,
116 const bool use_modulation =
true);
124 #endif // SEND_SHARP_AC
130 void setPower(
const bool on,
const bool prev_on =
true);
133 void setTemp(
const uint8_t temp,
const bool save =
true);
135 void setFan(
const uint8_t fan,
const bool save =
true);
137 void setMode(
const uint8_t mode,
const bool save =
true);
154 void setTimer(
bool enable,
bool timer_type, uint16_t mins);
158 void setRaw(
const uint8_t new_code[],
193 #endif // IR_SHARP_H_
uint8_t getPowerSpecial(void)
Get the value of the Power Special setting.
Definition: ir_Sharp.cpp:351
const uint8_t kSharpAcTimerHoursSize
Definition: ir_Sharp.h:84
const uint8_t kSharpAcByteFan
Definition: ir_Sharp.h:70
const uint8_t kSharpAcFanSize
Definition: ir_Sharp.h:72
const uint8_t kSharpAcHeat
Definition: ir_Sharp.h:67
const uint8_t kSharpAcSpecialTempEcono
Definition: ir_Sharp.h:101
uint8_t getMode(void)
Get the operating mode setting of the A/C.
Definition: ir_Sharp.cpp:459
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Sharp.h:123
void setTimer(bool enable, bool timer_type, uint16_t mins)
Set or cancel the timer function.
Definition: ir_Sharp.cpp:644
bool isPowerSpecial(void)
Is one of the special power states in use?
Definition: ir_Sharp.cpp:364
void setTemp(const uint8_t temp, const bool save=true)
Set the temperature.
Definition: ir_Sharp.cpp:425
const uint8_t kSharpAcPowerOnFromOff
Definition: ir_Sharp.h:54
const uint8_t kSharpAcPowerSpecialSize
Definition: ir_Sharp.h:52
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Sharp.cpp:377
const uint16_t kSharpAcOneSpace
Definition: ir_Sharp.h:41
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
uint8_t _temp
Saved copy of the desired temp.
Definition: ir_Sharp.h:178
const uint32_t kDefaultMessageGap
Definition: IRsend.h:41
static uint8_t calcChecksum(uint8_t state[], const uint16_t length=kSharpAcStateLength)
Calculate the checksum for a given state.
Definition: ir_Sharp.cpp:264
stdAc::state_t toCommon(void)
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Sharp.cpp:754
const uint8_t kSharpAcFanA705Low
Definition: ir_Sharp.h:76
bool getIon(void)
Get the Ion (Filter) setting of the A/C.
Definition: ir_Sharp.cpp:559
const uint8_t kSharpAcSpecialTimer
Definition: ir_Sharp.h:104
const uint8_t kSharpAcOnTimerType
Definition: ir_Sharp.h:89
uint8_t getFan(void)
Get the current fan speed setting.
Definition: ir_Sharp.cpp:520
const uint8_t kSharpAcCool
Definition: ir_Sharp.h:66
bool getPower(void)
Get the value of the current power setting.
Definition: ir_Sharp.cpp:392
const uint8_t kSharpAcSpecialFan
Definition: ir_Sharp.h:102
const uint8_t kSharpAcSpecialSwing
Definition: ir_Sharp.h:103
const uint8_t kSharpAcOffTimerType
Definition: ir_Sharp.h:88
Class for sending all basic IR protocols.
Definition: IRsend.h:182
const uint8_t kSharpAcMaxTemp
Definition: ir_Sharp.h:48
bool _getEconoToggle(void)
Get the Economical mode toggle setting of the A/C.
Definition: ir_Sharp.cpp:574
void setFan(const uint8_t fan, const bool save=true)
Set the speed of the fan.
Definition: ir_Sharp.cpp:499
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
sharp_ac_remote_model_t _model
Saved copy of the model.
Definition: ir_Sharp.h:181
IRSharpAc(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Sharp.cpp:245
const uint8_t kSharpAcSwingOffset
Definition: ir_Sharp.h:93
const uint16_t kSharpAcZeroSpace
Definition: ir_Sharp.h:40
void setPower(const bool on, const bool prev_on=true)
Change the power setting, including the previous power state.
Definition: ir_Sharp.cpp:382
const uint8_t kSharpAcDry
Definition: ir_Sharp.h:65
std::string String
Definition: IRremoteESP8266.h:1178
const uint8_t kNibbleSize
Definition: IRutils.h:17
const uint8_t kSharpAcTimerHoursMax
Definition: ir_Sharp.h:86
const uint8_t kSharpAcPowerOff
Definition: ir_Sharp.h:55
uint16_t getTimerTime(void)
Get how long the timer is set for, in minutes.
Definition: ir_Sharp.cpp:620
const uint8_t kLowNibble
Definition: IRutils.h:18
bool getLightToggle(void)
Get the Light toggle setting of the A/C.
Definition: ir_Sharp.cpp:614
const uint8_t kSharpAcSwingNoToggle
Definition: ir_Sharp.h:96
const uint8_t kSharpAcTimerIncrement
Definition: ir_Sharp.h:82
const uint8_t kSharpAcPowerSetSpecialOn
Definition: ir_Sharp.h:57
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Sharp.cpp:688
void setTurbo(const bool on)
Set the Turbo setting of the A/C.
Definition: ir_Sharp.cpp:536
void setModel(const sharp_ac_remote_model_t model)
Set the model of the A/C to emulate.
Definition: ir_Sharp.cpp:315
static bool validChecksum(uint8_t state[], const uint16_t length=kSharpAcStateLength)
Verify the checksum is valid for a given state.
Definition: ir_Sharp.cpp:275
uint8_t getSpecial(void)
Get the value of the Special (button/command?) setting.
Definition: ir_Sharp.cpp:420
const uint8_t kSharpAcSpecialTimerHalfHour
Definition: ir_Sharp.h:105
const uint8_t kSharpAcTimerHoursOff
Definition: ir_Sharp.h:85
const uint8_t kSharpAcBitTimerEnabled
Definition: ir_Sharp.h:90
const uint8_t kSharpAcByteTimer
Definition: ir_Sharp.h:81
sharp_ac_remote_model_t getModel(const bool raw=false)
Get/Detect the model of the A/C.
Definition: ir_Sharp.cpp:332
uint8_t getTemp(void)
Get the current temperature setting.
Definition: ir_Sharp.cpp:452
const uint8_t kHighNibble
Definition: IRutils.h:19
const uint8_t kSharpAcByteSpecial
Definition: ir_Sharp.h:98
const uint8_t kSharpAcSwingToggle
Definition: ir_Sharp.h:95
void setPowerSpecial(const uint8_t value)
Set the value of the Power Special setting without any checks.
Definition: ir_Sharp.cpp:344
const uint8_t kSharpAcFanAuto
Definition: ir_Sharp.h:73
void send(const uint16_t repeat=kSharpAcDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Sharp.cpp:255
IRsend _irsend
Instance of the IR send class.
Definition: ir_Sharp.h:171
void checksum(void)
Calculate and set the checksum values for the internal state.
Definition: ir_Sharp.cpp:281
const uint32_t kSharpAcGap
Definition: ir_Sharp.h:42
const uint8_t kSharpAcBitTimerType
Definition: ir_Sharp.h:87
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Sharp.cpp:300
const uint8_t kSharpAcSwingSize
Definition: ir_Sharp.h:94
const uint8_t kSharpAcByteMode
Definition: ir_Sharp.h:61
bool getTimerType(void)
Get the current timer type.
Definition: ir_Sharp.cpp:635
const uint8_t kSharpAcPowerUnknown
Definition: ir_Sharp.h:53
const uint8_t kSharpAcPowerOn
Definition: ir_Sharp.h:56
void _setEconoToggle(const bool on)
Set the Economical mode toggle setting of the A/C.
Definition: ir_Sharp.cpp:583
void setSpecial(const uint8_t mode)
Set the value of the Special (button/command?) setting.
Definition: ir_Sharp.cpp:402
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Sharp.cpp:250
const uint8_t kSharpAcByteClean
Definition: ir_Sharp.h:68
const uint16_t kSharpAcStateLength
Definition: IRremoteESP8266.h:1059
const uint8_t kSharpAcModeSize
Definition: ir_Sharp.h:62
const uint8_t kSharpAcFanMax
Definition: ir_Sharp.h:79
uint8_t _mode
Saved copy of the desired mode.
Definition: ir_Sharp.h:179
const uint8_t kSharpAcBytePowerSpecial
Definition: ir_Sharp.h:50
Class for handling detailed Sharp A/C messages.
Definition: ir_Sharp.h:113
stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Sharp.cpp:715
bool getEconoToggle(void)
Get the Economical mode toggle setting of the A/C.
Definition: ir_Sharp.cpp:599
const uint8_t kSharpAcPowerTimerSetting
Definition: ir_Sharp.h:59
const uint8_t kSharpAcBitIonOffset
Definition: ir_Sharp.h:108
const uint8_t kSharpAcFanHigh
Definition: ir_Sharp.h:77
bool getSwingToggle(void)
Get the (vertical) Swing Toggle setting of the A/C.
Definition: ir_Sharp.cpp:544
const uint8_t kSharpAcFanMin
Definition: ir_Sharp.h:74
const uint8_t kSharpAcByteSwing
Definition: ir_Sharp.h:92
void setClean(const bool on)
Set the Economical mode toggle setting of the A/C.
Definition: ir_Sharp.cpp:671
uint8_t remote[kSharpAcStateLength]
State of the remote in IR code form.
Definition: ir_Sharp.h:177
const uint8_t kSharpAcFan
Definition: ir_Sharp.h:64
const uint8_t kSharpAcFanMed
Definition: ir_Sharp.h:75
const uint16_t kSharpAcDefaultRepeat
Definition: IRremoteESP8266.h:1061
const uint8_t kSharpAcTimerHoursOffset
Definition: ir_Sharp.h:83
const uint8_t kSharpAcFanA705Med
Definition: ir_Sharp.h:78
uint8_t _fan
Saved copy of the desired fan speed.
Definition: ir_Sharp.h:180
const uint8_t kSharpAcByteIon
Definition: ir_Sharp.h:107
void setEconoToggle(const bool on)
Set the Economical mode toggle setting of the A/C.
Definition: ir_Sharp.cpp:592
const uint8_t kSharpAcModelBit
Definition: ir_Sharp.h:45
const uint8_t kSharpAcFanOffset
Definition: ir_Sharp.h:71
bool getClean(void)
Get the Clean setting of the A/C.
Definition: ir_Sharp.cpp:664
const uint16_t kSharpAcHdrSpace
Definition: ir_Sharp.h:38
bool getTurbo(void)
Get the Turbo setting of the A/C.
Definition: ir_Sharp.cpp:526
const uint8_t kSharpAcAuto
Definition: ir_Sharp.h:63
void setLightToggle(const bool on)
Set the Light mode toggle setting of the A/C.
Definition: ir_Sharp.cpp:607
stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Sharp.cpp:733
void setSwingToggle(const bool on)
Set the (vertical) Swing Toggle setting of the A/C.
Definition: ir_Sharp.cpp:551
bool getTimerEnabled(void)
Is the Timer enabled?
Definition: ir_Sharp.cpp:629
const uint8_t kSharpAcPowerSetSpecialOffset
Definition: ir_Sharp.h:51
const uint8_t kSharpAcPowerSetSpecialOff
Definition: ir_Sharp.h:58
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Sharp.cpp:374
void setMode(const uint8_t mode, const bool save=true)
Set the operating mode of the A/C.
Definition: ir_Sharp.cpp:466
const uint16_t kSharpAcBitMark
Definition: ir_Sharp.h:39
const uint8_t kSharpAcMinTemp
Definition: ir_Sharp.h:47
const uint8_t kSharpAcSpecialTurbo
Definition: ir_Sharp.h:100
String toString(void)
Convert the current internal state into a human readable string.
Definition: ir_Sharp.cpp:781
void stateReset(void)
Reset the state of the remote to a known good state/sequence.
Definition: ir_Sharp.cpp:287
const uint8_t kSharpAcByteTemp
Definition: ir_Sharp.h:46
void setIon(const bool on)
Set the Ion (Filter) setting of the A/C.
Definition: ir_Sharp.cpp:565
Structure to hold a common A/C state.
Definition: IRsend.h:97
void clearPowerSpecial(void)
Clear the "special"/non-normal bits in the power section. e.g. for normal/common command modes.
Definition: ir_Sharp.cpp:358
const uint16_t kSharpAcHdrMark
Definition: ir_Sharp.h:37
void setRaw(const uint8_t new_code[], const uint16_t length=kSharpAcStateLength)
Set the internal state from a valid code for this protocol.
Definition: ir_Sharp.cpp:308
const uint8_t kSharpAcSpecialPower
Definition: ir_Sharp.h:99
const uint8_t kSharpAcBitCleanOffset
Definition: ir_Sharp.h:69
sharp_ac_remote_model_t
Sharp A/C model numbers.
Definition: IRsend.h:152
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Sharp.cpp:701