Go to the documentation of this file.
29 #define __STDC_LIMIT_MACROS
37 #include "IRsend_test.h"
109 #define TOSHIBA_AC_AUTO kToshibaAcAuto
110 #define TOSHIBA_AC_COOL kToshibaAcCool
111 #define TOSHIBA_AC_DRY kToshibaAcDry
112 #define TOSHIBA_AC_HEAT kToshibaAcHeat
113 #define TOSHIBA_AC_POWER kToshibaAcPower
114 #define TOSHIBA_AC_FAN_AUTO kToshibaAcFanAuto
115 #define TOSHIBA_AC_FAN_MAX kToshibaAcFanMax
116 #define TOSHIBA_AC_MIN_TEMP kToshibaAcMinTemp
117 #define TOSHIBA_AC_MAX_TEMP kToshibaAcMaxTemp
123 explicit IRToshibaAC(
const uint16_t pin,
const bool inverted =
false,
124 const bool use_modulation =
true);
133 #endif // SEND_TOSHIBA_AC
139 void setTemp(
const uint8_t degrees);
141 void setFan(
const uint8_t speed);
142 uint8_t
getFan(
void)
const;
147 void setMode(
const uint8_t mode);
148 uint8_t
getMode(
const bool raw =
false)
const;
149 void setRaw(
const uint8_t newState[],
153 const uint16_t size);
157 uint8_t
getSwing(
const bool raw =
true)
const;
158 void setSwing(
const uint8_t setting);
187 #endif // IR_TOSHIBA_H_
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Toshiba.cpp:190
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivalent.
Definition: ir_Toshiba.cpp:373
Class for handling detailed Toshiba A/C messages.
Definition: ir_Toshiba.h:121
bool getEcono(void) const
Get the Economy mode setting of the A/C.
Definition: ir_Toshiba.cpp:324
stdAc::state_t toCommon(const stdAc::state_t *prev=NULL) const
Convert the current internal state into its stdAc::state_t equivalent.
Definition: ir_Toshiba.cpp:400
void setSwing(const uint8_t setting)
Set the swing setting of the A/C.
Definition: ir_Toshiba.cpp:251
const uint8_t kToshibaAcCool
Definition: ir_Toshiba.h:95
void setTurbo(const bool on)
Set the Turbo (Powerful) setting of the A/C.
Definition: ir_Toshiba.cpp:313
uint8_t getSwing(const bool raw=true) const
Get the swing setting of the A/C.
Definition: ir_Toshiba.cpp:245
static uint8_t calcChecksum(const uint8_t state[], const uint16_t length=kToshibaACStateLength)
Calculate the checksum for a given state.
Definition: ir_Toshiba.cpp:155
uint8_t _swing_mode
The saved swing state/mode/command.
Definition: ir_Toshiba.h:178
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Toshiba.cpp:187
void _backupState(void)
Make a copy of the internal code-form A/C state.
Definition: ir_Toshiba.cpp:125
static uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Toshiba.cpp:345
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
static uint16_t getInternalStateLength(const uint8_t state[], const uint16_t size)
Get the length of the supplied Toshiba state per it's protocol structure.
Definition: ir_Toshiba.cpp:104
const uint8_t kToshibaAcFanAuto
Definition: ir_Toshiba.h:100
void send(const uint16_t repeat=kToshibaACMinRepeat)
Send the current internal state as IR messages.
Definition: ir_Toshiba.cpp:84
void setRaw(const uint8_t newState[], const uint16_t length=kToshibaACStateLength)
Set the internal state from a valid code for this protocol.
Definition: ir_Toshiba.cpp:145
void setEcono(const bool on)
Set the Economy mode setting of the A/C.
Definition: ir_Toshiba.cpp:333
const uint16_t kToshibaAcInvertedLength
Nr. of leading bytes in inverted pairs.
Definition: ir_Toshiba.h:83
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Toshiba.cpp:225
const uint8_t kToshibaAcMinTemp
17C
Definition: ir_Toshiba.h:91
IRsend _irsend
Instance of the IR send class.
Definition: ir_Toshiba.h:168
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Toshiba.h:132
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol with all integrity checks passing.
Definition: ir_Toshiba.cpp:137
void checksum(const uint16_t length=kToshibaACStateLength)
Calculate & set the checksum for the current internal state of the remote.
Definition: ir_Toshiba.cpp:173
uint8_t raw[kToshibaACStateLengthLong]
The state in code form.
Definition: ir_Toshiba.h:42
uint8_t EcoTurbo
Definition: ir_Toshiba.h:74
Class for sending all basic IR protocols.
Definition: IRsend.h:187
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
const uint8_t kToshibaAcSwingOn
0b001
Definition: ir_Toshiba.h:87
void setPower(const bool on)
Change the power setting.
Definition: ir_Toshiba.cpp:194
std::string String
Definition: IRremoteESP8266.h:1208
IRToshibaAC(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Toshiba.cpp:63
uint8_t Fan
Definition: ir_Toshiba.h:69
uint16_t getStateLength(void) const
Get the length of the current internal state per the protocol structure.
Definition: ir_Toshiba.cpp:113
String toString(void) const
Convert the current internal state into a human readable string.
Definition: ir_Toshiba.cpp:451
uint8_t LongMsg
Definition: ir_Toshiba.h:58
const uint8_t kToshibaAcSwingOff
0b010
Definition: ir_Toshiba.h:88
bool getPower(void) const
Get the value of the current power setting.
Definition: ir_Toshiba.cpp:205
const uint8_t kToshibaAcFanMed
Definition: ir_Toshiba.h:102
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Toshiba.cpp:79
const uint8_t kToshibaAcMinLength
Min Nr. of bytes in a message.
Definition: ir_Toshiba.h:81
const uint8_t kToshibaAcSwingStep
0b000
Definition: ir_Toshiba.h:86
void stateReset(void)
Reset the state of the remote to a known good state/sequence.
Definition: ir_Toshiba.cpp:69
void _restoreState(void)
Recover the internal code-form A/C state from the backup.
Definition: ir_Toshiba.cpp:130
uint8_t getTemp(void) const
Get the current temperature setting.
Definition: ir_Toshiba.cpp:219
const uint8_t kToshibaAcFan
Definition: ir_Toshiba.h:98
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivalent.
Definition: ir_Toshiba.cpp:387
const uint8_t kToshibaAcHeat
Definition: ir_Toshiba.h:97
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Toshiba.cpp:280
uint8_t Length
< Known lengths are: 1 (56 bit message) 3 (72 bit message) 4 (80 bit message)
Definition: ir_Toshiba.h:53
const uint8_t kToshibaAcTurboOn
Definition: ir_Toshiba.h:105
Native representation of a Toshiba A/C message.
Definition: ir_Toshiba.h:41
uint8_t Swing
Definition: ir_Toshiba.h:63
const uint8_t kToshibaAcLengthByte
Byte pos of the "length" attribute.
Definition: ir_Toshiba.h:80
uint8_t getMode(const bool raw=false) const
Get the operating mode setting of the A/C.
Definition: ir_Toshiba.cpp:267
uint8_t Mode
Definition: ir_Toshiba.h:67
const uint16_t kToshibaACMinRepeat
Definition: IRremoteESP8266.h:1104
const uint16_t kToshibaACStateLength
Definition: IRremoteESP8266.h:1102
bool _send_swing
Flag indicating if we need to send a swing message.
Definition: ir_Toshiba.h:177
const uint8_t kToshibaAcSwingToggle
0b100
Definition: ir_Toshiba.h:89
const uint16_t kToshibaACStateLengthLong
Definition: IRremoteESP8266.h:1107
static bool validChecksum(const uint8_t state[], const uint16_t length=kToshibaACStateLength)
Verify the checksum is valid for a given state.
Definition: ir_Toshiba.cpp:164
const uint8_t kToshibaAcDry
Definition: ir_Toshiba.h:96
uint8_t getFan(void) const
Get the current fan speed setting.
Definition: ir_Toshiba.cpp:236
uint8_t backup[kToshibaACStateLengthLong]
A backup copy of the state.
Definition: ir_Toshiba.h:175
uint8_t ShortMsg
Definition: ir_Toshiba.h:60
bool getTurbo(void) const
Get the Turbo (Powerful) setting of the A/C.
Definition: ir_Toshiba.cpp:304
const uint8_t kToshibaAcAuto
Definition: ir_Toshiba.h:94
const uint8_t kToshibaAcMaxTemp
30C
Definition: ir_Toshiba.h:92
static uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Toshiba.cpp:359
void setTemp(const uint8_t degrees)
Set the temperature.
Definition: ir_Toshiba.cpp:211
uint8_t Temp
Definition: ir_Toshiba.h:65
uint8_t _prev_mode
Store of the previously set mode.
Definition: ir_Toshiba.h:176
Structure to hold a common A/C state.
Definition: IRsend.h:97
const uint8_t kToshibaAcFanMax
Definition: ir_Toshiba.h:103
const uint8_t kToshibaAcEconoOn
Definition: ir_Toshiba.h:106
ToshibaProtocol _
Definition: ir_Toshiba.h:174
const uint8_t kToshibaAcFanMin
Definition: ir_Toshiba.h:101
void setStateLength(const uint16_t size)
Set the internal length of the current internal state per the protocol.
Definition: ir_Toshiba.cpp:119
const uint8_t kToshibaAcOff
Definition: ir_Toshiba.h:99
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46