Go to the documentation of this file.
33 #define __STDC_LIMIT_MACROS
41 #include "IRsend_test.h"
187 explicit IRSamsungAc(
const uint16_t pin,
const bool inverted =
false,
188 const bool use_modulation =
true);
189 void stateReset(
const bool extended =
true,
const bool initialPower =
true);
200 #endif // SEND_SAMSUNG_AC
206 void setTemp(
const uint8_t temp);
208 void setFan(
const uint8_t speed);
209 uint8_t
getFan(
void)
const;
210 void setMode(
const uint8_t mode);
239 void setRaw(
const uint8_t new_code[],
279 #endif // IR_SAMSUNG_H_
uint8_t OffTimeHrs1
Definition: ir_Samsung.h:128
stdAc::state_t toCommon(void) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Samsung.cpp:868
uint16_t getOnTimer(void) const
Get the On Timer setting of the A/C.
Definition: ir_Samsung.cpp:760
const uint8_t kSamsungAcDry
Definition: ir_Samsung.h:171
Class for handling detailed Samsung A/C messages.
Definition: ir_Samsung.h:185
uint16_t _OnTimer
Definition: ir_Samsung.h:267
const uint8_t kSamsungAcCool
Definition: ir_Samsung.h:170
uint8_t OffTimerEnable
Definition: ir_Samsung.h:139
uint8_t Sum2Upper
Definition: ir_Samsung.h:126
Native representation of a Samsung A/C message.
Definition: ir_Samsung.h:45
bool getSwingH(void) const
Get the horizontal swing setting of the A/C.
Definition: ir_Samsung.cpp:573
bool getIon(void) const
Get the Ion (Filter) setting of the A/C.
Definition: ir_Samsung.cpp:702
void setQuiet(const bool on)
Set the Quiet setting of the A/C.
Definition: ir_Samsung.cpp:621
void setSwingH(const bool on)
Set the horizontal swing setting of the A/C.
Definition: ir_Samsung.cpp:583
const uint8_t kSamsungAcFanMed
Definition: ir_Samsung.h:176
const uint8_t kSamsungAcFanAuto2
Definition: ir_Samsung.h:178
void send(const uint16_t repeat=kSamsungAcDefaultRepeat)
Send the current internal state as an IR message.
Definition: ir_Samsung.cpp:374
const uint8_t kSamsungAcAuto
Definition: ir_Samsung.h:169
IRsend _irsend
Instance of the IR send class.
Definition: ir_Samsung.h:254
void checksum(void)
Update the checksum for the internal state.
Definition: ir_Samsung.cpp:357
IRSamsungAc(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Samsung.cpp:284
bool getPowerful(void) const
Get the Powerful (Turbo) setting of the A/C.
Definition: ir_Samsung.cpp:632
const uint8_t kSamsungAcFanHigh
Definition: ir_Samsung.h:177
bool getClean(void) const
Get the Clean toggle setting of the A/C.
Definition: ir_Samsung.cpp:604
uint8_t Temp
Definition: ir_Samsung.h:88
void setOffTimer(const uint16_t nr_of_mins)
Set the Off Timer value of the A/C.
Definition: ir_Samsung.cpp:794
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
const uint8_t kSamsungAcFan
Definition: ir_Samsung.h:172
void setBreeze(const bool on)
Closes the vanes over the fan outlet, to stop direct wind. Aka. WindFree.
Definition: ir_Samsung.cpp:661
uint8_t Swing
Definition: ir_Samsung.h:76
uint8_t OffTimeHrs2
Definition: ir_Samsung.h:130
void setOnTimer(const uint16_t nr_of_mins)
Set the On Timer value of the A/C.
Definition: ir_Samsung.cpp:783
bool _Sleep
Definition: ir_Samsung.h:265
uint8_t Ion
Definition: ir_Samsung.h:85
uint8_t OnTimeDay
Definition: ir_Samsung.h:141
void sendExtended(const uint16_t repeat=kSamsungAcDefaultRepeat)
Send the extended current internal state as an IR message.
Definition: ir_Samsung.cpp:388
uint8_t FanSpecial
Definition: ir_Samsung.h:80
const uint16_t kSamsungAcDefaultRepeat
Definition: IRremoteESP8266.h:1165
bool getDisplay(void) const
Get the Display (Light/LED) setting of the A/C.
Definition: ir_Samsung.cpp:694
void stateReset(const bool extended=true, const bool initialPower=true)
Reset the internal state of the emulation.
Definition: ir_Samsung.cpp:294
SamsungProtocol _
Definition: ir_Samsung.h:260
uint8_t BeepToggle
Definition: ir_Samsung.h:96
uint8_t OnTimeMins
Definition: ir_Samsung.h:131
void setSwing(const bool on)
Set the vertical swing setting of the A/C.
Definition: ir_Samsung.cpp:560
bool getQuiet(void) const
Get the Quiet setting of the A/C.
Definition: ir_Samsung.cpp:617
uint8_t Sum3Upper
Definition: ir_Samsung.h:152
const uint16_t kSamsungAcSectionLength
Definition: ir_Samsung.h:180
uint16_t _getOffTimer(void) const
Get the Off Timer setting of the A/C from a raw extended state.
Definition: ir_Samsung.cpp:731
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Samsung.cpp:310
Class for sending all basic IR protocols.
Definition: IRsend.h:208
void setIon(const bool on)
Set the Ion (Filter) setting of the A/C.
Definition: ir_Samsung.cpp:706
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
uint8_t OffTimeMins
Definition: ir_Samsung.h:127
uint8_t getTemp(void) const
Get the current temperature setting.
Definition: ir_Samsung.cpp:494
uint16_t _lastOnTimer
Definition: ir_Samsung.h:269
void setRaw(const uint8_t new_code[], const uint16_t length=kSamsungAcStateLength)
Set the internal state from a valid code for this protocol.
Definition: ir_Samsung.cpp:451
uint8_t Sum1Lower
Definition: ir_Samsung.h:107
std::string String
Definition: IRremoteESP8266.h:1309
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Samsung.cpp:894
void sendOff(const uint16_t repeat=kSamsungAcDefaultRepeat)
Send the special extended "Off" message as the library can't seem to reproduce this message automatic...
Definition: ir_Samsung.cpp:431
uint16_t getOffTimer(void) const
Get the Off Timer setting of the A/C.
Definition: ir_Samsung.cpp:765
void setSleepTimer(const uint16_t nr_of_mins)
Set the Sleep Timer value of the A/C.
Definition: ir_Samsung.cpp:805
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Samsung.cpp:467
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Samsung.cpp:829
void _setSleepTimer(void)
Definition: ir_Samsung.cpp:751
const uint16_t kSamsungAcStateLength
Definition: IRremoteESP8266.h:1161
static bool validChecksum(const uint8_t state[], const uint16_t length=kSamsungAcStateLength)
Verify the checksum is valid for a given state.
Definition: ir_Samsung.cpp:343
bool getBeep(void) const
Get the Beep toggle setting of the A/C.
Definition: ir_Samsung.cpp:596
uint8_t Sum3Lower
Definition: ir_Samsung.h:150
void setTemp(const uint8_t temp)
Set the temperature.
Definition: ir_Samsung.cpp:486
uint8_t OffTimeDay
Definition: ir_Samsung.h:137
uint16_t getSleepTimer(void) const
Get the Sleep Timer setting of the A/C.
Definition: ir_Samsung.cpp:772
const uint64_t kSamsungAcPowerSection
Definition: ir_Samsung.h:181
void setPowerful(const bool on)
Set the Powerful (Turbo) setting of the A/C.
Definition: ir_Samsung.cpp:639
uint8_t Sum2Lower
Definition: ir_Samsung.h:124
const uint16_t kSamsungAcExtendedStateLength
Definition: IRremoteESP8266.h:1163
uint16_t _OffTimer
Definition: ir_Samsung.h:268
uint8_t Mode
Definition: ir_Samsung.h:92
void setPower(const bool on)
Change the power setting.
Definition: ir_Samsung.cpp:474
uint8_t Sum1Upper
Definition: ir_Samsung.h:109
uint8_t Display
Definition: ir_Samsung.h:81
void setDisplay(const bool on)
Set the Display (Light/LED) setting of the A/C.
Definition: ir_Samsung.cpp:698
bool _lastSleep
Definition: ir_Samsung.h:266
uint8_t Power2
Definition: ir_Samsung.h:98
bool _lastsentpowerstate
Definition: ir_Samsung.h:262
const uint8_t kSamsungAcAutoTemp
Definition: ir_Samsung.h:168
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Samsung.cpp:500
const uint8_t kSamsungAcFanLow
Definition: ir_Samsung.h:175
void setClean(const bool on)
Set the Clean toggle setting of the A/C.
Definition: ir_Samsung.cpp:610
uint8_t CleanToggle11
Definition: ir_Samsung.h:86
const uint8_t kSamsungAcHeat
Definition: ir_Samsung.h:173
void setEcono(const bool on)
Set the current Economy (Eco) setting of the A/C.
Definition: ir_Samsung.cpp:681
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Samsung.cpp:843
void sendOn(const uint16_t repeat=kSamsungAcDefaultRepeat)
Send the special extended "On" message as the library can't seem to reproduce this message automatica...
Definition: ir_Samsung.cpp:418
const uint8_t kSamsungAcFanAuto
Definition: ir_Samsung.h:174
void setBeep(const bool on)
Set the Beep toggle setting of the A/C.
Definition: ir_Samsung.cpp:600
uint8_t Power1
Definition: ir_Samsung.h:67
bool _forceextended
Flag to know when we need to send an extended mesg.
Definition: ir_Samsung.h:261
uint8_t OnTimerEnable
Definition: ir_Samsung.h:138
static uint8_t getSectionChecksum(const uint8_t *section)
Get the existing checksum for a given state section.
Definition: ir_Samsung.cpp:316
uint16_t _getOnTimer(void) const
Get the On Timer setting of the A/C from a raw extended state.
Definition: ir_Samsung.cpp:710
bool _OnTimerEnable
Definition: ir_Samsung.h:263
bool getSwing(void) const
Get the vertical swing setting of the A/C.
Definition: ir_Samsung.cpp:550
uint8_t Sleep12
Definition: ir_Samsung.h:140
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Samsung.cpp:816
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Samsung.h:199
uint8_t Fan
Definition: ir_Samsung.h:91
static uint8_t calcSectionChecksum(const uint8_t *section)
Calculate the checksum for a given state section.
Definition: ir_Samsung.cpp:325
bool getEcono(void) const
Get the current Economy (Eco) setting of the A/C.
Definition: ir_Samsung.cpp:674
uint8_t OnTimeHrs1
Definition: ir_Samsung.h:132
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Samsung.cpp:524
const uint8_t kSamsungAcMaxTemp
Definition: ir_Samsung.h:167
uint8_t Sleep5
Definition: ir_Samsung.h:62
void _setOnTimer(void)
Set the current On Timer value of the A/C into the raw extended state.
Definition: ir_Samsung.cpp:716
uint8_t CleanToggle10
Definition: ir_Samsung.h:83
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Samsung.cpp:470
bool getBreeze(void) const
Are the vanes closed over the fan outlet, to stop direct wind? Aka. WindFree.
Definition: ir_Samsung.cpp:653
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Samsung.cpp:856
uint16_t _lastOffTimer
Definition: ir_Samsung.h:270
bool _OffTimerEnable
Definition: ir_Samsung.h:264
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Samsung.cpp:480
uint8_t Quiet
Definition: ir_Samsung.h:63
void _setOffTimer(void)
Set the current Off Timer value of the A/C into the raw extended state.
Definition: ir_Samsung.cpp:737
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Samsung.cpp:443
uint8_t OnTimeHrs2
Definition: ir_Samsung.h:134
const uint8_t kSamsungAcFanTurbo
Definition: ir_Samsung.h:179
Structure to hold a common A/C state.
Definition: IRsend.h:97
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Samsung.cpp:544
uint8_t raw[kSamsungAcExtendedStateLength]
State in code form.
Definition: ir_Samsung.h:46
const uint8_t kSamsungAcMinTemp
Definition: ir_Samsung.h:166
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Samsung.cpp:518
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46