# IRremoteESP8266: IRHitachiAc3 Class Reference

IRHitachiAc3 Class Reference

Class for handling detailed Hitachi 15to27-byte/120to216-bit A/C messages. More...

`#include <ir_Hitachi.h>`

Collaboration diagram for IRHitachiAc3:
[legend]

## Public Member Functions

| IRHitachiAc3 (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
| Class constructor. More...
void | stateReset (void)
| Reset the internal state to a fixed known good state. More...
void | send (const uint16_t repeat=kHitachiAcDefaultRepeat)
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...
uint8_t | getMode (void)
uint8_t * | getRaw (void)
| Get a PTR to the internal state/code for this protocol. More...
void | setRaw (const uint8_t new_code[], const uint16_t length=kHitachiAc3StateLength)
| Set the internal state from a valid code for this protocol. More...

## Static Public Member Functions

static bool | hasInvertedStates (const uint8_t state[], const uint16_t length)
| Check if every second byte of the state, after the fixed header is inverted to the previous byte. More...

## Private Member Functions

void | setInvertedStates (const uint16_t length=kHitachiAc3StateLength)
| Invert every second byte of the internal state, after the fixed header. More...

## Private Attributes

IRsend | _irsend
| Instance of the IR send class. More...
uint8_t | remote_state [kHitachiAc3StateLength]
| The state in native code. More...

## Detailed Description

Class for handling detailed Hitachi 15to27-byte/120to216-bit A/C messages.

## Constructor & Destructor Documentation

## IRHitachiAc3()

IRHitachiAc3::IRHitachiAc3 | ( | const uint16_t | pin,
|  | const bool | inverted = `false`,
|  | const bool | use_modulation = `true`
| ) |  |

explicit

Class constructor.

Parameters

  [in] | pin | GPIO to be used when sending.
  [in] | inverted | Is the output signal to be inverted?
  [in] | use_modulation | Is frequency modulation to be used?

## Member Function Documentation

## begin()

void IRHitachiAc3::begin | ( | void |  | ) |

Set up hardware to be able to send a message.

## calibrate()

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

## getMode()

uint8_t IRHitachiAc3::getMode | ( | void |  | ) |

## getRaw()

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

## hasInvertedStates()

bool IRHitachiAc3::hasInvertedStates | ( | const uint8_t | state[],
|  | const uint16_t | length
| ) |  |

static

Check if every second byte of the state, after the fixed header is inverted to the previous byte.

Parameters

  [in] | state | The state array to be checked.
  [in] | length | The size of the state array.

Note
  This is this protocols integrity check.

## send()

void IRHitachiAc3::send | ( | const uint16_t | repeat = `kHitachiAcDefaultRepeat` | ) |

## setInvertedStates()

void IRHitachiAc3::setInvertedStates | ( | const uint16_t | length = `kHitachiAc3StateLength` | ) |

private

Invert every second byte of the internal state, after the fixed header.

Parameters

  [in] | length | The size of the state array.

Note
  This is this protocols integrity check.

## setRaw()

void IRHitachiAc3::setRaw | ( | const uint8_t | new_code[],
|  | const uint16_t | length = `kHitachiAc3StateLength`
| ) |  |

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

Parameters

  [in] | new_code | A valid code for this protocol.
  [in] | length | The length of the new_code array.

## stateReset()

void IRHitachiAc3::stateReset | ( | void |  | ) |

Reset the internal state to a fixed known good state.

Note
  Reset to auto fan, cooling, 23° Celsius

## Member Data Documentation

## _irsend

IRsend IRHitachiAc3::_irsend

private

Instance of the IR send class.

## remote_state

uint8_t IRHitachiAc3::remote_state[kHitachiAc3StateLength]

private

The state in native code.

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

- src/ir_Hitachi.h
- src/ir_Hitachi.cpp