IRremoteESP8266
|
Class for handling detailed Sanyo A/C messages. More...
#include <ir_Sanyo.h>
Public Member Functions | |
IRSanyoAc (const uint16_t pin, const bool inverted=false, const bool use_modulation=true) | |
Class constructor. More... | |
void | stateReset (void) |
Reset the state of the remote to a known good state/sequence. More... | |
void | send (const uint16_t repeat=kNoRepeat) |
Send the current internal state as IR messages. 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 degrees) |
Set the desired temperature. More... | |
uint8_t | getTemp (void) const |
Get the current desired temperature setting. More... | |
void | setSensorTemp (const uint8_t degrees) |
Set the sensor temperature. More... | |
uint8_t | getSensorTemp (void) const |
Get the current sensor 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 | setSleep (const bool on) |
Set the Sleep (Night Setback) setting of the A/C. More... | |
bool | getSleep (void) const |
Get the Sleep (Night Setback) setting of the A/C. More... | |
void | setSensor (const bool location) |
Set the Sensor Location setting of the A/C. i.e. Where the ambient temperature is measured. More... | |
bool | getSensor (void) const |
Get the Sensor Location setting of the A/C. i.e. Where the ambient temperature is measured. More... | |
void | setBeep (const bool on) |
Set the Beep setting of the A/C. More... | |
bool | getBeep (void) const |
Get the Beep setting of the A/C. More... | |
void | setSwingV (const uint8_t setting) |
Set the vertical swing setting of the A/C. More... | |
uint8_t | getSwingV (void) const |
Get the vertical swing setting of the A/C. More... | |
void | setRaw (const uint8_t newState[]) |
Set the internal state from a valid code for this protocol. More... | |
uint8_t * | getRaw (void) |
Get a PTR to the internal state/code for this protocol with all integrity checks passing. More... | |
uint16_t | getOffTimer (void) const |
Get the nr of minutes the Off Timer is set to. More... | |
void | setOffTimer (const uint16_t mins) |
Set the nr of minutes for the Off Timer. 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 bool | validChecksum (const uint8_t state[], const uint16_t length=kSanyoAcStateLength) |
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 uint8_t | convertSwingV (const stdAc::swingv_t position) |
Convert a stdAc::swingv_t enum into it's native setting. 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... | |
static stdAc::swingv_t | toCommonSwingV (const uint8_t setting) |
Convert a native vertical swing postion to it's common equivalent. More... | |
Private Member Functions | |
void | checksum (void) |
Calculate & set the checksum for the current internal state of the remote. More... | |
Static Private Member Functions | |
static uint8_t | calcChecksum (const uint8_t state[], const uint16_t length=kSanyoAcStateLength) |
Calculate the checksum for a given state. More... | |
Private Attributes | |
IRsend | _irsend |
Instance of the IR send class. More... | |
SanyoProtocol | _ |
Class for handling detailed Sanyo 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? |
void IRSanyoAc::begin | ( | void | ) |
Set up hardware to be able to send a message.
|
staticprivate |
Calculate the checksum for a given state.
[in] | state | The array to calc the checksum of. |
[in] | length | The length/size of the array. |
|
inline |
Run the calibration to calculate uSec timing offsets for this platform.
|
private |
Calculate & set the checksum for the current internal state of the remote.
|
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. |
|
static |
Convert a stdAc::swingv_t enum into it's native setting.
[in] | position | The enum to be converted. |
bool IRSanyoAc::getBeep | ( | void | ) | const |
Get the Beep setting of the A/C.
uint8_t IRSanyoAc::getFan | ( | void | ) | const |
Get the current fan speed setting.
uint8_t IRSanyoAc::getMode | ( | void | ) | const |
Get the operating mode setting of the A/C.
uint16_t IRSanyoAc::getOffTimer | ( | void | ) | const |
Get the nr of minutes the Off Timer is set to.
bool IRSanyoAc::getPower | ( | void | ) | const |
Get the value of the current power setting.
uint8_t * IRSanyoAc::getRaw | ( | void | ) |
Get a PTR to the internal state/code for this protocol with all integrity checks passing.
bool IRSanyoAc::getSensor | ( | void | ) | const |
Get the Sensor Location setting of the A/C. i.e. Where the ambient temperature is measured.
uint8_t IRSanyoAc::getSensorTemp | ( | void | ) | const |
Get the current sensor temperature setting.
bool IRSanyoAc::getSleep | ( | void | ) | const |
Get the Sleep (Night Setback) setting of the A/C.
uint8_t IRSanyoAc::getSwingV | ( | void | ) | const |
Get the vertical swing setting of the A/C.
uint8_t IRSanyoAc::getTemp | ( | void | ) | const |
Get the current desired temperature setting.
void IRSanyoAc::off | ( | void | ) |
Set the requested power state of the A/C to off.
void IRSanyoAc::on | ( | void | ) |
Set the requested power state of the A/C to on.
void IRSanyoAc::send | ( | const uint16_t | repeat = kNoRepeat | ) |
Send the current internal state as IR messages.
[in] | repeat | Nr. of times the message will be repeated. |
void IRSanyoAc::setBeep | ( | const bool | on | ) |
Set the Beep setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSanyoAc::setFan | ( | const uint8_t | speed | ) |
Set the speed of the fan.
[in] | speed | The desired setting. |
void IRSanyoAc::setMode | ( | const uint8_t | mode | ) |
Set the operating mode of the A/C.
[in] | mode | The desired operating mode. |
void IRSanyoAc::setOffTimer | ( | const uint16_t | mins | ) |
Set the nr of minutes for the Off Timer.
[in] | mins | The timer time expressed as nr. of minutes. A value of 0 means the Off Timer is off/disabled. |
void IRSanyoAc::setPower | ( | const bool | on | ) |
Change the power setting.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSanyoAc::setRaw | ( | const uint8_t | newState[] | ) |
Set the internal state from a valid code for this protocol.
[in] | newState | A valid code for this protocol. |
void IRSanyoAc::setSensor | ( | const bool | location | ) |
Set the Sensor Location setting of the A/C. i.e. Where the ambient temperature is measured.
[in] | location | true is Unit/Wall, false is Remote/Room. |
void IRSanyoAc::setSensorTemp | ( | const uint8_t | degrees | ) |
Set the sensor temperature.
[in] | degrees | The temperature in degrees celsius. |
void IRSanyoAc::setSleep | ( | const bool | on | ) |
Set the Sleep (Night Setback) setting of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRSanyoAc::setSwingV | ( | const uint8_t | setting | ) |
Set the vertical swing setting of the A/C.
[in] | setting | The value of the desired setting. |
void IRSanyoAc::setTemp | ( | const uint8_t | degrees | ) |
Set the desired temperature.
[in] | degrees | The temperature in degrees celsius. |
void IRSanyoAc::stateReset | ( | void | ) |
Reset the state of the remote to a known good state/sequence.
stdAc::state_t IRSanyoAc::toCommon | ( | void | ) | const |
Convert the current internal state into its stdAc::state_t equivalent.
|
static |
|
static |
|
static |
Convert a native vertical swing postion to it's common equivalent.
[in] | setting | A native position to convert. |
String IRSanyoAc::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 |
Instance of the IR send class.