Go to the documentation of this file.
25 #define __STDC_LIMIT_MACROS
33 #include "IRsend_test.h"
97 explicit IRSamsungAc(
const uint16_t pin,
const bool inverted =
false,
98 const bool use_modulation =
true);
99 void stateReset(
const bool forcepower =
true,
const bool initialPower =
true);
102 const bool calcchecksum =
true);
104 const bool calcchecksum =
true);
112 #endif // SEND_SAMSUNG_AC
118 void setTemp(
const uint8_t temp);
120 void setFan(
const uint8_t speed);
122 void setMode(
const uint8_t mode);
141 void setRaw(
const uint8_t new_code[],
168 #endif // IR_SAMSUNG_H_
bool getIon(void)
Get the Ion (Filter) setting of the A/C.
Definition: ir_Samsung.cpp:636
const uint8_t kSamsungAcDry
Definition: ir_Samsung.h:76
Class for handling detailed Samsung A/C messages.
Definition: ir_Samsung.h:95
bool _forcepower
Hack to know when we need to send a special power mesg.
Definition: ir_Samsung.h:163
const uint8_t kSamsungAcCool
Definition: ir_Samsung.h:75
void setQuiet(const bool on)
Set the Quiet setting of the A/C.
Definition: ir_Samsung.cpp:563
const uint8_t kSamsungAcFanMed
Definition: ir_Samsung.h:83
void send(const uint16_t repeat=kSamsungAcDefaultRepeat, const bool calcchecksum=true)
Send the current internal state as an IR message.
Definition: ir_Samsung.cpp:337
const uint8_t kSamsungAcFanAuto2
Definition: ir_Samsung.h:85
const uint8_t kSamsungAcAuto
Definition: ir_Samsung.h:74
IRsend _irsend
Instance of the IR send class.
Definition: ir_Samsung.h:156
IRSamsungAc(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Samsung.cpp:264
const uint8_t kSamsungAcFanHigh
Definition: ir_Samsung.h:84
const uint8_t kSamsungAcBreezeSize
Definition: ir_Samsung.h:62
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
const uint8_t kSamsungAcFan
Definition: ir_Samsung.h:77
bool getBreeze(void)
Are the vanes closed over the fan outlet, to stop direct wind? Aka. WindFree.
Definition: ir_Samsung.cpp:603
void setBreeze(const bool on)
Closes the vanes over the fan outlet, to stop direct wind. Aka. WindFree.
Definition: ir_Samsung.cpp:612
stdAc::state_t toCommon(void)
Convert the current internal state into its stdAc::state_t equivilant.
Definition: ir_Samsung.cpp:701
const uint8_t kSamsungAcSwingStop
Definition: ir_Samsung.h:55
const uint8_t kSamsungAcPower1Offset
Definition: ir_Samsung.h:41
bool getDisplay(void)
Get the Display (Light/LED) setting of the A/C.
Definition: ir_Samsung.cpp:624
uint8_t getMode(void)
Get the operating mode setting of the A/C.
Definition: ir_Samsung.cpp:480
const uint16_t kSamsungAcDefaultRepeat
Definition: IRremoteESP8266.h:973
const uint8_t kSamsungAcPowerful10On
Definition: ir_Samsung.h:59
bool getPower(void)
Get the value of the current power setting.
Definition: ir_Samsung.cpp:438
void setSwing(const bool on)
Set the vertical swing setting of the A/C.
Definition: ir_Samsung.cpp:523
String toString(void)
Convert the current internal state into a human readable string.
Definition: ir_Samsung.cpp:728
const uint16_t kSamsungAcSectionLength
Definition: ir_Samsung.h:90
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Samsung.cpp:285
Class for sending all basic IR protocols.
Definition: IRsend.h:170
void setIon(const bool on)
Set the Ion (Filter) setting of the A/C.
Definition: ir_Samsung.cpp:642
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:412
std::string String
Definition: IRremoteESP8266.h:1093
uint8_t getTemp(void)
Get the current temperature setting.
Definition: ir_Samsung.cpp:455
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:392
const uint8_t kSamsungAcQuiet1Offset
Definition: ir_Samsung.h:42
bool getPowerful(void)
Get the Powerful (Turbo) setting of the A/C.
Definition: ir_Samsung.cpp:575
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Samsung.cpp:423
bool getBeep(void)
Get the Beep setting of the A/C.
Definition: ir_Samsung.cpp:530
const uint8_t kSamsungAcFanSize
Definition: ir_Samsung.h:80
uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Samsung.cpp:662
uint8_t remote_state[kSamsungAcExtendedStateLength]
State in code form.
Definition: ir_Samsung.h:162
const uint8_t kSamsungAcPowerfulMask8
Definition: ir_Samsung.h:50
const uint16_t kSamsungAcStateLength
Definition: IRremoteESP8266.h:969
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:310
void setTemp(const uint8_t temp)
Set the temperature.
Definition: ir_Samsung.cpp:446
const uint8_t kSamsungAcSwingOffset
Definition: ir_Samsung.h:52
const uint64_t kSamsungAcPowerSection
Definition: ir_Samsung.h:91
void setPowerful(const bool on)
Set the Powerful (Turbo) setting of the A/C.
Definition: ir_Samsung.cpp:584
const uint8_t kSamsungAcModeOffset
Definition: ir_Samsung.h:73
const uint16_t kSamsungAcExtendedStateLength
Definition: IRremoteESP8266.h:971
bool getQuiet(void)
Get the Quiet setting of the A/C.
Definition: ir_Samsung.cpp:556
const uint8_t kSamsungAcDisplayOffset
Definition: ir_Samsung.h:64
void setPower(const bool on)
Change the power setting.
Definition: ir_Samsung.cpp:430
void setDisplay(const bool on)
Set the Display (Light/LED) setting of the A/C.
Definition: ir_Samsung.cpp:630
uint8_t getFan(void)
Get the current fan speed setting.
Definition: ir_Samsung.cpp:506
const uint8_t kSamsungAcBreezeOn
Definition: ir_Samsung.h:63
const uint8_t kSamsungAcPowerful10Offset
Definition: ir_Samsung.h:57
void stateReset(const bool forcepower=true, const bool initialPower=true)
Reset the internal state of the emulation.
Definition: ir_Samsung.cpp:274
static uint8_t calcChecksum(const uint8_t state[], const uint16_t length=kSamsungAcStateLength)
Calculate the checksum for a given state.
Definition: ir_Samsung.cpp:291
bool _lastsentpowerstate
Definition: ir_Samsung.h:164
const uint8_t kSamsungAcAutoTemp
Definition: ir_Samsung.h:71
const uint8_t kSamsungAcSwingMove
Definition: ir_Samsung.h:54
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Samsung.cpp:462
const uint8_t kSamsungAcBreezeOffset
Definition: ir_Samsung.h:61
const uint8_t kSamsungAcSwingSize
Definition: ir_Samsung.h:53
const uint8_t kSamsungAcFanLow
Definition: ir_Samsung.h:82
void setClean(const bool on)
Set the Clean setting of the A/C.
Definition: ir_Samsung.cpp:549
const uint8_t kSamsungAcHeat
Definition: ir_Samsung.h:78
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivilant.
Definition: ir_Samsung.cpp:676
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:379
const uint8_t kSamsungAcFanAuto
Definition: ir_Samsung.h:81
const uint8_t kSamsungAcClean11Offset
Definition: ir_Samsung.h:68
void checksum(const uint16_t length=kSamsungAcStateLength)
Update the checksum for the internal state.
Definition: ir_Samsung.cpp:323
void setBeep(const bool on)
Set the Beep setting of the A/C.
Definition: ir_Samsung.cpp:536
bool getClean(void)
Get the Clean setting of the A/C.
Definition: ir_Samsung.cpp:542
const uint8_t kSamsungAcFanOffest
Definition: ir_Samsung.h:79
uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Samsung.cpp:649
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Samsung.h:111
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:358
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Samsung.cpp:486
const uint8_t kSamsungAcMaxTemp
Definition: ir_Samsung.h:70
const uint8_t kSamsungAcIonOffset
Definition: ir_Samsung.h:67
const uint8_t kSamsungAcPower6Offset
Definition: ir_Samsung.h:46
const uint8_t kSamsungAcPowerful10Size
Definition: ir_Samsung.h:58
const uint8_t kSamsungAcClean10Offset
Definition: ir_Samsung.h:65
bool getSwing(void)
Get the vertical swing setting of the A/C.
Definition: ir_Samsung.cpp:514
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Samsung.cpp:426
const uint8_t kSamsungAcPower6Size
Definition: ir_Samsung.h:47
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivilant.
Definition: ir_Samsung.cpp:689
const uint8_t kSamsungAcBeepOffset
Definition: ir_Samsung.h:88
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Samsung.cpp:404
const uint8_t kSamsungAcQuiet5Offset
Definition: ir_Samsung.h:44
const uint8_t kSamsungAcFanTurbo
Definition: ir_Samsung.h:86
Structure to hold a common A/C state.
Definition: IRsend.h:97
const uint8_t kSamsungAcMinTemp
Definition: ir_Samsung.h:69
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46