# IRremoteESP8266: IRArgoAC Class Reference

IRArgoAC Class Reference

Class for handling detailed Argo A/C messages. More...

`#include <ir_Argo.h>`

Collaboration diagram for IRArgoAC:
[legend]

## Public Member Functions

| IRArgoAC (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
| Class constructor. More...
void | send (const uint16_t repeat=kArgoDefaultRepeat)
| 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 internal state to have the power on. More...
void | off (void)
| Set the internal state to have the power off. More...
void | setPower (const bool on)
| Set the internal state to have the desired power. More...
bool | getPower (void) const
| Get the power setting from the internal state. More...
void | setTemp (const uint8_t degrees)
| Set the temperature. More...
uint8_t | getTemp (void) const
| Get the current temperature setting. More...
void | setFan (const uint8_t fan)
| Set the speed of the fan. More...
uint8_t | getFan (void) const
| Get the current fan speed setting. More...
void | setFlap (const uint8_t flap)
| Set the flap position. i.e. Swing. More...
uint8_t | getFlap (void) const
| Get the flap position. i.e. Swing. More...
void | setMode (const uint8_t mode)
| Set the desired operation mode. More...
uint8_t | getMode (void) const
| Get the current operation mode setting. More...
void | setMax (const bool on)
| Control the current Max setting. (i.e. Turbo) More...
bool | getMax (void) const
| Is the Max (i.e. Turbo) setting on? More...
void | setNight (const bool on)
| Turn on/off the Night mode. i.e. Sleep. More...
bool | getNight (void) const
| Get the status of Night mode. i.e. Sleep. More...
void | setiFeel (const bool on)
| Turn on/off the iFeel mode. More...
bool | getiFeel (void) const
| Get the status of iFeel mode. More...
void | setTime (void)
| Set the time for the A/C. More...
void | setRoomTemp (const uint8_t degrees)
| Set the value for the current room temperature. More...
uint8_t | getRoomTemp (void) const
| Get the currently stored value for the room temperature setting. More...
uint8_t * | getRaw (void)
| Get the raw state of the object, suitable to be sent with the appropriate IRsend object method. More...
void | setRaw (const uint8_t state[])
| Set the raw state of the object. More...
stdAc::state_t | toCommon (void) const
| Convert the current internal state into its stdAc::state_t equivalent. More...
String | toString (void) const
| Convert the current internal state into a human readable string. More...

## Static Public Member Functions

static uint8_t | calcChecksum (const uint8_t state[], const uint16_t length=kArgoStateLength)
| Verify the checksum is valid for a given state. More...
static bool | validChecksum (const uint8_t state[], const uint16_t length=kArgoStateLength)
| 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 stdAc::opmode_t | toCommonMode (const uint8_t mode)
| Convert a native mode into its stdAc equivalent. More...
static stdAc::fanspeed_t | toCommonFanSpeed (const uint8_t speed)
| Convert a native fan speed into its stdAc equivalent. More...

## Private Member Functions

void | stateReset (void)
| Reset the internals of the object to a known good state. More...
void | checksum (void)
| Update the checksum for the internal state. More...

## Private Attributes

IRsend | _irsend
| instance of the IR send class More...
ArgoProtocol | _
uint8_t | flap_mode
uint8_t | heat_mode
uint8_t | cool_mode

## Detailed Description

Class for handling detailed Argo A/C messages.

## Constructor & Destructor Documentation

## IRArgoAC()

IRArgoAC::IRArgoAC | ( | 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 IRArgoAC::begin | ( | void |  | ) |

Set up hardware to be able to send a message.

## calcChecksum()

uint8_t IRArgoAC::calcChecksum | ( | const uint8_t | state[],
|  | const uint16_t | length = `kArgoStateLength`
| ) |  |

static

Verify the checksum is valid for a given state.

Parameters

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

Returns
  A boolean indicating if it's checksum is valid.

## calibrate()

int8_t IRArgoAC::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 IRArgoAC::checksum | ( | void |  | ) |

private

Update the checksum for the internal state.

## convertFan()

uint8_t IRArgoAC::convertFan | ( | const stdAc::fanspeed_t | speed | ) |

static

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

Parameters

  [in] | speed | The enum to be converted.

Returns
  The native equivalent of the enum.

## convertMode()

uint8_t IRArgoAC::convertMode | ( | const stdAc::opmode_t | mode | ) |

static

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

Parameters

  [in] | mode | The enum to be converted.

Returns
  The native equivalent of the enum.

## convertSwingV()

uint8_t IRArgoAC::convertSwingV | ( | const stdAc::swingv_t | position | ) |

static

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

Parameters

  [in] | position | The enum to be converted.

Returns
  The native equivalent of the enum.

## getFan()

uint8_t IRArgoAC::getFan | ( | void |  | ) | const

Get the current fan speed setting.

Returns
  The current fan speed.

## getFlap()

uint8_t IRArgoAC::getFlap | ( | void |  | ) | const

Get the flap position. i.e. Swing.

Warning
  Not yet working!

Returns
  The current flap setting.

## getiFeel()

bool IRArgoAC::getiFeel | ( | void |  | ) | const

Get the status of iFeel mode.

Returns
  true if on, false if off.

## getMax()

bool IRArgoAC::getMax | ( | void |  | ) | const

Is the Max (i.e. Turbo) setting on?

Returns
  The current value.

## getMode()

uint8_t IRArgoAC::getMode | ( | void |  | ) | const

Get the current operation mode setting.

Returns
  The current operation mode.

## getNight()

bool IRArgoAC::getNight | ( | void |  | ) | const

Get the status of Night mode. i.e. Sleep.

Returns
  true if on, false if off.

## getPower()

bool IRArgoAC::getPower | ( | void |  | ) | const

Get the power setting from the internal state.

Returns
  A boolean indicating the power setting.

## getRaw()

uint8_t * IRArgoAC::getRaw | ( | void |  | ) |

Get the raw state of the object, suitable to be sent with the appropriate IRsend object method.

Returns
  A PTR to the internal state.

## getRoomTemp()

uint8_t IRArgoAC::getRoomTemp | ( | void |  | ) | const

Get the currently stored value for the room temperature setting.

Returns
  The current setting for the room temp. in degrees celsius.

## getTemp()

uint8_t IRArgoAC::getTemp | ( | void |  | ) | const

Get the current temperature setting.

Returns
  The current setting for temp. in degrees celsius.

## off()

void IRArgoAC::off | ( | void |  | ) |

Set the internal state to have the power off.

## on()

void IRArgoAC::on | ( | void |  | ) |

Set the internal state to have the power on.

## send()

void IRArgoAC::send | ( | const uint16_t | repeat = `kArgoDefaultRepeat` | ) |

Send the current internal state as an IR message.

Parameters

  [in] | repeat | Nr. of times the message will be repeated.

## setFan()

void IRArgoAC::setFan | ( | const uint8_t | fan | ) |

Set the speed of the fan.

Parameters

  [in] | fan | The desired setting.

## setFlap()

void IRArgoAC::setFlap | ( | const uint8_t | flap | ) |

Set the flap position. i.e. Swing.

Warning
  Not yet working!

Parameters

  [in] | flap | The desired setting.

## setiFeel()

void IRArgoAC::setiFeel | ( | const bool | on | ) |

Turn on/off the iFeel mode.

Parameters

  [in] | on | The desired setting.

## setMax()

void IRArgoAC::setMax | ( | const bool | on | ) |

Control the current Max setting. (i.e. Turbo)

Parameters

  [in] | on | The desired setting.

## setMode()

void IRArgoAC::setMode | ( | const uint8_t | mode | ) |

Set the desired operation mode.

Parameters

  [in] | mode | The desired operation mode.

## setNight()

void IRArgoAC::setNight | ( | const bool | on | ) |

Turn on/off the Night mode. i.e. Sleep.

Parameters

  [in] | on | The desired setting.

## setPower()

void IRArgoAC::setPower | ( | const bool | on | ) |

Set the internal state to have the desired power.

Parameters

  [in] | on | The desired power state.

## setRaw()

void IRArgoAC::setRaw | ( | const uint8_t | state[] | ) |

Set the raw state of the object.

Parameters

  [in] | state | The raw state from the native IR message.

## setRoomTemp()

void IRArgoAC::setRoomTemp | ( | const uint8_t | degrees | ) |

Set the value for the current room temperature.

Parameters

  [in] | degrees | The temperature in degrees celsius.

## setTemp()

void IRArgoAC::setTemp | ( | const uint8_t | degrees | ) |

Set the temperature.

Parameters

  [in] | degrees | The temperature in degrees celsius.

Note
  Sending 0 equals +4

## setTime()

void IRArgoAC::setTime | ( | void |  | ) |

Set the time for the A/C.

Warning
  Not yet working!

## stateReset()

void IRArgoAC::stateReset | ( | void |  | ) |

private

Reset the internals of the object to a known good state.

## toCommon()

stdAc::state_t IRArgoAC::toCommon | ( | void |  | ) | const

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

Returns
  The stdAc equivalent of the native settings.

## toCommonFanSpeed()

stdAc::fanspeed_t IRArgoAC::toCommonFanSpeed | ( | const uint8_t | speed | ) |

static

Convert a native fan speed into its stdAc equivalent.

Parameters

  [in] | speed | The native setting to be converted.

Returns
  The stdAc equivalent of the native setting.

## toCommonMode()

stdAc::opmode_t IRArgoAC::toCommonMode | ( | const uint8_t | mode | ) |

static

Convert a native mode into its stdAc equivalent.

Parameters

  [in] | mode | The native setting to be converted.

Returns
  The stdAc equivalent of the native setting.

## toString()

String IRArgoAC::toString | ( | void |  | ) | const

Convert the current internal state into a human readable string.

Returns
  A human readable string.

## validChecksum()

bool IRArgoAC::validChecksum | ( | const uint8_t | state[],
|  | const uint16_t | length = `kArgoStateLength`
| ) |  |

static

Verify the checksum is valid for a given state.

Parameters

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

Returns
  A boolean indicating if it's checksum is valid.

## Member Data Documentation

## _

ArgoProtocol IRArgoAC::_

private

## _irsend

IRsend IRArgoAC::_irsend

private

instance of the IR send class

## cool_mode

uint8_t IRArgoAC::cool_mode

private

## flap_mode

uint8_t IRArgoAC::flap_mode

private

## heat_mode

uint8_t IRArgoAC::heat_mode

private

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

- src/ir_Argo.h
- src/ir_Argo.cpp