Go to the documentation of this file.
27 #define __STDC_LIMIT_MACROS
35 #include "IRsend_test.h"
99 explicit IRSamsungAc(
const uint16_t pin,
const bool inverted =
false,
100 const bool use_modulation =
true);
101 void stateReset(
const bool forcepower =
true,
const bool initialPower =
true);
104 const bool calcchecksum =
true);
106 const bool calcchecksum =
true);
114 #endif // SEND_SAMSUNG_AC
120 void setTemp(
const uint8_t temp);
122 void setFan(
const uint8_t speed);
124 void setMode(
const uint8_t mode);
143 void setRaw(
const uint8_t new_code[],
170 #endif // IR_SAMSUNG_H_
bool getIon(void)
Get the Ion (Filter) setting of the A/C.
Definition: ir_Samsung.cpp:644
const uint8_t kSamsungAcDry
Definition: ir_Samsung.h:78
Class for handling detailed Samsung A/C messages.
Definition: ir_Samsung.h:97
bool _forcepower
Hack to know when we need to send a special power mesg.
Definition: ir_Samsung.h:165
const uint8_t kSamsungAcCool
Definition: ir_Samsung.h:77
void setQuiet(const bool on)
Set the Quiet setting of the A/C.
Definition: ir_Samsung.cpp:571
const uint8_t kSamsungAcFanMed
Definition: ir_Samsung.h:85
void send(const uint16_t repeat=kSamsungAcDefaultRepeat, const bool calcchecksum=true)
Send the current internal state as an IR message.
Definition: ir_Samsung.cpp:345
const uint8_t kSamsungAcFanAuto2
Definition: ir_Samsung.h:87
const uint8_t kSamsungAcAuto
Definition: ir_Samsung.h:76
IRsend _irsend
Instance of the IR send class.
Definition: ir_Samsung.h:158
IRSamsungAc(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Samsung.cpp:272
const uint8_t kSamsungAcFanHigh
Definition: ir_Samsung.h:86
const uint8_t kSamsungAcBreezeSize
Definition: ir_Samsung.h:64
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
const uint8_t kSamsungAcFan
Definition: ir_Samsung.h:79
bool getBreeze(void)
Are the vanes closed over the fan outlet, to stop direct wind? Aka. WindFree.
Definition: ir_Samsung.cpp:611
void setBreeze(const bool on)
Closes the vanes over the fan outlet, to stop direct wind. Aka. WindFree.
Definition: ir_Samsung.cpp:620
stdAc::state_t toCommon(void)
Convert the current internal state into its stdAc::state_t equivilant.
Definition: ir_Samsung.cpp:709
const uint8_t kSamsungAcSwingStop
Definition: ir_Samsung.h:57
const uint8_t kSamsungAcPower1Offset
Definition: ir_Samsung.h:43
bool getDisplay(void)
Get the Display (Light/LED) setting of the A/C.
Definition: ir_Samsung.cpp:632
uint8_t getMode(void)
Get the operating mode setting of the A/C.
Definition: ir_Samsung.cpp:488
const uint16_t kSamsungAcDefaultRepeat
Definition: IRremoteESP8266.h:1000
const uint8_t kSamsungAcPowerful10On
Definition: ir_Samsung.h:61
bool getPower(void)
Get the value of the current power setting.
Definition: ir_Samsung.cpp:446
void setSwing(const bool on)
Set the vertical swing setting of the A/C.
Definition: ir_Samsung.cpp:531
String toString(void)
Convert the current internal state into a human readable string.
Definition: ir_Samsung.cpp:736
const uint16_t kSamsungAcSectionLength
Definition: ir_Samsung.h:92
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Samsung.cpp:293
Class for sending all basic IR protocols.
Definition: IRsend.h:176
void setIon(const bool on)
Set the Ion (Filter) setting of the A/C.
Definition: ir_Samsung.cpp:650
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
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:420
std::string String
Definition: IRremoteESP8266.h:1128
uint8_t getTemp(void)
Get the current temperature setting.
Definition: ir_Samsung.cpp:463
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:400
const uint8_t kSamsungAcQuiet1Offset
Definition: ir_Samsung.h:44
bool getPowerful(void)
Get the Powerful (Turbo) setting of the A/C.
Definition: ir_Samsung.cpp:583
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Samsung.cpp:431
bool getBeep(void)
Get the Beep setting of the A/C.
Definition: ir_Samsung.cpp:538
const uint8_t kSamsungAcFanSize
Definition: ir_Samsung.h:82
uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Samsung.cpp:670
uint8_t remote_state[kSamsungAcExtendedStateLength]
State in code form.
Definition: ir_Samsung.h:164
const uint8_t kSamsungAcPowerfulMask8
Definition: ir_Samsung.h:52
const uint16_t kSamsungAcStateLength
Definition: IRremoteESP8266.h:996
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:318
void setTemp(const uint8_t temp)
Set the temperature.
Definition: ir_Samsung.cpp:454
const uint8_t kSamsungAcSwingOffset
Definition: ir_Samsung.h:54
const uint64_t kSamsungAcPowerSection
Definition: ir_Samsung.h:93
void setPowerful(const bool on)
Set the Powerful (Turbo) setting of the A/C.
Definition: ir_Samsung.cpp:592
const uint8_t kSamsungAcModeOffset
Definition: ir_Samsung.h:75
const uint16_t kSamsungAcExtendedStateLength
Definition: IRremoteESP8266.h:998
bool getQuiet(void)
Get the Quiet setting of the A/C.
Definition: ir_Samsung.cpp:564
const uint8_t kSamsungAcDisplayOffset
Definition: ir_Samsung.h:66
void setPower(const bool on)
Change the power setting.
Definition: ir_Samsung.cpp:438
void setDisplay(const bool on)
Set the Display (Light/LED) setting of the A/C.
Definition: ir_Samsung.cpp:638
uint8_t getFan(void)
Get the current fan speed setting.
Definition: ir_Samsung.cpp:514
const uint8_t kSamsungAcBreezeOn
Definition: ir_Samsung.h:65
const uint8_t kSamsungAcPowerful10Offset
Definition: ir_Samsung.h:59
void stateReset(const bool forcepower=true, const bool initialPower=true)
Reset the internal state of the emulation.
Definition: ir_Samsung.cpp:282
static uint8_t calcChecksum(const uint8_t state[], const uint16_t length=kSamsungAcStateLength)
Calculate the checksum for a given state.
Definition: ir_Samsung.cpp:299
bool _lastsentpowerstate
Definition: ir_Samsung.h:166
const uint8_t kSamsungAcAutoTemp
Definition: ir_Samsung.h:73
const uint8_t kSamsungAcSwingMove
Definition: ir_Samsung.h:56
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Samsung.cpp:470
const uint8_t kSamsungAcBreezeOffset
Definition: ir_Samsung.h:63
const uint8_t kSamsungAcSwingSize
Definition: ir_Samsung.h:55
const uint8_t kSamsungAcFanLow
Definition: ir_Samsung.h:84
void setClean(const bool on)
Set the Clean setting of the A/C.
Definition: ir_Samsung.cpp:557
const uint8_t kSamsungAcHeat
Definition: ir_Samsung.h:80
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivilant.
Definition: ir_Samsung.cpp:684
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:387
const uint8_t kSamsungAcFanAuto
Definition: ir_Samsung.h:83
const uint8_t kSamsungAcClean11Offset
Definition: ir_Samsung.h:70
void checksum(const uint16_t length=kSamsungAcStateLength)
Update the checksum for the internal state.
Definition: ir_Samsung.cpp:331
void setBeep(const bool on)
Set the Beep setting of the A/C.
Definition: ir_Samsung.cpp:544
bool getClean(void)
Get the Clean setting of the A/C.
Definition: ir_Samsung.cpp:550
const uint8_t kSamsungAcFanOffest
Definition: ir_Samsung.h:81
uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Samsung.cpp:657
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Samsung.h:113
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:366
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Samsung.cpp:494
const uint8_t kSamsungAcMaxTemp
Definition: ir_Samsung.h:72
const uint8_t kSamsungAcIonOffset
Definition: ir_Samsung.h:69
const uint8_t kSamsungAcPower6Offset
Definition: ir_Samsung.h:48
const uint8_t kSamsungAcPowerful10Size
Definition: ir_Samsung.h:60
const uint8_t kSamsungAcClean10Offset
Definition: ir_Samsung.h:67
bool getSwing(void)
Get the vertical swing setting of the A/C.
Definition: ir_Samsung.cpp:522
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Samsung.cpp:434
const uint8_t kSamsungAcPower6Size
Definition: ir_Samsung.h:49
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivilant.
Definition: ir_Samsung.cpp:697
const uint8_t kSamsungAcBeepOffset
Definition: ir_Samsung.h:90
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Samsung.cpp:412
const uint8_t kSamsungAcQuiet5Offset
Definition: ir_Samsung.h:46
const uint8_t kSamsungAcFanTurbo
Definition: ir_Samsung.h:88
Structure to hold a common A/C state.
Definition: IRsend.h:97
const uint8_t kSamsungAcMinTemp
Definition: ir_Samsung.h:71
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46