Go to the documentation of this file.
26 #define __STDC_LIMIT_MACROS
34 #include "IRsend_test.h"
100 explicit IRSanyoAc(
const uint16_t pin,
const bool inverted =
false,
101 const bool use_modulation =
true);
110 #endif // SEND_SANYO_AC
116 void setTemp(
const uint8_t degrees);
120 void setFan(
const uint8_t speed);
122 void setMode(
const uint8_t mode);
132 void setRaw(
const uint8_t newState[]);
159 void _setTemp(uint8_t *ptr,
const uint8_t degrees);
163 #endif // IR_SANYO_H_
const uint8_t kSanyoAcSensorBit
Mask 0b00x00000.
Definition: ir_Sanyo.h:51
const uint8_t kSanyoAcTempByte
Index.
Definition: ir_Sanyo.h:43
const uint8_t kSanyoAcModeSize
Mask 0b0xxx0000.
Definition: ir_Sanyo.h:62
const uint8_t kSanyoAcTempDelta
Celsius to Native Temp difference.
Definition: ir_Sanyo.h:48
swingv_t
Common A/C settings for Vertical Swing.
Definition: IRsend.h:70
fanspeed_t
Common A/C settings for Fan Speeds.
Definition: IRsend.h:58
uint8_t remote_state[kSanyoAcStateLength]
The state in IR code form.
Definition: ir_Sanyo.h:155
uint8_t convertSwingV(const stdAc::swingv_t position)
Convert a stdAc::swingv_t enum into it's native setting.
Definition: ir_Sanyo.cpp:536
const uint8_t kSanyoAcHourMax
0b1111
Definition: ir_Sanyo.h:58
static uint8_t calcChecksum(const uint8_t state[], const uint16_t length=kSanyoAcStateLength)
Calculate the checksum for a given state.
Definition: ir_Sanyo.cpp:346
const uint8_t kSanyoAcOffHourSize
Mask 0b0000xxxx.
Definition: ir_Sanyo.h:57
void _setTemp(uint8_t *ptr, const uint8_t degrees)
Set the temperature at a given location.
Definition: ir_Sanyo.cpp:436
const uint8_t kSanyoAcCool
0b010
Definition: ir_Sanyo.h:64
const uint8_t kSanyoAcPowerOffset
Mask 0bxx000000.
Definition: ir_Sanyo.h:76
const uint8_t kSanyoAcPowerSize
Mask 0bxx000000.
Definition: ir_Sanyo.h:77
IRsend _irsend
Instance of the IR send class.
Definition: ir_Sanyo.h:149
const uint8_t kSanyoAcSleepBit
Mask 0b0000x000.
Definition: ir_Sanyo.h:92
void setPower(const bool on)
Change the power setting.
Definition: ir_Sanyo.cpp:374
const uint8_t kSanyoAcTempSize
Mask 0b000xxxxx.
Definition: ir_Sanyo.h:45
void send(const uint16_t repeat=kNoRepeat)
Send the current internal state as IR messages.
Definition: ir_Sanyo.cpp:323
const uint8_t kSanyoAcDry
0b011
Definition: ir_Sanyo.h:65
uint16_t getOffTimer(void)
Get the nr of minutes the Off Timer is set to.
Definition: ir_Sanyo.cpp:604
void setMode(const uint8_t mode)
Set the operating mode of the A/C.
Definition: ir_Sanyo.cpp:396
const uint8_t kSanyoAcFanOffset
Mask 0b000000xx.
Definition: ir_Sanyo.h:68
Class for sending all basic IR protocols.
Definition: IRsend.h:176
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 kSanyoAcSwingVHigh
0b110
Definition: ir_Sanyo.h:88
Class for handling detailed Sanyo A/C messages.
Definition: ir_Sanyo.h:98
const uint8_t kSanyoAcPowerOff
Off.
Definition: ir_Sanyo.h:79
void setSensor(const bool location)
Set the Sensor Location setting of the A/C. i.e. Where the ambient temperature is measured.
Definition: ir_Sanyo.cpp:577
std::string String
Definition: IRremoteESP8266.h:1128
uint8_t getMode(void)
Get the operating mode setting of the A/C.
Definition: ir_Sanyo.cpp:388
const uint8_t kSanyoAcFanAuto
0b00
Definition: ir_Sanyo.h:70
void setTemp(const uint8_t degrees)
Set the desired temperature.
Definition: ir_Sanyo.cpp:452
int8_t calibrate(void)
Run the calibration to calculate uSec timing offsets for this platform.
Definition: ir_Sanyo.h:109
const uint8_t kSanyoAcSwingVHighest
0b111
Definition: ir_Sanyo.h:89
uint8_t getTemp(void)
Get the current desired temperature setting.
Definition: ir_Sanyo.cpp:458
const uint8_t kSanyoAcSensorByte
Index.
Definition: ir_Sanyo.h:50
const uint8_t kSanyoAcSwingVAuto
0b000
Definition: ir_Sanyo.h:83
const uint16_t kNoRepeat
Definition: IRremoteESP8266.h:835
const uint8_t kSanyoAcModeOffset
Mask 0b0xxx0000.
Definition: ir_Sanyo.h:61
uint8_t getFan(void)
Get the current fan speed setting.
Definition: ir_Sanyo.cpp:483
const uint8_t kSanyoAcTempMin
Celsius.
Definition: ir_Sanyo.h:46
const uint8_t kSanyoAcFanHigh
0b01
Definition: ir_Sanyo.h:71
const uint8_t kSanyoAcSwingVLow
0b011
Definition: ir_Sanyo.h:85
IRSanyoAc(const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
Class constructor.
Definition: ir_Sanyo.cpp:305
bool getSleep(void)
Get the Sleep (Night Setback) setting of the A/C.
Definition: ir_Sanyo.cpp:570
bool getSensor(void)
Get the Sensor Location setting of the A/C. i.e. Where the ambient temperature is measured.
Definition: ir_Sanyo.cpp:584
void checksum(void)
Calculate & set the checksum for the current internal state of the remote.
Definition: ir_Sanyo.cpp:360
const uint8_t kSanyoAcAuto
0b100
Definition: ir_Sanyo.h:66
bool getBeep(void)
Get the Beep setting of the A/C.
Definition: ir_Sanyo.cpp:596
uint8_t convertMode(const stdAc::opmode_t mode)
Convert a stdAc::opmode_t enum into its native mode.
Definition: ir_Sanyo.cpp:412
void begin(void)
Set up hardware to be able to send a message.
Definition: ir_Sanyo.cpp:318
const uint8_t kSanyoAcSleepByte
Index.
Definition: ir_Sanyo.h:91
const uint8_t kSanyoAcOffTimerEnableBit
Mask 0b00000x00.
Definition: ir_Sanyo.h:67
const uint8_t kSanyoAcHeat
0b001
Definition: ir_Sanyo.h:63
void setSwingV(const uint8_t setting)
Set the vertical swing setting of the A/C.
Definition: ir_Sanyo.cpp:523
const uint8_t kSanyoAcModeByte
Index.
Definition: ir_Sanyo.h:60
static stdAc::swingv_t toCommonSwingV(const uint8_t setting)
Convert a native vertical swing postion to it's common equivalent.
Definition: ir_Sanyo.cpp:550
uint8_t convertFan(const stdAc::fanspeed_t speed)
Convert a stdAc::fanspeed_t enum into it's native speed.
Definition: ir_Sanyo.cpp:491
uint8_t getSensorTemp(void)
Get the current sensor temperature setting.
Definition: ir_Sanyo.cpp:470
static stdAc::opmode_t toCommonMode(const uint8_t mode)
Convert a native mode into its stdAc equivilant.
Definition: ir_Sanyo.cpp:424
const uint8_t kSanyoAcSwingVUpperMiddle
0b101
Definition: ir_Sanyo.h:87
const uint8_t kSanyoAcSwingVSize
Mask 0b00000xxx.
Definition: ir_Sanyo.h:82
const uint8_t kSanyoAcTempOffset
Mask 0b000xxxxx.
Definition: ir_Sanyo.h:44
uint8_t _getTemp(uint8_t *ptr)
Get the temperature from a given location.
Definition: ir_Sanyo.cpp:445
const uint8_t kSanyoAcSwingVOffset
Mask 0b00000xxx.
Definition: ir_Sanyo.h:81
const uint8_t kSanyoAcFanMedium
0b11
Definition: ir_Sanyo.h:73
bool getPower(void)
Get the value of the current power setting.
Definition: ir_Sanyo.cpp:381
void setSleep(const bool on)
Set the Sleep (Night Setback) setting of the A/C.
Definition: ir_Sanyo.cpp:564
const uint8_t kSanyoAcPowerOn
On.
Definition: ir_Sanyo.h:80
const uint8_t kSanyoAcTempMax
Celsius.
Definition: ir_Sanyo.h:47
const uint8_t kSanyoAcOffHourOffset
Mask 0b0000xxxx.
Definition: ir_Sanyo.h:56
void setFan(const uint8_t speed)
Set the speed of the fan.
Definition: ir_Sanyo.cpp:476
const uint8_t kSanyoAcFanLow
0b10
Definition: ir_Sanyo.h:72
const uint8_t kSanyoAcSwingVLowest
0b010
Definition: ir_Sanyo.h:84
const uint8_t kSanyoAcPowerByte
Index.
Definition: ir_Sanyo.h:75
const uint8_t kSanyoAcOffHourByte
Index.
Definition: ir_Sanyo.h:55
const uint8_t kSanyoAcSwingVLowerMiddle
0b100
Definition: ir_Sanyo.h:86
uint8_t getSwingV(void)
Get the vertical swing setting of the A/C.
Definition: ir_Sanyo.cpp:516
const uint8_t kSanyoAcFanSize
Mask 0b000000xx.
Definition: ir_Sanyo.h:69
void setBeep(const bool on)
Set the Beep setting of the A/C.
Definition: ir_Sanyo.cpp:590
const uint16_t kSanyoAcStateLength
Definition: IRremoteESP8266.h:1001
uint8_t * getRaw(void)
Get a PTR to the internal state/code for this protocol with all integrity checks passing.
Definition: ir_Sanyo.cpp:331
void setSensorTemp(const uint8_t degrees)
Set the sensor temperature.
Definition: ir_Sanyo.cpp:464
void stateReset(void)
Reset the state of the remote to a known good state/sequence.
Definition: ir_Sanyo.cpp:311
stdAc::state_t toCommon(void)
Convert the current internal state into its stdAc::state_t equivilant.
Definition: ir_Sanyo.cpp:625
void on(void)
Set the requested power state of the A/C to on.
Definition: ir_Sanyo.cpp:367
void setRaw(const uint8_t newState[])
Set the internal state from a valid code for this protocol.
Definition: ir_Sanyo.cpp:338
void setOffTimer(const uint16_t mins)
Set the nr of minutes for the Off Timer.
Definition: ir_Sanyo.cpp:616
static bool validChecksum(const uint8_t state[], const uint16_t length=kSanyoAcStateLength)
Verify the checksum is valid for a given state.
Definition: ir_Sanyo.cpp:355
String toString(void)
Convert the current internal state into a human readable string.
Definition: ir_Sanyo.cpp:651
Structure to hold a common A/C state.
Definition: IRsend.h:97
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed)
Convert a native fan speed into its stdAc equivilant.
Definition: ir_Sanyo.cpp:505
const uint8_t kSanyoAcBeepBit
Mask 0b0x000000.
Definition: ir_Sanyo.h:53
void off(void)
Set the requested power state of the A/C to off.
Definition: ir_Sanyo.cpp:370
opmode_t
Common A/C settings for A/C operating modes.
Definition: IRsend.h:46