IRremoteESP8266
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
IRHitachiAc424 Class Reference

Class for handling detailed Hitachi 53-byte/424-bit A/C messages. More...

#include <ir_Hitachi.h>

Inheritance diagram for IRHitachiAc424:
Inheritance graph
[legend]
Collaboration diagram for IRHitachiAc424:
Collaboration graph
[legend]

Public Member Functions

 IRHitachiAc424 (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
 Class constructor. More...
 
virtual void stateReset (void)
 Reset the internal state to a fixed known good state. More...
 
virtual void send (const uint16_t repeat=kHitachiAcDefaultRepeat)
 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 on (void)
 Change the power setting to On. More...
 
void off (void)
 Change the power setting to Off. More...
 
void setPower (const bool on)
 Change the power setting. More...
 
bool getPower (void) const
 Get the value of the current power setting. More...
 
void setTemp (const uint8_t temp, bool setPrevious=true)
 Set the temperature. More...
 
uint8_t getTemp (void) const
 Get the current temperature setting. More...
 
virtual void setFan (const uint8_t speed)
 Set the speed of the fan. More...
 
uint8_t getFan (void) const
 Get the current fan speed setting. More...
 
uint8_t getButton (void) const
 Get the Button/Command setting of the A/C. More...
 
void setButton (const uint8_t button)
 Set the Button/Command pressed setting of the A/C. More...
 
void setSwingVToggle (const bool on)
 Set the Vertical Swing toggle setting of the A/C. More...
 
bool getSwingVToggle (void) const
 Get the Vertical Swing toggle setting of the A/C. More...
 
void setMode (const uint8_t mode)
 Set the operating mode of the A/C. More...
 
uint8_t getMode (void) const
 Get the operating mode setting of the A/C. More...
 
uint8_t * getRaw (void)
 Get a PTR to the internal state/code for this protocol. More...
 
virtual void setRaw (const uint8_t new_code[], const uint16_t length=kHitachiAc424StateLength)
 Set the internal state from a valid code for this protocol. More...
 
virtual uint8_t convertFan (const stdAc::fanspeed_t speed) const
 Convert a stdAc::fanspeed_t enum into it's native speed. More...
 
virtual stdAc::fanspeed_t toCommonFanSpeed (const uint8_t speed) const
 Convert a native fan speed into its stdAc equivalent. More...
 
virtual stdAc::state_t toCommon (void) const
 Convert the current internal state into its stdAc::state_t equivalent. More...
 
virtual String toString (void) const
 Convert the internal state into a human readable string. More...
 

Static Public Member Functions

static uint8_t convertMode (const stdAc::opmode_t mode)
 Convert a stdAc::opmode_t enum into its native mode. More...
 
static stdAc::opmode_t toCommonMode (const uint8_t mode)
 Convert a native mode into its stdAc equivalent. More...
 

Private Member Functions

void setInvertedStates (void)
 Update the internal consistency check for the protocol. More...
 
String _toString (void) const
 Convert the internal state into a human readable string for the settings that are common to protocols of this nature. More...
 

Private Attributes

IRsend _irsend
 Instance of the IR send class. More...
 
Hitachi424Protocol _
 
uint8_t _previoustemp
 

Friends

class IRHitachiAc264
 
class IRHitachiAc344
 

Detailed Description

Class for handling detailed Hitachi 53-byte/424-bit A/C messages.

Constructor & Destructor Documentation

◆ IRHitachiAc424()

IRHitachiAc424::IRHitachiAc424 ( const uint16_t  pin,
const bool  inverted = false,
const bool  use_modulation = true 
)
explicit

Class constructor.

Parameters
[in]pinGPIO to be used when sending.
[in]invertedIs the output signal to be inverted?
[in]use_modulationIs frequency modulation to be used?

Member Function Documentation

◆ _toString()

String IRHitachiAc424::_toString ( void  ) const
private

Convert the internal state into a human readable string for the settings that are common to protocols of this nature.

Returns
A string containing the common settings in human-readable form.

◆ begin()

void IRHitachiAc424::begin ( void  )

Set up hardware to be able to send a message.

◆ calibrate()

int8_t IRHitachiAc424::calibrate ( void  )
inline

Run the calibration to calculate uSec timing offsets for this platform.

Returns
The uSec timing offset needed per modulation of the IR Led.
Note
This will produce a 65ms IR signal pulse at 38kHz. Only ever needs to be run once per object instantiation, if at all.

◆ convertFan()

uint8_t IRHitachiAc424::convertFan ( const stdAc::fanspeed_t  speed) const
virtual

Convert a stdAc::fanspeed_t enum into it's native speed.

Parameters
[in]speedThe enum to be converted.
Returns
The native equivalent of the enum.

Reimplemented in IRHitachiAc264.

◆ convertMode()

uint8_t IRHitachiAc424::convertMode ( const stdAc::opmode_t  mode)
static

Convert a stdAc::opmode_t enum into its native mode.

Parameters
[in]modeThe enum to be converted.
Returns
The native equivalent of the enum.

◆ getButton()

uint8_t IRHitachiAc424::getButton ( void  ) const

Get the Button/Command setting of the A/C.

Returns
The value of the button/command that was pressed.

◆ getFan()

uint8_t IRHitachiAc424::getFan ( void  ) const

Get the current fan speed setting.

Returns
The current fan speed.

◆ getMode()

uint8_t IRHitachiAc424::getMode ( void  ) const

Get the operating mode setting of the A/C.

Returns
The current operating mode setting.

◆ getPower()

bool IRHitachiAc424::getPower ( void  ) const

Get the value of the current power setting.

Returns
true, the setting is on. false, the setting is off.

◆ getRaw()

uint8_t * IRHitachiAc424::getRaw ( void  )

Get a PTR to the internal state/code for this protocol.

Returns
PTR to a code for this protocol based on the current internal state.

◆ getSwingVToggle()

bool IRHitachiAc424::getSwingVToggle ( void  ) const

Get the Vertical Swing toggle setting of the A/C.

Returns
true, the setting is on. false, the setting is off.

◆ getTemp()

uint8_t IRHitachiAc424::getTemp ( void  ) const

Get the current temperature setting.

Returns
The current setting for temp. in degrees celsius.

◆ off()

void IRHitachiAc424::off ( void  )

Change the power setting to Off.

◆ on()

void IRHitachiAc424::on ( void  )

Change the power setting to On.

◆ send()

void IRHitachiAc424::send ( const uint16_t  repeat = kHitachiAcDefaultRepeat)
virtual

Send the current internal state as an IR message.

Parameters
[in]repeatNr. of times the message will be repeated.

Reimplemented in IRHitachiAc264, and IRHitachiAc344.

◆ setButton()

void IRHitachiAc424::setButton ( const uint8_t  button)

Set the Button/Command pressed setting of the A/C.

Parameters
[in]buttonThe value of the button/command that was pressed.

◆ setFan()

void IRHitachiAc424::setFan ( const uint8_t  speed)
virtual

Set the speed of the fan.

Parameters
[in]speedThe desired setting.

Reimplemented in IRHitachiAc264.

◆ setInvertedStates()

void IRHitachiAc424::setInvertedStates ( void  )
private

Update the internal consistency check for the protocol.

◆ setMode()

void IRHitachiAc424::setMode ( const uint8_t  mode)

Set the operating mode of the A/C.

Parameters
[in]modeThe desired operating mode.

◆ setPower()

void IRHitachiAc424::setPower ( const bool  on)

Change the power setting.

Parameters
[in]ontrue, the setting is on. false, the setting is off.

◆ setRaw()

void IRHitachiAc424::setRaw ( const uint8_t  new_code[],
const uint16_t  length = kHitachiAc424StateLength 
)
virtual

Set the internal state from a valid code for this protocol.

Parameters
[in]new_codeA valid code for this protocol.
[in]lengthThe length of the new_code array.

Reimplemented in IRHitachiAc344, and IRHitachiAc264.

◆ setSwingVToggle()

void IRHitachiAc424::setSwingVToggle ( const bool  on)

Set the Vertical Swing toggle setting of the A/C.

Parameters
[in]ontrue, the setting is on. false, the setting is off.
Note
The remote does not keep state of the vertical swing. A byte is sent indicating the swing button is pressed on the remote

◆ setTemp()

void IRHitachiAc424::setTemp ( const uint8_t  celsius,
bool  setPrevious = true 
)

Set the temperature.

Parameters
[in]celsiusThe temperature in degrees celsius.
[in]setPrevioustrue, remember this if we change mode. false, don't.

◆ stateReset()

void IRHitachiAc424::stateReset ( void  )
virtual

Reset the internal state to a fixed known good state.

Note
Reset to auto fan, cooling, 23° Celsius

Reimplemented in IRHitachiAc264, and IRHitachiAc344.

◆ toCommon()

stdAc::state_t IRHitachiAc424::toCommon ( void  ) const
virtual

Convert the current internal state into its stdAc::state_t equivalent.

Returns
The stdAc equivalent of the native settings.

Reimplemented in IRHitachiAc264, and IRHitachiAc344.

◆ toCommonFanSpeed()

stdAc::fanspeed_t IRHitachiAc424::toCommonFanSpeed ( const uint8_t  speed) const
virtual

Convert a native fan speed into its stdAc equivalent.

Parameters
[in]speedThe native setting to be converted.
Returns
The stdAc equivalent of the native setting.

Reimplemented in IRHitachiAc264.

◆ toCommonMode()

stdAc::opmode_t IRHitachiAc424::toCommonMode ( const uint8_t  mode)
static

Convert a native mode into its stdAc equivalent.

Parameters
[in]modeThe native setting to be converted.
Returns
The stdAc equivalent of the native setting.

◆ toString()

String IRHitachiAc424::toString ( void  ) const
virtual

Convert the internal state into a human readable string.

Returns
A string containing the settings in human-readable form.

Reimplemented in IRHitachiAc264, and IRHitachiAc344.

Friends And Related Function Documentation

◆ IRHitachiAc264

friend class IRHitachiAc264
friend

◆ IRHitachiAc344

friend class IRHitachiAc344
friend

Member Data Documentation

◆ _

Hitachi424Protocol IRHitachiAc424::_
private

◆ _irsend

IRsend IRHitachiAc424::_irsend
private

Instance of the IR send class.

◆ _previoustemp

uint8_t IRHitachiAc424::_previoustemp
private

The documentation for this class was generated from the following files: