IRremoteESP8266
|
Class for handling detailed Fujitsu A/C messages. More...
#include <ir_Fujitsu.h>
Public Member Functions | |
IRFujitsuAC (const uint16_t pin, const fujitsu_ac_remote_model_t model=ARRAH2E, const bool inverted=false, const bool use_modulation=true) | |
Class Constructor. More... | |
void | setModel (const fujitsu_ac_remote_model_t model) |
Set the currently emulated model of the A/C. More... | |
fujitsu_ac_remote_model_t | getModel (void) |
Get the currently emulated/detected model of the A/C. More... | |
void | stateReset (void) |
Reset the state of the remote to a known good state/sequence. More... | |
void | send (const uint16_t repeat=kFujitsuAcMinRepeat) |
Send the current internal state as an IR message. 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 | stepHoriz (void) |
Request the A/C to step the Horizontal Swing. More... | |
void | toggleSwingHoriz (const bool update=true) |
Request the A/C to toggle the Horizontal Swing mode. More... | |
void | stepVert (void) |
Request the A/C to step the Vertical Swing. More... | |
void | toggleSwingVert (const bool update=true) |
Request the A/C to toggle the Vertical Swing mode. More... | |
void | setCmd (const uint8_t cmd) |
Set the requested (special) command part for the A/C message. More... | |
uint8_t | getCmd (const bool raw=false) |
Set the requested (special) command part for the A/C message. More... | |
void | setTemp (const uint8_t temp) |
Set the temperature. More... | |
uint8_t | getTemp (void) |
Get the current temperature setting. More... | |
void | setFanSpeed (const uint8_t fan) |
Set the speed of the fan. More... | |
uint8_t | getFanSpeed (void) |
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) |
Get the operating mode setting of the A/C. More... | |
void | setSwing (const uint8_t mode) |
Set the requested swing operation mode of the A/C unit. More... | |
uint8_t | getSwing (const bool raw=false) |
Get the requested swing operation mode of the A/C unit. More... | |
uint8_t * | getRaw (void) |
Get a PTR to the internal state/code for this protocol. More... | |
bool | setRaw (const uint8_t newState[], const uint16_t length) |
Set the internal state from a valid code for this protocol. More... | |
uint8_t | getStateLength (void) |
Get the length (size) of the state code for the current configuration. More... | |
void | setPower (const bool on) |
Change the power setting. More... | |
void | off (void) |
Set the requested power state of the A/C to off. More... | |
void | on (void) |
Set the requested power state of the A/C to on. More... | |
bool | getPower (void) |
Get the value of the current power setting. More... | |
void | setClean (const bool on) |
Set the Clean mode of the A/C. More... | |
bool | getClean (const bool raw=false) |
Get the Clean mode status of the A/C. More... | |
void | setFilter (const bool on) |
Set the Filter mode status of the A/C. More... | |
bool | getFilter (const bool raw=false) |
Get the Filter mode status of the A/C. More... | |
void | setOutsideQuiet (const bool on) |
Set the Outside Quiet mode of the A/C. More... | |
bool | getOutsideQuiet (const bool raw=false) |
Get the Outside Quiet mode status of the A/C. More... | |
uint8_t | convertMode (const stdAc::opmode_t mode) |
Convert a stdAc::opmode_t enum into its native mode. More... | |
uint8_t | convertFan (stdAc::fanspeed_t speed) |
Convert a stdAc::fanspeed_t enum into it's native speed. More... | |
stdAc::state_t | toCommon (void) |
Convert the current internal state into its stdAc::state_t equivilant. More... | |
String | toString (void) |
Convert the current internal state into a human readable string. More... | |
Static Public Member Functions | |
static bool | validChecksum (uint8_t *state, const uint16_t length) |
Verify the checksum is valid for a given state. More... | |
static stdAc::opmode_t | toCommonMode (const uint8_t mode) |
Convert a native mode into its stdAc equivilant. More... | |
static stdAc::fanspeed_t | toCommonFanSpeed (const uint8_t speed) |
Convert a native fan speed into its stdAc equivilant. More... | |
Private Member Functions | |
void | buildState (void) |
(Re)Build the state from the currently configured settings. More... | |
void | buildFromState (const uint16_t length) |
Build the internal state/config from the current (raw) A/C message. More... | |
Private Attributes | |
IRsend | _irsend |
Instance of the IR send class. More... | |
uint8_t | remote_state [kFujitsuAcStateLength] |
The state of the IR remote. More... | |
uint8_t | _temp |
uint8_t | _fanSpeed |
uint8_t | _mode |
uint8_t | _swingMode |
uint8_t | _cmd |
fujitsu_ac_remote_model_t | _model |
uint8_t | _state_length |
uint8_t | _state_length_short |
bool | _outsideQuiet |
bool | _clean |
bool | _filter |
Class for handling detailed Fujitsu A/C messages.
|
explicit |
Class Constructor.
[in] | pin | GPIO to be used when sending. |
[in] | model | The enum for the model of A/C to be emulated. |
[in] | inverted | Is the output signal to be inverted? |
[in] | use_modulation | Is frequency modulation to be used? |
void IRFujitsuAC::begin | ( | void | ) |
Set up hardware to be able to send a message.
|
private |
Build the internal state/config from the current (raw) A/C message.
[in] | length | Size of the current/used (raw) A/C message array. |
|
private |
(Re)Build the state from the currently configured settings.
|
inline |
Run the calibration to calculate uSec timing offsets for this platform.
uint8_t IRFujitsuAC::convertFan | ( | stdAc::fanspeed_t | speed | ) |
Convert a stdAc::fanspeed_t enum into it's native speed.
[in] | speed | The enum to be converted. |
uint8_t IRFujitsuAC::convertMode | ( | const stdAc::opmode_t | mode | ) |
Convert a stdAc::opmode_t enum into its native mode.
[in] | mode | The enum to be converted. |
bool IRFujitsuAC::getClean | ( | const bool | raw = false | ) |
Get the Clean mode status of the A/C.
[in] | raw | Do we get the result from base data? |
uint8_t IRFujitsuAC::getCmd | ( | const bool | raw = false | ) |
Set the requested (special) command part for the A/C message.
[in] | raw | Do we need to get it from first principles from the raw data? |
uint8_t IRFujitsuAC::getFanSpeed | ( | void | ) |
Get the current fan speed setting.
bool IRFujitsuAC::getFilter | ( | const bool | raw = false | ) |
Get the Filter mode status of the A/C.
[in] | raw | Do we get the result from base data? |
uint8_t IRFujitsuAC::getMode | ( | void | ) |
Get the operating mode setting of the A/C.
fujitsu_ac_remote_model_t IRFujitsuAC::getModel | ( | void | ) |
Get the currently emulated/detected model of the A/C.
bool IRFujitsuAC::getOutsideQuiet | ( | const bool | raw = false | ) |
Get the Outside Quiet mode status of the A/C.
[in] | raw | Do we get the result from base data? |
bool IRFujitsuAC::getPower | ( | void | ) |
Get the value of the current power setting.
uint8_t * IRFujitsuAC::getRaw | ( | void | ) |
Get a PTR to the internal state/code for this protocol.
uint8_t IRFujitsuAC::getStateLength | ( | void | ) |
Get the length (size) of the state code for the current configuration.
uint8_t IRFujitsuAC::getSwing | ( | const bool | raw = false | ) |
Get the requested swing operation mode of the A/C unit.
[in] | raw | Do we need to get it from first principles from the raw data? |
uint8_t IRFujitsuAC::getTemp | ( | void | ) |
Get the current temperature setting.
void IRFujitsuAC::off | ( | void | ) |
Set the requested power state of the A/C to off.
void IRFujitsuAC::on | ( | void | ) |
Set the requested power state of the A/C to on.
void IRFujitsuAC::send | ( | const uint16_t | repeat = kFujitsuAcMinRepeat | ) |
Send the current internal state as an IR message.
[in] | repeat | Nr. of times the message will be repeated. |
void IRFujitsuAC::setClean | ( | const bool | on | ) |
Set the Clean mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRFujitsuAC::setCmd | ( | const uint8_t | cmd | ) |
Set the requested (special) command part for the A/C message.
[in] | cmd | The special command code. |
void IRFujitsuAC::setFanSpeed | ( | const uint8_t | fanSpeed | ) |
Set the speed of the fan.
[in] | fanSpeed | The desired setting. |
void IRFujitsuAC::setFilter | ( | const bool | on | ) |
Set the Filter mode status of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRFujitsuAC::setMode | ( | const uint8_t | mode | ) |
Set the operating mode of the A/C.
[in] | mode | The desired operating mode. |
void IRFujitsuAC::setModel | ( | const fujitsu_ac_remote_model_t | model | ) |
Set the currently emulated model of the A/C.
[in] | model | An enum representing the model to support/emulate. |
void IRFujitsuAC::setOutsideQuiet | ( | const bool | on | ) |
Set the Outside Quiet mode of the A/C.
[in] | on | true, the setting is on. false, the setting is off. |
void IRFujitsuAC::setPower | ( | const bool | on | ) |
Change the power setting.
[in] | on | true, the setting is on. false, the setting is off. |
bool IRFujitsuAC::setRaw | ( | const uint8_t | newState[], |
const uint16_t | length | ||
) |
Set the internal state from a valid code for this protocol.
[in] | newState | A valid code for this protocol. |
[in] | length | Size of the newState array. |
void IRFujitsuAC::setSwing | ( | const uint8_t | swingMode | ) |
Set the requested swing operation mode of the A/C unit.
[in] | swingMode | The swingMode code for the A/C. Vertical, Horizon, or Both. See constants for details. |
void IRFujitsuAC::setTemp | ( | const uint8_t | temp | ) |
Set the temperature.
[in] | temp | The temperature in degrees celsius. |
void IRFujitsuAC::stateReset | ( | void | ) |
Reset the state of the remote to a known good state/sequence.
void IRFujitsuAC::stepHoriz | ( | void | ) |
Request the A/C to step the Horizontal Swing.
void IRFujitsuAC::stepVert | ( | void | ) |
Request the A/C to step the Vertical Swing.
stdAc::state_t IRFujitsuAC::toCommon | ( | void | ) |
Convert the current internal state into its stdAc::state_t equivilant.
|
static |
|
static |
void IRFujitsuAC::toggleSwingHoriz | ( | const bool | update = true | ) |
Request the A/C to toggle the Horizontal Swing mode.
[in] | update | Do we need to update the general swing config? |
void IRFujitsuAC::toggleSwingVert | ( | const bool | update = true | ) |
Request the A/C to toggle the Vertical Swing mode.
[in] | update | Do we need to update the general swing config? |
String IRFujitsuAC::toString | ( | void | ) |
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 of the state array. |
|
private |
|
private |
|
private |
|
private |
|
private |
Instance of the IR send class.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
The state of the IR remote.