Go to the documentation of this file.
30 #define __STDC_LIMIT_MACROS
38 #include "IRsend_test.h"
175 explicit IRSamsungAc(
const uint16_t pin,
const bool inverted =
false,
176 const bool use_modulation =
true);
177 void stateReset(
const bool forcepower =
true,
const bool initialPower =
true);
180 const bool calcchecksum =
true);
182 const bool calcchecksum =
true);
190 #endif // SEND_SAMSUNG_AC
196 void setTemp(
const uint8_t temp);
198 void setFan(
const uint8_t speed);
199 uint8_t
getFan(
void)
const;
200 void setMode(
const uint8_t mode);
219 void setRaw(
const uint8_t new_code[],
246 #endif // IR_SAMSUNG_H_
stdAc::state_t toCommon(void) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Samsung.cpp:708
const uint8_t kSamsungAcDry
Definition: ir_Samsung.h:159
Class for handling detailed Samsung A/C messages.
Definition: ir_Samsung.h:173
bool _forcepower
Hack to know when we need to send a special power mesg.
Definition: ir_Samsung.h:241
const uint8_t kSamsungAcCool
Definition: ir_Samsung.h:158
uint8_t Sum2Upper
Definition: ir_Samsung.h:116
Native representation of a Samsung A/C message.
Definition: ir_Samsung.h:42
bool getIon(void) const
Get the Ion (Filter) setting of the A/C.
Definition: ir_Samsung.cpp:643
void setQuiet(const bool on)
Set the Quiet setting of the A/C.
Definition: ir_Samsung.cpp:574
const uint8_t kSamsungAcFanMed
Definition: ir_Samsung.h:164
void send(const uint16_t repeat=kSamsungAcDefaultRepeat, const bool calcchecksum=true)
Send the current internal state as an IR message.
Definition: ir_Samsung.cpp:357
const uint8_t kSamsungAcFanAuto2
Definition: ir_Samsung.h:166
const uint8_t kSamsungAcAuto
Definition: ir_Samsung.h:157
IRsend _irsend
Instance of the IR send class.
Definition: ir_Samsung.h:234
void checksum(void)
Update the checksum for the internal state.
Definition: ir_Samsung.cpp:339
IRSamsungAc(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Samsung.cpp:271
bool getPowerful(void) const
Get the Powerful (Turbo) setting of the A/C.
Definition: ir_Samsung.cpp:586
const uint8_t kSamsungAcFanHigh
Definition: ir_Samsung.h:165
bool getClean(void) const
Get the Clean setting of the A/C.
Definition: ir_Samsung.cpp:555
uint8_t Temp
Definition: ir_Samsung.h:80
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
const uint8_t kSamsungAcFan
Definition: ir_Samsung.h:160
void setBreeze(const bool on)
Closes the vanes over the fan outlet, to stop direct wind. Aka. WindFree.
Definition: ir_Samsung.cpp:620
uint8_t Swing
Definition: ir_Samsung.h:68
uint8_t Ion
Definition: ir_Samsung.h:77
const uint8_t kSamsungAcSwingStop
Definition: ir_Samsung.h:151
const uint16_t kSamsungAcDefaultRepeat
Definition: IRremoteESP8266.h:1138
bool getDisplay(void) const
Get the Display (Light/LED) setting of the A/C.
Definition: ir_Samsung.cpp:631
SamsungProtocol _
Definition: ir_Samsung.h:240
const uint8_t kSamsungAcPowerful10On
Definition: ir_Samsung.h:152
void setSwing(const bool on)
Set the vertical swing setting of the A/C.
Definition: ir_Samsung.cpp:537
bool getQuiet(void) const
Get the Quiet setting of the A/C.
Definition: ir_Samsung.cpp:568
uint8_t Sum3Upper
Definition: ir_Samsung.h:135
const uint16_t kSamsungAcSectionLength
Definition: ir_Samsung.h:168
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Samsung.cpp:292
Class for sending all basic IR protocols.
Definition: IRsend.h:190
void setIon(const bool on)
Set the Ion (Filter) setting of the A/C.
Definition: ir_Samsung.cpp:649
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
uint8_t getTemp(void) const
Get the current temperature setting.
Definition: ir_Samsung.cpp:471
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:432
uint8_t Sum1Lower
Definition: ir_Samsung.h:97
std::string String
Definition: IRremoteESP8266.h:1279
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Samsung.cpp:735
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:412
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Samsung.cpp:443
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Samsung.cpp:669
uint8_t Quiet1
Definition: ir_Samsung.h:49
uint8_t Beep
Definition: ir_Samsung.h:88
const uint8_t kSamsungAcPowerfulMask8
Definition: ir_Samsung.h:149
const uint16_t kSamsungAcStateLength
Definition: IRremoteESP8266.h:1134
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:325
bool getBeep(void) const
Get the Beep setting of the A/C.
Definition: ir_Samsung.cpp:543
uint8_t Sum3Lower
Definition: ir_Samsung.h:133
void setTemp(const uint8_t temp)
Set the temperature.
Definition: ir_Samsung.cpp:463
const uint64_t kSamsungAcPowerSection
Definition: ir_Samsung.h:169
void setPowerful(const bool on)
Set the Powerful (Turbo) setting of the A/C.
Definition: ir_Samsung.cpp:594
uint8_t Sum2Lower
Definition: ir_Samsung.h:114
const uint16_t kSamsungAcExtendedStateLength
Definition: IRremoteESP8266.h:1136
uint8_t Mode
Definition: ir_Samsung.h:84
void setPower(const bool on)
Change the power setting.
Definition: ir_Samsung.cpp:450
uint8_t Sum1Upper
Definition: ir_Samsung.h:99
uint8_t Display
Definition: ir_Samsung.h:73
void setDisplay(const bool on)
Set the Display (Light/LED) setting of the A/C.
Definition: ir_Samsung.cpp:637
uint8_t Clean11
Definition: ir_Samsung.h:78
const uint8_t kSamsungAcBreezeOn
Definition: ir_Samsung.h:153
void stateReset(const bool forcepower=true, const bool initialPower=true)
Reset the internal state of the emulation.
Definition: ir_Samsung.cpp:281
bool _lastsentpowerstate
Definition: ir_Samsung.h:242
const uint8_t kSamsungAcAutoTemp
Definition: ir_Samsung.h:156
const uint8_t kSamsungAcSwingMove
Definition: ir_Samsung.h:150
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Samsung.cpp:477
const uint8_t kSamsungAcFanLow
Definition: ir_Samsung.h:163
void setClean(const bool on)
Set the Clean setting of the A/C.
Definition: ir_Samsung.cpp:561
uint8_t Breeze
Definition: ir_Samsung.h:120
const uint8_t kSamsungAcHeat
Definition: ir_Samsung.h:161
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Samsung.cpp:683
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:399
const uint8_t kSamsungAcFanAuto
Definition: ir_Samsung.h:162
void setBeep(const bool on)
Set the Beep setting of the A/C.
Definition: ir_Samsung.cpp:549
uint8_t Power1
Definition: ir_Samsung.h:50
static uint8_t getSectionChecksum(const uint8_t *section)
Get the existing checksum for a given state section.
Definition: ir_Samsung.cpp:298
bool getSwing(void) const
Get the vertical swing setting of the A/C.
Definition: ir_Samsung.cpp:529
uint8_t Powerful8
Definition: ir_Samsung.h:65
uint8_t Powerful10
Definition: ir_Samsung.h:72
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Samsung.cpp:656
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Samsung.h:189
uint8_t Fan
Definition: ir_Samsung.h:83
void sendExtended(const uint16_t repeat=kSamsungAcDefaultRepeat, const bool calcchecksum=true)
Send the extended current internal state as an IR message.
Definition: ir_Samsung.cpp:374
static uint8_t calcSectionChecksum(const uint8_t *section)
Calculate the checksum for a given state section.
Definition: ir_Samsung.cpp:307
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Samsung.cpp:501
const uint8_t kSamsungAcMaxTemp
Definition: ir_Samsung.h:155
uint8_t Clean10
Definition: ir_Samsung.h:75
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Samsung.cpp:446
bool getBreeze(void) const
Are the vanes closed over the fan outlet, to stop direct wind? Aka. WindFree.
Definition: ir_Samsung.cpp:612
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Samsung.cpp:696
uint8_t pad0[3]
Definition: ir_Samsung.h:53
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Samsung.cpp:457
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Samsung.cpp:424
const uint8_t kSamsungAcFanTurbo
Definition: ir_Samsung.h:167
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:521
uint8_t raw[kSamsungAcExtendedStateLength]
State in code form.
Definition: ir_Samsung.h:43
const uint8_t kSamsungAcMinTemp
Definition: ir_Samsung.h:154
uint8_t Power6
Definition: ir_Samsung.h:60
uint8_t Quiet5
Definition: ir_Samsung.h:56
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Samsung.cpp:495
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46