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

Class for handling detailed Mitsubishi Heavy 88-bit A/C messages. More...

#include <ir_MitsubishiHeavy.h>

Collaboration diagram for IRMitsubishiHeavy88Ac:
Collaboration graph
[legend]

Public Member Functions

 IRMitsubishiHeavy88Ac (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
 Class constructor. More...
 
void stateReset (void)
 Reset the state of the remote to a known good state/sequence. More...
 
void send (const uint16_t repeat=kMitsubishiHeavy88MinRepeat)
 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)
 Set the requested power state of the A/C to on. More...
 
void off (void)
 Set the requested power state of the A/C to off. More...
 
void setPower (const bool on)
 Change the power setting. More...
 
bool getPower (void)
 Get the value of the current power setting. More...
 
void setTemp (const uint8_t temp)
 Set the temperature. More...
 
uint8_t getTemp (void)
 Get the current temperature setting. More...
 
void setFan (const uint8_t fan)
 Set the speed of the fan. More...
 
uint8_t getFan (void)
 Get the current fan speed setting. More...
 
void setMode (const uint8_t mode)
 Set the operating mode of the A/C. More...
 
uint8_t getMode (void)
 Get the operating mode setting of the A/C. More...
 
void setSwingVertical (const uint8_t pos)
 Set the Vertical Swing mode of the A/C. More...
 
uint8_t getSwingVertical (void)
 Get the Vertical Swing mode of the A/C. More...
 
void setSwingHorizontal (const uint8_t pos)
 Set the Horizontal Swing mode of the A/C. More...
 
uint8_t getSwingHorizontal (void)
 Get the Horizontal Swing mode of the A/C. More...
 
void setTurbo (const bool on)
 Set the Turbo mode of the A/C. More...
 
bool getTurbo (void)
 Get the Turbo mode of the A/C. More...
 
void setEcono (const bool on)
 Set the Economical mode of the A/C. More...
 
bool getEcono (void)
 Get the Economical mode of the A/C. More...
 
void set3D (const bool on)
 Set the 3D mode of the A/C. More...
 
bool get3D (void)
 Get the 3D mode of the A/C. More...
 
void setClean (const bool on)
 Set the Clean mode of the A/C. More...
 
bool getClean (void)
 Get the Clean mode of the A/C. More...
 
uint8_t * getRaw (void)
 Get a PTR to the internal state/code for this protocol. More...
 
void setRaw (const uint8_t *data)
 Set the internal state from a valid code for this protocol. More...
 
stdAc::state_t toCommon (void)
 Convert the current internal state into its stdAc::state_t equivilant. More...
 
String toString (void)
 Convert the internal state into a human readable string. More...
 

Static Public Member Functions

static bool checkZjsSig (const uint8_t *state)
 Verify the given state has a ZJ-S signature. More...
 
static bool validChecksum (const uint8_t *state, const uint16_t length=kMitsubishiHeavy88StateLength)
 Verify the checksum is valid for a given state. More...
 
static uint8_t convertMode (const stdAc::opmode_t mode)
 Convert a stdAc::opmode_t enum into its native mode. More...
 
static uint8_t convertFan (const stdAc::fanspeed_t speed)
 Convert a stdAc::fanspeed_t enum into it's native speed. More...
 
static uint8_t convertSwingV (const stdAc::swingv_t position)
 Convert a stdAc::swingv_t enum into it's native setting. More...
 
static uint8_t convertSwingH (const stdAc::swingh_t position)
 Convert a stdAc::swingh_t enum into it's native setting. More...
 
static stdAc::fanspeed_t toCommonFanSpeed (const uint8_t speed)
 Convert a native fan speed into its stdAc equivilant. More...
 
static stdAc::swingv_t toCommonSwingV (const uint8_t pos)
 Convert a native vertical swing postion to it's common equivalent. More...
 
static stdAc::swingh_t toCommonSwingH (const uint8_t pos)
 Convert a native horizontal swing postion to it's common equivalent. More...
 

Private Member Functions

