IRremoteESP8266
|
Class for handling detailed Samsung A/C messages. More...
#include <ir_Samsung.h>
Public Member Functions | |
IRSamsungAc (const uint16_t pin, const bool inverted=false, const bool use_modulation=true) | |
Class constructor. More... | |
void | stateReset (const bool extended=true, const bool initialPower=true) |
Reset the internal state of the emulation. More... | |
void | send (const uint16_t repeat=kSamsungAcDefaultRepeat) |
Send the current internal state as an IR message. More... | |
void | sendExtended (const uint16_t repeat=kSamsungAcDefaultRepeat) |
Send the extended current internal state as an IR message. More... | |
void | sendOn (const uint16_t repeat=kSamsungAcDefaultRepeat) |
Send the special extended "On" message as the library can't seem to reproduce this message automatically. More... | |
void | sendOff (const uint16_t repeat=kSamsungAcDefaultRepeat) |
Send the special extended "Off" message as the library can't seem to reproduce this message automatically. More... | |
int8_t | calibrate (void) |
Run the calibration to calculate uSec timing offsets for this platform. More... | |
void | begin (void) |
Set up hardware to be able to send a message. More... | |
void | on (void) |
Set the requested power state of the A/C to on. More... | |
void | off (void) |
Set the requested power state of the A/C to off. More... | |
void | setPower (const bool on) |
Change the power setting. More... | |
bool | getPower (void) const |
Get the value of the current power setting. More... | |
void | setTemp (const uint8_t temp) |
Set the temperature. More... | |
uint8_t | getTemp (void) const |
Get the current temperature setting. More... | |
void | setFan (const uint8_t speed) |
Set the speed of the fan. More... | |
uint8_t | getFan (void) const |
Get the current fan speed setting. More... | |
void | setMode (const uint8_t mode) |
Set the operating mode of the A/C. More... | |
uint8_t | getMode (void) const |
Get the operating mode setting of the A/C. More... | |
void | setSwing (const bool on) |
Set the vertical swing setting of the A/C. More... | |
bool | getSwing (void) const |
Get the vertical swing setting of the A/C. More... | |
void | setSwingH (const bool on) |
Set the horizontal swing setting of the A/C. More... | |
bool | getSwingH (void) const |
Get the horizontal swing setting of the A/C. More... | |
void | setBeep (const bool on) |
Set the Beep toggle setting of the A/C. More... | |
bool | getBeep (void) const |
Get the Beep toggle setting of the A/C. More... | |
void | setClean (const bool on) |
Set the Clean toggle setting of the A/C. More... | |
bool | getClean (void) const |
Get the Clean toggle setting of the A/C. More... | |
void | setQuiet (const bool on) |
Set the Quiet setting of the A/C. More... | |
bool | getQuiet (void) const |
Get the Quiet setting of the A/C. More... | |
void | setPowerful (const bool on) |
Set the Powerful (Turbo) setting of the A/C. More... | |
bool | getPowerful (void) const |
Get the Powerful (Turbo) setting of the A/C. More... | |
void | setBreeze (const bool on) |
Closes the vanes over the fan outlet, to stop direct wind. Aka. WindFree. More... | |
bool | getBreeze (void) const |
Are the vanes closed over the fan outlet, to stop direct wind? Aka. WindFree. More... | |
void | setEcono (const bool on) |
Set the current Economy (Eco) setting of the A/C. More... | |
bool | getEcono (void) const |
Get the current Economy (Eco) setting of the A/C. More... | |
void | setDisplay (const bool on) |
Set the Display (Light/LED) setting of the A/C. More... | |
bool | getDisplay (void) const |
Get the Display (Light/LED) setting of the A/C. More... | |
void | setIon (const bool on) |
Set the Ion (Filter) setting of the A/C. More... | |
bool | getIon (void) const |
Get the Ion (Filter) setting of the A/C. More... | |
uint16_t | getOnTimer (void) const |
Get the On Timer setting of the A/C. More... | |
void | setOnTimer (const uint16_t nr_of_mins) |
Set the On Timer value of the A/C. More... | |
uint16_t | getOffTimer (void) const |
Get the Off Timer setting of the A/C. More... | |
void | setOffTimer (const uint16_t nr_of_mins) |
Set the Off Timer value of the A/C. More... | |
uint16_t | getSleepTimer (void) const |
Get the Sleep Timer setting of the A/C. More... | |
void | setSleepTimer (const uint16_t nr_of_mins) |
Set the Sleep Timer value of the A/C. More... | |
uint8_t * | getRaw (void) |
Get a PTR to the internal state/code for this protocol. More... | |
void | setRaw (const uint8_t new_code[], const uint16_t length=kSamsungAcStateLength) |
Set the internal state from a valid code for this protocol. More... | |
stdAc::state_t | toCommon (void) const |
Convert the current internal state into its stdAc::state_t equivalent. More... | |
String | toString (void) const |
Convert the current internal state into a human readable string. More... | |
Static Public Member Functions | |
static uint8_t | calcSectionChecksum (const uint8_t *section) |
Calculate the checksum for a given state section. More... | |
static uint8_t | getSectionChecksum (const uint8_t *section) |
Get the existing checksum for a given state section. More... | |
static bool | validChecksum (const uint8_t state[], const uint16_t length=kSamsungAcStateLength) |
Verify the checksum is valid for a given state. More... | |
static uint8_t | convertMode (const stdAc::opmode_t mode) |
Convert a stdAc::opmode_t enum into its native mode. More... | |
static uint8_t | convertFan (const stdAc::fanspeed_t speed) |
Convert a stdAc::fanspeed_t enum into it's native speed. More... | |
static stdAc::opmode_t | toCommonMode (const uint8_t mode) |
Convert a native mode into its stdAc equivalent. More... | |
static stdAc::fanspeed_t | toCommonFanSpeed (const uint8_t speed) |
Convert a native fan speed into its stdAc equivalent. More... | |
Private Member Functions | |
void | checksum (void) |
Update the checksum for the internal state. More... | |
uint16_t | _getOnTimer (void) const |
Get the On Timer setting of the A/C from a raw extended state. More... | |
uint16_t | _getOffTimer (void) const |
Get the Off Timer setting of the A/C from a raw extended state. More... | |
void | _setOnTimer (void) |
Set the current On Timer value of the A/C into the raw extended state. More... | |
void | _setOffTimer (void) |
Set the current Off Timer value of the A/C into the raw extended state. More... | |
void | _setSleepTimer (void) |
Private Attributes | |
IRsend | _irsend |
Instance of the IR send class. More... | |
SamsungProtocol | _ |
bool | _forceextended |
Flag to know when we need to send an extended mesg. More... | |
bool | _lastsentpowerstate |
bool | _OnTimerEnable |
bool | _OffTimerEnable |
bool | _Sleep |
bool | _lastSleep |
uint16_t | _OnTimer |
uint16_t | _OffTimer |
uint16_t | _lastOnTimer |
uint16_t | _lastOffTimer |
Class for handling detailed Samsung A/C messages.
|
explicit |
Class constructor.
[in] | pin | GPIO to be used when sending. |
[in] | inverted | Is the output signal to be inverted? |
[in] | use_modulation | Is frequency modulation to be used? |
|
private |
Get the Off Timer setting of the A/C from a raw extended state.
|
private |
Get the On Timer setting of the A/C from a raw extended state.
|
private |
Set the current Off Timer value of the A/C into the raw extended state.
|
private |
Set the current On Timer value of the A/C into the raw extended state.
|
private |
void IRSamsungAc::begin | ( | void | ) |
Set up hardware to be able to send a message.
|
static |
Calculate the checksum for a given state section.
[in] | section | The array to calc the checksum of. |
|
inline |
Run the calibration to calculate uSec timing offsets for this platform.
|
private |
Update the checksum for the internal state.
|
static |
Convert a stdAc::fanspeed_t enum into it's native speed.
[in] | speed | The enum to be converted. |
|
static |
Convert a stdAc::opmode_t enum into its native mode.
[in] | mode | The enum to be converted. |
bool IRSamsungAc::getBeep | ( | void | ) | const |
Get the Beep toggle setting of the A/C.
bool IRSamsungAc::getBreeze | ( | void | ) | const |
Are the vanes closed over the fan outlet, to stop direct wind? Aka. WindFree.
bool IRSamsungAc::getClean | ( | void | ) | const |
Get the Clean toggle setting of the A/C.
bool IRSamsungAc::getDisplay | ( | void | ) | const |
Get the Display (Light/LED) setting of the A/C.
bool IRSamsungAc::getEcono | ( | void | ) | const |
Get the current Economy (Eco) setting of the A/C.
uint8_t IRSamsungAc::getFan | ( | void | ) | const |
Get the current fan speed setting.
bool IRSamsungAc::getIon | ( | void | ) | const |
Get the Ion (Filter) setting of the A/C.
uint8_t IRSamsungAc::getMode | ( | void | ) | const |
Get the operating mode setting of the A/C.
uint16_t IRSamsungAc::getOffTimer | ( | void | ) | const |
Get the Off Timer setting of the A/C.
uint16_t IRSamsungAc::getOnTimer | ( | void | ) | const |
Get the On Timer setting of the A/C.
bool IRSamsungAc::getPower | ( | void | ) | const |
Get the value of the current power setting.
bool IRSamsungAc::getPowerful | ( | void | ) | const |
Get the Powerful (Turbo) setting of the A/C.
bool IRSamsungAc::getQuiet | ( | void | ) | const |
Get the Quiet setting of the A/C.
uint8_t * IRSamsungAc::getRaw | ( | void | ) |
Get a PTR to the internal state/code for this protocol.
|
static |
Get the existing checksum for a given state section.
[in] | section | The array to extract the checksum from. |
uint16_t IRSamsungAc::getSleepTimer | ( | void | ) | const |
Get the Sleep Timer setting of the A/C.
bool IRSamsungAc::getSwing | ( | void | ) | const |
Get the vertical swing setting of the A/C.
bool IRSamsungAc::getSwingH | ( | void | ) | const |
Get the horizontal swing setting of the A/C.
uint8_t IRSamsungAc::getTemp | ( | void | ) | const |
Get the current temperature setting.
void IRSamsungAc::off | ( | void | ) |
Set the requested power state of the A/C to off.
void IRSamsungAc::on | ( | void | ) |
Set the requested power state of the A/C to on.
void IRSamsungAc::send | ( | const uint16_t | repeat = kSamsungAcDefaultRepeat | ) |
Send the current internal state as an IR message.
[in] | repeat | Nr. of times the message will be repeated. |
void IRSamsungAc::sendExtended | ( | const uint16_t | repeat = kSamsungAcDefaultRepeat | ) |
Send the extended current internal state as an IR message.
[in] | repeat | Nr. of times the message will be repeated. |
void IRSamsungAc::sendOff | ( | const uint16_t | repeat = kSamsungAcDefaultRepeat | ) |
Send the special extended "Off" message as the library can't seem to reproduce this message automatically.
[in] | repeat | Nr. of times the message will be repeated. |
void IRSamsungAc::sendOn | ( | const uint16_t | repeat = kSamsungAcDefaultRepeat | ) |
Send the special extended "On" message as the library can't seem to reproduce this message automatically.
[in] | repeat | Nr. of times the message will be repeated. |
void IRSamsungAc::setBeep | ( | const bool | on | ) |
Set the Beep toggle setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setBreeze | ( | const bool | on | ) |
Closes the vanes over the fan outlet, to stop direct wind. Aka. WindFree.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setClean | ( | const bool | on | ) |
Set the Clean toggle setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setDisplay | ( | const bool | on | ) |
Set the Display (Light/LED) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setEcono | ( | const bool | on | ) |
Set the current Economy (Eco) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setFan | ( | const uint8_t | speed | ) |
Set the speed of the fan.
[in] | speed | The desired setting. |
void IRSamsungAc::setIon | ( | const bool | on | ) |
Set the Ion (Filter) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setMode | ( | const uint8_t | mode | ) |
Set the operating mode of the A/C.
[in] | mode | The desired operating mode. |
void IRSamsungAc::setOffTimer | ( | const uint16_t | nr_of_mins | ) |
Set the Off Timer value of the A/C.
[in] | nr_of_mins | The number of minutes the timer should be. |
void IRSamsungAc::setOnTimer | ( | const uint16_t | nr_of_mins | ) |
Set the On Timer value of the A/C.
[in] | nr_of_mins | The number of minutes the timer should be. |
void IRSamsungAc::setPower | ( | const bool | on | ) |
Change the power setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setPowerful | ( | const bool | on | ) |
Set the Powerful (Turbo) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setQuiet | ( | const bool | on | ) |
Set the Quiet setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setRaw | ( | const uint8_t | new_code[], |
const uint16_t | length = kSamsungAcStateLength |
||
) |
Set the internal state from a valid code for this protocol.
[in] | new_code | A valid code for this protocol. |
[in] | length | The length/size of the new_code array. |
void IRSamsungAc::setSleepTimer | ( | const uint16_t | nr_of_mins | ) |
Set the Sleep Timer value of the A/C.
[in] | nr_of_mins | The number of minutes the timer should be. |
void IRSamsungAc::setSwing | ( | const bool | on | ) |
Set the vertical swing setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setSwingH | ( | const bool | on | ) |
Set the horizontal swing setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSamsungAc::setTemp | ( | const uint8_t | temp | ) |
Set the temperature.
[in] | temp | The temperature in degrees celsius. |
void IRSamsungAc::stateReset | ( | const bool | extended = true , |
const bool | initialPower = true |
||
) |
Reset the internal state of the emulation.
[in] | extended | A flag indicating if force sending a special extended message with the first send() call. |
[in] | initialPower | Set the initial power state. True, on. False, off. |
stdAc::state_t IRSamsungAc::toCommon | ( | void | ) | const |
Convert the current internal state into its stdAc::state_t equivalent.
|
static |
|
static |
String IRSamsungAc::toString | ( | void | ) | const |
Convert the current internal state into a human readable string.
|
static |
Verify the checksum is valid for a given state.
[in] | state | The array to verify the checksum of. |
[in] | length | The length/size of the array. |
|
private |
|
private |
Flag to know when we need to send an extended mesg.
|
private |
Instance of the IR send class.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |