Go to the documentation of this file.
48 #define __STDC_LIMIT_MACROS
57 #include "IRsend_test.h"
156 #define FUJITSU_AC_MODE_AUTO kFujitsuAcModeAuto
157 #define FUJITSU_AC_MODE_COOL kFujitsuAcModeCool
158 #define FUJITSU_AC_MODE_DRY kFujitsuAcModeDry
159 #define FUJITSU_AC_MODE_FAN kFujitsuAcModeFan
160 #define FUJITSU_AC_MODE_HEAT kFujitsuAcModeHeat
161 #define FUJITSU_AC_CMD_STAY_ON kFujitsuAcCmdStayOn
162 #define FUJITSU_AC_CMD_TURN_ON kFujitsuAcCmdTurnOn
163 #define FUJITSU_AC_CMD_TURN_OFF kFujitsuAcCmdTurnOff
164 #define FUJITSU_AC_CMD_STEP_HORIZ kFujitsuAcCmdStepHoriz
165 #define FUJITSU_AC_CMD_STEP_VERT kFujitsuAcCmdStepVert
166 #define FUJITSU_AC_FAN_AUTO kFujitsuAcFanAuto
167 #define FUJITSU_AC_FAN_HIGH kFujitsuAcFanHigh
168 #define FUJITSU_AC_FAN_MED kFujitsuAcFanMed
169 #define FUJITSU_AC_FAN_LOW kFujitsuAcFanLow
170 #define FUJITSU_AC_FAN_QUIET kFujitsuAcFanQuiet
171 #define FUJITSU_AC_MIN_TEMP kFujitsuAcMinTemp
172 #define FUJITSU_AC_MAX_TEMP kFujitsuAcMaxTemp
173 #define FUJITSU_AC_SWING_OFF kFujitsuAcSwingOff
174 #define FUJITSU_AC_SWING_VERT kFujitsuAcSwingVert
175 #define FUJITSU_AC_SWING_HORIZ kFujitsuAcSwingHoriz
176 #define FUJITSU_AC_SWING_BOTH kFujitsuAcSwingBoth
183 const bool inverted =
false,
184 const bool use_modulation =
true);
195 #endif // SEND_FUJITSU_AC
201 void setCmd(
const uint8_t cmd);
202 uint8_t
getCmd(
void)
const;
203 void setTemp(
const float temp,
const bool useCelsius =
true);
207 void setMode(
const uint8_t mode);
212 bool setRaw(
const uint8_t newState[],
const uint16_t length);
214 static bool validChecksum(uint8_t* state,
const uint16_t length);
235 void setId(
const uint8_t num);
236 uint8_t
getId(
void)
const;
266 #endif // IR_FUJITSU_H_
uint64_t OffTimerEnable
Definition: ir_Fujitsu.h:97
void setOnTimer(const uint16_t nr_mins)
Set the On Timer setting of the A/C.
Definition: ir_Fujitsu.cpp:660
float getTemp(void) const
Get the current temperature setting.
Definition: ir_Fujitsu.cpp:488
const uint8_t kFujitsuAcCmdTurnOff
Definition: ir_Fujitsu.h:121
uint16_t getOnTimer(void) const
Get the On Timer setting of the A/C.
Definition: ir_Fujitsu.cpp:652
const float kFujitsuAcMinTemp
Definition: ir_Fujitsu.h:136
const uint16_t kFujitsuAcMinRepeat
Definition: IRremoteESP8266.h:1239
void set10CHeat(const bool on)
Set the 10C heat status of the A/C.
Definition: ir_Fujitsu.cpp:594
uint8_t _cmd
Definition: ir_Fujitsu.h:255
uint64_t Id
Definition: ir_Fujitsu.h:71
uint8_t getCmd(void) const
Set the requested (special) command part for the A/C message.
Definition: ir_Fujitsu.cpp:401
uint8_t getTimerType(void) const
Get the Timer type of the A/C message.
Definition: ir_Fujitsu.cpp:626
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:61
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Fujitsu.h:194
void setClean(const bool on)
Set the Clean mode of the A/C.
Definition: ir_Fujitsu.cpp:560
uint8_t getFanSpeed(void) const
Get the current fan speed setting.
Definition: ir_Fujitsu.cpp:512
const uint8_t kFujitsuAcCmdToggleSwingVert
Definition: ir_Fujitsu.h:125
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Fujitsu.cpp:257
void setTimerType(const uint8_t timertype)
Set the Timer type of the A/C message.
Definition: ir_Fujitsu.cpp:637
uint8_t getMode(void) const
Get the operating mode setting of the A/C.
Definition: ir_Fujitsu.cpp:527
stdAc::state_t toCommon(const stdAc::state_t *prev=NULL)
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Fujitsu.cpp:810
void stepVert(void)
Request the A/C to step the Vertical Swing.
Definition: ir_Fujitsu.cpp:348
bool isLongCode(void) const
Is the current binary state representation a long or a short code?
Definition: ir_Fujitsu.cpp:251
const float kFujitsuAcMinTempF
Definition: ir_Fujitsu.h:140
void setCelsius(const bool on)
Set the Temperature units for the A/C.
Definition: ir_Fujitsu.cpp:745
Class for sending all basic IR protocols.
Definition: IRsend.h:237
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Fujitsu.cpp:757
void stateReset(void)
Reset the state of the remote to a known good state/sequence.
Definition: ir_Fujitsu.cpp:101
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
uint64_t TimerType
Definition: ir_Fujitsu.h:88
uint64_t Power
Definition: ir_Fujitsu.h:82
uint8_t getSwing(void) const
Get the requested swing operation mode of the A/C unit.
Definition: ir_Fujitsu.cpp:556
uint64_t Fan
Definition: ir_Fujitsu.h:91
const uint8_t kFujitsuAcFanAuto
Definition: ir_Fujitsu.h:129
bool setRaw(const uint8_t newState[], const uint16_t length)
Set the internal state from a valid code for this protocol.
Definition: ir_Fujitsu.cpp:322
std::string String
Definition: IRremoteESP8266.h:1521
uint64_t OutsideQuiet
Definition: ir_Fujitsu.h:106
bool getOutsideQuiet(void) const
Get the Outside Quiet mode status of the A/C.
Definition: ir_Fujitsu.cpp:431
bool updateUseLongOrShort(void)
Update the length (size) of the state code for the current configuration.
Definition: ir_Fujitsu.cpp:135
const float kFujitsuAcMinHeat
Definition: ir_Fujitsu.h:135
Native representation of a Fujitsu A/C message.
Definition: ir_Fujitsu.h:61
const uint8_t kFujitsuAcCmdTurnOn
Definition: ir_Fujitsu.h:120
uint8_t _state_length_short
Definition: ir_Fujitsu.h:258
bool getClean(void) const
Get the Clean mode status of the A/C.
Definition: ir_Fujitsu.cpp:568
const uint8_t kFujitsuAcFanHigh
Definition: ir_Fujitsu.h:130
uint64_t Swing
Definition: ir_Fujitsu.h:93
const float kFujitsuAcMaxTemp
Definition: ir_Fujitsu.h:137
uint64_t OffTimer
Definition: ir_Fujitsu.h:96
const uint8_t kFujitsuAcModeHeat
Definition: ir_Fujitsu.h:117
void setFilter(const bool on)
Set the Filter mode status of the A/C.
Definition: ir_Fujitsu.cpp:577
static uint8_t convertFan(stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Fujitsu.cpp:770
uint64_t Fahrenheit
Definition: ir_Fujitsu.h:83
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Fujitsu.cpp:419
FujitsuProtocol _
Definition: ir_Fujitsu.h:254
void stepHoriz(void)
Request the A/C to step the Horizontal Swing.
Definition: ir_Fujitsu.cpp:336
const uint8_t kFujitsuAcCmdToggleSwingHoriz
Definition: ir_Fujitsu.h:127
uint64_t Protocol
Definition: ir_Fujitsu.h:80
IRsend _irsend
Instance of the IR send class.
Definition: ir_Fujitsu.h:248
uint64_t OnTimerEnable
Definition: ir_Fujitsu.h:99
fujitsu_ac_remote_model_t
Fujitsu A/C model numbers.
Definition: IRsend.h:140
const uint8_t kFujitsuAcStopTimers
Definition: ir_Fujitsu.h:149
void setCmd(const uint8_t cmd)
Set the requested (special) command part for the A/C message.
Definition: ir_Fujitsu.cpp:361
void setOffTimer(const uint16_t nr_mins)
Set the Off Timer time for the A/C.
Definition: ir_Fujitsu.cpp:689
void buildFromState(const uint16_t length)
Build the internal state/config from the current (raw) A/C message.
Definition: ir_Fujitsu.cpp:264
uint64_t OnTimer
Definition: ir_Fujitsu.h:98
uint64_t Mode
Definition: ir_Fujitsu.h:86
uint64_t Cmd
Definition: ir_Fujitsu.h:76
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Fujitsu.cpp:123
void setTemp(const float temp, const bool useCelsius=true)
Set the temperature.
Definition: ir_Fujitsu.cpp:444
void setId(const uint8_t num)
Set the device's remote ID number.
Definition: ir_Fujitsu.cpp:734
bool _rawstatemodified
Definition: ir_Fujitsu.h:259
const uint16_t kFujitsuAcStateLengthShort
Definition: IRremoteESP8266.h:1241
Class for handling detailed Fujitsu A/C messages.
Definition: ir_Fujitsu.h:179
const uint8_t kFujitsuAcCmdStepVert
Definition: ir_Fujitsu.h:124
void setSwing(const uint8_t mode)
Set the requested swing operation mode of the A/C unit.
Definition: ir_Fujitsu.cpp:533
const uint16_t kFujitsuAcStateLength
Definition: IRremoteESP8266.h:1240
const uint8_t kFujitsuAcCmdPowerful
Definition: ir_Fujitsu.h:123
uint64_t Temp
Definition: ir_Fujitsu.h:84
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Fujitsu.cpp:784
bool getCelsius(void) const
Get the Clean mode status of the A/C.
Definition: ir_Fujitsu.cpp:752
const uint8_t kFujitsuAcCmdStepHoriz
Definition: ir_Fujitsu.h:126
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Fujitsu.cpp:516
const uint8_t kFujitsuAcSwingHoriz
Definition: ir_Fujitsu.h:146
const uint8_t kFujitsuAcSwingVert
Definition: ir_Fujitsu.h:145
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Fujitsu.cpp:797
bool getFilter(void) const
Get the Filter mode status of the A/C.
Definition: ir_Fujitsu.cpp:585
void toggleSwingVert(const bool update=true)
Request the A/C to toggle the Vertical Swing mode.
Definition: ir_Fujitsu.cpp:352
bool get10CHeat(void) const
Get the 10C heat status of the A/C.
Definition: ir_Fujitsu.cpp:614
const float kFujitsuAcMaxTempF
Definition: ir_Fujitsu.h:141
uint64_t Clean
Definition: ir_Fujitsu.h:87
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Fujitsu.cpp:862
uint8_t getId(void) const
Get the current device's remote ID number.
Definition: ir_Fujitsu.cpp:741
const uint8_t kFujitsuAcModeAuto
Definition: ir_Fujitsu.h:113
const float kFujitsuAcMinHeatF
Definition: ir_Fujitsu.h:139
void setOutsideQuiet(const bool on)
Set the Outside Quiet mode of the A/C.
Definition: ir_Fujitsu.cpp:423
uint8_t shortcode[kFujitsuAcStateLengthShort]
Definition: ir_Fujitsu.h:64
const uint8_t kFujitsuAcSwingOff
Definition: ir_Fujitsu.h:144
void setModel(const fujitsu_ac_remote_model_t model)
Set the currently emulated model of the A/C.
Definition: ir_Fujitsu.cpp:79
const uint8_t kFujitsuAcModeDry
Definition: ir_Fujitsu.h:115
@ ARRAH2E
(1) AR-RAH2E, AR-RAC1E, AR-RAE1E, AR-RCE1E, AR-RAH2U, AR-REG1U (Default) Warning: Use on incorrect mo...
Definition: IRsend.h:141
const uint8_t kFujitsuAcSleepTimer
Definition: ir_Fujitsu.h:150
uint8_t getStateLength(void)
Get the length (size) of the state code for the current configuration.
Definition: ir_Fujitsu.cpp:245
const uint8_t kFujitsuAcTempOffsetC
Definition: ir_Fujitsu.h:138
const uint8_t kFujitsuAcFanMed
Definition: ir_Fujitsu.h:131
IRFujitsuAC(const uint16_t pin, const fujitsu_ac_remote_model_t model=ARRAH2E, const bool inverted=false, const bool use_modulation=true)
Class Constructor.
Definition: ir_Fujitsu.cpp:69
void setSleepTimer(const uint16_t nr_mins)
Set the Sleep Timer time for the A/C.
Definition: ir_Fujitsu.cpp:699
const uint8_t kFujitsuAcTempOffsetF
Definition: ir_Fujitsu.h:142
const uint8_t kFujitsuAcSwingBoth
Definition: ir_Fujitsu.h:147
fujitsu_ac_remote_model_t _model
Definition: ir_Fujitsu.h:256
uint64_t Filter
Definition: ir_Fujitsu.h:102
const uint8_t kFujitsuAcCmdStayOn
Definition: ir_Fujitsu.h:119
uint64_t unknown
Definition: ir_Fujitsu.h:104
fujitsu_ac_remote_model_t getModel(void) const
Get the currently emulated/detected model of the A/C.
Definition: ir_Fujitsu.cpp:98
const uint8_t kFujitsuAcOnTimer
Definition: ir_Fujitsu.h:152
void setFanSpeed(const uint8_t fan)
Set the speed of the fan.
Definition: ir_Fujitsu.cpp:501
const uint8_t kFujitsuAcOffTimer
Definition: ir_Fujitsu.h:151
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Fujitsu.cpp:412
void setPower(const bool on)
Change the power setting.
Definition: ir_Fujitsu.cpp:407
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Fujitsu.cpp:415
void send(const uint16_t repeat=kFujitsuAcMinRepeat)
Send the current internal state as an IR message.
Definition: ir_Fujitsu.cpp:128
void setOffSleepTimer(const uint16_t nr_mins)
Set the Off/Sleep Timer time for the A/C.
Definition: ir_Fujitsu.cpp:682
void checkSum(void)
Calculate and set the checksum values for the internal state.
Definition: ir_Fujitsu.cpp:170
static bool validChecksum(uint8_t *state, const uint16_t length)
Verify the checksum is valid for a given state.
Definition: ir_Fujitsu.cpp:711
uint16_t getOffSleepTimer(void) const
Get the Off/Sleep Timer setting of the A/C.
Definition: ir_Fujitsu.cpp:672
uint8_t _state_length
Definition: ir_Fujitsu.h:257
const uint16_t kFujitsuAcTimerMax
Minutes.
Definition: ir_Fujitsu.h:153
void toggleSwingHoriz(const bool update=true)
Request the A/C to toggle the Horizontal Swing mode.
Definition: ir_Fujitsu.cpp:340
const uint8_t kFujitsuAcModeFan
Definition: ir_Fujitsu.h:116
Structure to hold a common A/C state.
Definition: IRsend.h:114
const uint8_t kFujitsuAcCmdEcono
Definition: ir_Fujitsu.h:122
const uint8_t kFujitsuAcFanQuiet
Definition: ir_Fujitsu.h:133
uint64_t RestLength
Definition: ir_Fujitsu.h:78
uint8_t longcode[kFujitsuAcStateLength]
The state of the IR remote.
Definition: ir_Fujitsu.h:63
const uint8_t kFujitsuAcFanLow
Definition: ir_Fujitsu.h:132
const uint8_t kFujitsuAcModeCool
Definition: ir_Fujitsu.h:114
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:49