void checksum (void)
 Calculate the checksum for the current internal state of the remote. Note: Technically it has no checksum, but does has inverted byte pairs. More...
 

Private Attributes

IRsend _irsend
 Instance of the IR send class. More...
 
uint8_t remote_state [kMitsubishiHeavy88StateLength]
 State in code form. More...
 

Detailed Description

Class for handling detailed Mitsubishi Heavy 88-bit A/C messages.

Constructor & Destructor Documentation

◆ IRMitsubishiHeavy88Ac()

IRMitsubishiHeavy88Ac::IRMitsubishiHeavy88Ac ( 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

◆ begin()

void IRMitsubishiHeavy88Ac::begin ( void  )

Set up hardware to be able to send a message.

◆ calibrate()

int8_t IRMitsubishiHeavy88Ac::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.

◆ checksum()

void IRMitsubishiHeavy88Ac::checksum ( void  )
private

Calculate the checksum for the current internal state of the remote. Note: Technically it has no checksum, but does has inverted byte pairs.

◆ checkZjsSig()

bool IRMitsubishiHeavy88Ac::checkZjsSig ( const uint8_t *  state)
static

Verify the given state has a ZJ-S signature.

Parameters
[in]stateA ptr to a state to be checked.
Returns
true, the check passed. Otherwise, false.

◆ convertFan()

uint8_t IRMitsubishiHeavy88Ac::convertFan ( const stdAc::fanspeed_t  speed)
static

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

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

◆ convertMode()

uint8_t IRMitsubishiHeavy88Ac::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 equivilant of the enum.

◆ convertSwingH()

uint8_t IRMitsubishiHeavy88Ac::convertSwingH ( const stdAc::swingh_t  position)
static

Convert a stdAc::swingh_t enum into it's native setting.

Parameters
[in]positionThe enum to be converted.
Returns
The native equivilant of the enum.

◆ convertSwingV()

uint8_t IRMitsubishiHeavy88Ac::convertSwingV ( const stdAc::swingv_t  position)
static

Convert a stdAc::swingv_t enum into it's native setting.

Parameters
[in]positionThe enum to be converted.
Returns
The native equivilant of the enum.

◆ get3D()

bool IRMitsubishiHeavy88Ac::get3D ( void  )

Get the 3D mode of the A/C.

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

◆ getClean()

bool IRMitsubishiHeavy88Ac::getClean ( void  )

Get the Clean mode of the A/C.

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

◆ getEcono()

bool IRMitsubishiHeavy88Ac::getEcono ( void  )

Get the Economical mode of the A/C.

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

◆ getFan()

uint8_t IRMitsubishiHeavy88Ac::getFan ( void  )

Get the current fan speed setting.

Returns
The current fan speed/mode.

◆ getMode()

uint8_t IRMitsubishiHeavy88Ac::getMode ( void  )

Get the operating mode setting of the A/C.

Returns
The current operating mode setting.

◆ getPower()

bool IRMitsubishiHeavy88Ac::getPower ( void  )

Get the value of the current power setting.

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

◆ getRaw()

uint8_t * IRMitsubishiHeavy88Ac::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.

◆ getSwingHorizontal()

uint8_t IRMitsubishiHeavy88Ac::getSwingHorizontal ( void  )

Get the Horizontal Swing mode of the A/C.

Returns
The native position/mode setting.

◆ getSwingVertical()

uint8_t IRMitsubishiHeavy88Ac::getSwingVertical ( void  )

Get the Vertical Swing mode of the A/C.

Returns
The native position/mode setting.

◆ getTemp()

uint8_t IRMitsubishiHeavy88Ac::getTemp ( void  )

Get the current temperature setting.

Returns
The current setting for temp. in degrees celsius.

◆ getTurbo()

bool IRMitsubishiHeavy88Ac::getTurbo ( void  )

Get the Turbo mode of the A/C.

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

◆ off()

void IRMitsubishiHeavy88Ac::off ( void  )

Set the requested power state of the A/C to off.

◆ on()

void IRMitsubishiHeavy88Ac::on ( void  )

Set the requested power state of the A/C to on.

◆ send()

void IRMitsubishiHeavy88Ac::send ( const uint16_t  repeat = kMitsubishiHeavy88MinRepeat)

Send the current internal state as an IR message.

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

◆ set3D()

void IRMitsubishiHeavy88Ac::set3D ( const bool  on)

Set the 3D mode of the A/C.

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

◆ setClean()

void IRMitsubishiHeavy88Ac::setClean ( const bool  on)

Set the Clean mode of the A/C.

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

◆ setEcono()

void IRMitsubishiHeavy88Ac::setEcono ( const bool  on)

Set the Economical mode of the A/C.

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

◆ setFan()

void IRMitsubishiHeavy88Ac::setFan ( const uint8_t  speed)

Set the speed of the fan.

Parameters
[in]speedThe desired setting.

◆ setMode()

void IRMitsubishiHeavy88Ac::setMode ( const uint8_t  mode)

Set the operating mode of the A/C.

Parameters
[in]modeThe desired operating mode.

◆ setPower()

void IRMitsubishiHeavy88Ac::setPower ( const bool  on)

Change the power setting.

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

◆ setRaw()

void IRMitsubishiHeavy88Ac::setRaw ( const uint8_t *  data)

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

Parameters
[in]dataA valid code for this protocol.

◆ setSwingHorizontal()

void IRMitsubishiHeavy88Ac::setSwingHorizontal ( const uint8_t  pos)

Set the Horizontal Swing mode of the A/C.

Parameters
[in]posThe position/mode to set the swing to.

◆ setSwingVertical()

void IRMitsubishiHeavy88Ac::setSwingVertical ( const uint8_t  pos)

Set the Vertical Swing mode of the A/C.

Parameters
[in]posThe position/mode to set the swing to.

◆ setTemp()

void IRMitsubishiHeavy88Ac::setTemp ( const uint8_t  temp)

Set the temperature.

Parameters
[in]tempThe temperature in degrees celsius.

◆ setTurbo()

void IRMitsubishiHeavy88Ac::setTurbo ( const bool  on)

Set the Turbo mode of the A/C.

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

◆ stateReset()

void IRMitsubishiHeavy88Ac::stateReset ( void  )

Reset the state of the remote to a known good state/sequence.

◆ toCommon()

stdAc::state_t IRMitsubishiHeavy88Ac::toCommon ( void  )

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

Returns
The stdAc equivilant of the native settings.

◆ toCommonFanSpeed()

stdAc::fanspeed_t IRMitsubishiHeavy88Ac::toCommonFanSpeed ( const uint8_t  speed)
static

Convert a native fan speed into its stdAc equivilant.

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

◆ toCommonSwingH()

stdAc::swingh_t IRMitsubishiHeavy88Ac::toCommonSwingH ( const uint8_t  pos)
static

Convert a native horizontal swing postion to it's common equivalent.

Parameters
[in]posA native position to convert.
Returns
The common horizontal swing position.

◆ toCommonSwingV()

stdAc::swingv_t IRMitsubishiHeavy88Ac::toCommonSwingV ( const uint8_t  pos)
static

Convert a native vertical swing postion to it's common equivalent.

Parameters
[in]posA native position to convert.
Returns
The common vertical swing position.

◆ toString()

String IRMitsubishiHeavy88Ac::toString ( void  )

Convert the internal state into a human readable string.

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

◆ validChecksum()

bool IRMitsubishiHeavy88Ac::validChecksum ( const uint8_t *  state,
const uint16_t  length = kMitsubishiHeavy88StateLength 
)
static

Verify the checksum is valid for a given state.

Parameters
[in]stateThe array to verify the checksum of.
[in]lengthThe length/size of the state array.
Returns
true, if the state has a valid checksum. Otherwise, false. Note: Technically it has no checksum, but does has inverted byte pairs.

Member Data Documentation

◆ _irsend

IRsend IRMitsubishiHeavy88Ac::_irsend
private

Instance of the IR send class.

◆ remote_state

uint8_t IRMitsubishiHeavy88Ac::remote_state[kMitsubishiHeavy88StateLength]
private

State in code form.


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