Go to the documentation of this file.
19 #define __STDC_LIMIT_MACROS
27 #include "IRsend_test.h"
50 #define TOSHIBA_AC_AUTO kToshibaAcAuto
51 #define TOSHIBA_AC_COOL kToshibaAcCool
52 #define TOSHIBA_AC_DRY kToshibaAcDry
53 #define TOSHIBA_AC_HEAT kToshibaAcHeat
54 #define TOSHIBA_AC_POWER kToshibaAcPower
55 #define TOSHIBA_AC_FAN_AUTO kToshibaAcFanAuto
56 #define TOSHIBA_AC_FAN_MAX kToshibaAcFanMax
57 #define TOSHIBA_AC_MIN_TEMP kToshibaAcMinTemp
58 #define TOSHIBA_AC_MAX_TEMP kToshibaAcMaxTemp
64 explicit IRToshibaAC(
const uint16_t pin,
const bool inverted =
false,
65 const bool use_modulation =
true);
74 #endif // SEND_TOSHIBA_AC
80 void setTemp(
const uint8_t degrees);
82 void setFan(
const uint8_t speed);
84 void setMode(
const uint8_t mode);
85 uint8_t
getMode(
const bool useRaw =
false);
86 void setRaw(
const uint8_t newState[]);
112 #endif // IR_TOSHIBA_H_
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Toshiba.cpp:134
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivilant.
Definition: ir_Toshiba.cpp:249
Class for handling detailed Toshiba A/C messages.
Definition: ir_Toshiba.h:62
const uint8_t kToshibaAcCool
Definition: ir_Toshiba.h:34
static uint8_t calcChecksum(const uint8_t state[], const uint16_t length=kToshibaACStateLength)
Calculate the checksum for a given state.
Definition: ir_Toshiba.cpp:101
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Toshiba.cpp:131
uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Toshiba.cpp:222
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
const uint8_t kToshibaAcFanAuto
Definition: ir_Toshiba.h:40
void send(const uint16_t repeat=kToshibaACMinRepeat)
Send the current internal state as an IR message.
Definition: ir_Toshiba.cpp:78
const uint8_t kToshibaAcModeOffset
Definition: ir_Toshiba.h:31
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Toshiba.cpp:172
stdAc::state_t toCommon(void)
Convert the current internal state into its stdAc::state_t equivilant.
Definition: ir_Toshiba.cpp:274
const uint8_t kToshibaAcMinTemp
Definition: ir_Toshiba.h:46
IRsend _irsend
Instance of the IR send class.
Definition: ir_Toshiba.h:99
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Toshiba.h:73
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol.
Definition: ir_Toshiba.cpp:85
void checksum(const uint16_t length=kToshibaACStateLength)
Calculate & set the checksum for the current internal state of the remote.
Definition: ir_Toshiba.cpp:124
Class for sending all basic IR protocols.
Definition: IRsend.h:170
bool getPower(void)
Get the value of the current power setting.
Definition: ir_Toshiba.cpp:150
const uint8_t kToshibaAcPowerOffset
Definition: ir_Toshiba.h:37
int8_t calibrate(uint16_t hz=38000U)
Calculate & set any offsets to account for execution times during sending.
Definition: IRsend.cpp:207
String toString(void)
Convert the current internal state into a human readable string.
Definition: ir_Toshiba.cpp:300
void setPower(const bool on)
Change the power setting.
Definition: ir_Toshiba.cpp:138
std::string String
Definition: IRremoteESP8266.h:1093
IRToshibaAC(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Toshiba.cpp:59
const uint8_t kToshibaAcFanMed
Definition: ir_Toshiba.h:42
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Toshiba.cpp:73
void stateReset(void)
Reset the state of the remote to a known good state/sequence.
Definition: ir_Toshiba.cpp:65
const uint8_t kToshibaAcTempSize
Definition: ir_Toshiba.h:45
uint8_t getTemp(void)
Get the current temperature setting.
Definition: ir_Toshiba.cpp:165
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivilant.
Definition: ir_Toshiba.cpp:261
const uint8_t kToshibaAcHeat
Definition: ir_Toshiba.h:36
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Toshiba.cpp:203
const uint8_t kToshibaAcModeSize
Definition: ir_Toshiba.h:32
void setRaw(const uint8_t newState[])
Set the internal state from a valid code for this protocol.
Definition: ir_Toshiba.cpp:92
const uint16_t kToshibaACMinRepeat
Definition: IRremoteESP8266.h:1001
uint8_t getMode(const bool useRaw=false)
Get the operating mode setting of the A/C.
Definition: ir_Toshiba.cpp:193
const uint16_t kToshibaACStateLength
Definition: IRremoteESP8266.h:999
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:116
const uint8_t kToshibaAcFanSize
Definition: ir_Toshiba.h:39
const uint8_t kToshibaAcFanOffset
Definition: ir_Toshiba.h:38
uint8_t remote_state[kToshibaACStateLength]
The state in IR code form.
Definition: ir_Toshiba.h:105
const uint8_t kToshibaAcDry
Definition: ir_Toshiba.h:35
uint8_t mode_state
Definition: ir_Toshiba.h:109
const uint8_t kToshibaAcAuto
Definition: ir_Toshiba.h:33
const uint8_t kToshibaAcMaxTemp
Definition: ir_Toshiba.h:47
uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Toshiba.cpp:235
void setTemp(const uint8_t degrees)
Set the temperature.
Definition: ir_Toshiba.cpp:156
const uint8_t kToshibaAcTempOffset
Definition: ir_Toshiba.h:44
Structure to hold a common A/C state.
Definition: IRsend.h:97
uint8_t getFan(void)
Get the current fan speed setting.
Definition: ir_Toshiba.cpp:183
const uint8_t kToshibaAcFanMax
Definition: ir_Toshiba.h:43
const uint8_t kToshibaAcFanMin
Definition: ir_Toshiba.h:41
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46